Add demo showing Phase 9.51 fixes working together

Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-08-14 07:16:40 +00:00
parent 85a5ce053d
commit 99858ecfaa
4 changed files with 30 additions and 51 deletions

View File

@ -0,0 +1,30 @@
// Demo: Phase 9.51 WASM + HTTPServer fixes working
static box Main {
init { counter, result, server }
main() {
// WASM-compatible loop (Jump/Branch instructions now supported)
me.counter = 0
me.result = 0
loop(me.counter < 5) {
me.result = me.result + me.counter
me.counter = me.counter + 1
}
print("Loop result (WASM-compatible):")
print(me.result)
// HTTPServer bind + listen now works
me.server = new HTTPServerBox()
local bindOk = me.server.bind("127.0.0.1", 8080)
local listenOk = me.server.listen(10)
print("HTTPServer bind:")
print(bindOk)
print("HTTPServer listen:")
print(listenOk)
return me.result
}
}

View File

@ -1,18 +0,0 @@
// Test if chaining works differently
static box Main {
init { socket, console }
main() {
me.socket = new SocketBox()
me.console = new ConsoleBox()
// Test if we can store and use a bound socket directly
me.socket.bind("127.0.0.1", 8080)
me.console.log("After bind, testing listen:")
local listenResult = me.socket.listen(10)
print(listenResult)
return listenResult
}
}

View File

@ -1,20 +0,0 @@
// Test SocketBox directly
static box Main {
init { socket, console }
main() {
me.socket = new SocketBox()
me.console = new ConsoleBox()
// Test bind and listen operations directly on SocketBox
local bindResult = me.socket.bind("127.0.0.1", 8080)
me.console.log("SocketBox Bind result:")
print(bindResult)
local listenResult = me.socket.listen(10)
me.console.log("SocketBox Listen result:")
print(listenResult)
return listenResult
}
}

View File

@ -1,13 +0,0 @@
// Simple HTTP Box test
static box Main {
init { socket }
main() {
print("🔌 Testing SocketBox creation...")
me.socket = new SocketBox()
print("✅ SocketBox created: " + me.socket.toString())
return true
}
}