Complete SocketBox deadlock fix: Clean up debug logging and add comprehensive tests

Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-08-14 12:29:38 +00:00
parent 06694296a7
commit 5ada387c73
3 changed files with 60 additions and 9 deletions

View File

@ -17,24 +17,15 @@ impl NyashInterpreter {
) -> Result<Box<dyn NyashBox>, RuntimeError> {
match method {
"bind" => {
eprintln!("🔥 SOCKET_METHOD: bind() called");
if arguments.len() != 2 {
return Err(RuntimeError::InvalidOperation {
message: format!("bind() expects 2 arguments, got {}", arguments.len()),
});
}
eprintln!("🔥 SOCKET_METHOD: Evaluating address argument...");
let address = self.execute_expression(&arguments[0])?;
eprintln!("🔥 SOCKET_METHOD: Address evaluated: {}", address.to_string_box().value);
eprintln!("🔥 SOCKET_METHOD: Evaluating port argument...");
let port = self.execute_expression(&arguments[1])?;
eprintln!("🔥 SOCKET_METHOD: Port evaluated: {}", port.to_string_box().value);
eprintln!("🔥 SOCKET_METHOD: Calling socket_box.bind()...");
let result = socket_box.bind(address, port);
eprintln!("🔥 SOCKET_METHOD: bind() completed");
Ok(result)
}
"listen" => {