diff --git a/demo_phase9_51_fixes.nyash b/demo_phase9_51_fixes.nyash new file mode 100644 index 00000000..f76218f3 --- /dev/null +++ b/demo_phase9_51_fixes.nyash @@ -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 + } +} \ No newline at end of file diff --git a/test_socket_chain.nyash b/test_socket_chain.nyash deleted file mode 100644 index 212acb0e..00000000 --- a/test_socket_chain.nyash +++ /dev/null @@ -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 - } -} \ No newline at end of file diff --git a/test_socket_direct.nyash b/test_socket_direct.nyash deleted file mode 100644 index 430b6903..00000000 --- a/test_socket_direct.nyash +++ /dev/null @@ -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 - } -} \ No newline at end of file diff --git a/test_socket_simple.nyash b/test_socket_simple.nyash deleted file mode 100644 index 3fe3c911..00000000 --- a/test_socket_simple.nyash +++ /dev/null @@ -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 - } -} \ No newline at end of file