From 7f6b6e17c9ff9b39596d0727a0d4ec6cdf93c8ac Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 30 Sep 2026 23:00:27 +0000 Subject: [PATCH 1/4] Updated GetReturnValue().Set to POD variants in WebSocketWrapper.h Co-authored-by: uNetworkingAB <110806833+uNetworkingAB@users.noreply.github.com> --- src/WebSocketWrapper.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/WebSocketWrapper.h b/src/WebSocketWrapper.h index 07a45d305..24a389b68 100644 --- a/src/WebSocketWrapper.h +++ b/src/WebSocketWrapper.h @@ -58,7 +58,7 @@ struct WebSocketWrapper { return; } bool success = ws->subscribe(topic.getString()); - args.GetReturnValue().Set(Boolean::New(isolate, success)); + args.GetReturnValue().Set(success); } } @@ -73,7 +73,7 @@ struct WebSocketWrapper { return; } bool success = ws->unsubscribe(topic.getString()); - args.GetReturnValue().Set(Boolean::New(isolate, success)); + args.GetReturnValue().Set(success); } } @@ -100,7 +100,7 @@ struct WebSocketWrapper { } bool success = ws->publish(topic.getString(), message.getString(), isBinary ? uWS::OpCode::BINARY : uWS::OpCode::TEXT, compress); - args.GetReturnValue().Set(Boolean::New(isolate, success)); + args.GetReturnValue().Set(success); } } @@ -169,7 +169,7 @@ struct WebSocketWrapper { auto *ws = getWebSocket(args); if (ws) { unsigned int port = ws->getRemotePort(); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, port)); + args.GetReturnValue().Set(port); } } @@ -180,7 +180,7 @@ struct WebSocketWrapper { auto *ws = getWebSocket(args); if (ws) { unsigned int bufferedAmount = ws->getBufferedAmount(); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, bufferedAmount)); + args.GetReturnValue().Set(bufferedAmount); } } @@ -197,7 +197,7 @@ struct WebSocketWrapper { unsigned int sendStatus = ws->sendFirstFragment(message.getString(), args[1]->BooleanValue(isolate) ? uWS::OpCode::BINARY : uWS::OpCode::TEXT, args[2]->BooleanValue(isolate)); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, sendStatus)); + args.GetReturnValue().Set(sendStatus); } } @@ -214,7 +214,7 @@ struct WebSocketWrapper { unsigned int sendStatus = ws->sendFragment(message.getString(), args[1]->BooleanValue(isolate)); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, sendStatus)); + args.GetReturnValue().Set(sendStatus); } } @@ -231,7 +231,7 @@ struct WebSocketWrapper { unsigned int sendStatus = ws->sendLastFragment(message.getString(), args[1]->BooleanValue(isolate)); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, sendStatus)); + args.GetReturnValue().Set(sendStatus); } } @@ -252,7 +252,7 @@ struct WebSocketWrapper { unsigned int sendStatus = ws->send(message.getString(), isBinary ? uWS::OpCode::BINARY : uWS::OpCode::TEXT, compress); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, sendStatus)); + args.GetReturnValue().Set(sendStatus); } } @@ -269,7 +269,7 @@ struct WebSocketWrapper { bool subscribed = ws->isSubscribed(topic.getString()); - args.GetReturnValue().Set(Boolean::New(isolate, subscribed)); + args.GetReturnValue().Set(subscribed); } } @@ -287,7 +287,7 @@ struct WebSocketWrapper { /* This is a wrapper that does not exist in the C++ project */ unsigned int sendStatus = ws->send(message.getString(), uWS::OpCode::PING); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, sendStatus)); + args.GetReturnValue().Set(sendStatus); } } From d4eab93b273070ce8d22567d81ef3397a63cb0ae Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 30 Sep 2026 23:02:00 +0000 Subject: [PATCH 2/4] Updated GetReturnValue().Set to POD variants in HttpResponseWrapper.h Co-authored-by: uNetworkingAB <110806833+uNetworkingAB@users.noreply.github.com> --- src/HttpResponseWrapper.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/HttpResponseWrapper.h b/src/HttpResponseWrapper.h index b11d811c7..86192280f 100644 --- a/src/HttpResponseWrapper.h +++ b/src/HttpResponseWrapper.h @@ -275,7 +275,7 @@ struct HttpResponseWrapper { if (res) { unsigned int port = res->getRemotePort(); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, port)); + args.GetReturnValue().Set(port); } } @@ -311,7 +311,7 @@ struct HttpResponseWrapper { if (res) { unsigned int port = res->getProxiedRemotePort(); - args.GetReturnValue().Set(Integer::NewFromUnsigned(isolate, port)); + args.GetReturnValue().Set(port); } } @@ -333,7 +333,7 @@ struct HttpResponseWrapper { Isolate *isolate = args.GetIsolate(); auto *res = getHttpResponse(args); if (res) { - args.GetReturnValue().Set(Number::New(isolate, getHttpResponse(args)->getWriteOffset())); + args.GetReturnValue().Set((double) res->getWriteOffset()); } } @@ -473,7 +473,7 @@ struct HttpResponseWrapper { assumeCorked(); bool ok = res->write(data.getString()); - args.GetReturnValue().Set(Boolean::New(isolate, ok)); + args.GetReturnValue().Set(ok); } } From 1aacc44576421b0d0c871d86a664897de721ecfc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 30 Sep 2026 23:03:33 +0000 Subject: [PATCH 3/4] Updated GetReturnValue().Set to POD variants in AppWrapper.h Co-authored-by: uNetworkingAB <110806833+uNetworkingAB@users.noreply.github.com> --- src/AppWrapper.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AppWrapper.h b/src/AppWrapper.h index 6978e022b..e32414310 100644 --- a/src/AppWrapper.h +++ b/src/AppWrapper.h @@ -649,7 +649,7 @@ void uWS_App_publish(const FunctionCallbackInfo &args) { bool ok = app->publish(topic.getString(), message.getString(), args[2]->BooleanValue(isolate) ? uWS::OpCode::BINARY : uWS::OpCode::TEXT, args[3]->BooleanValue(isolate)); - args.GetReturnValue().Set(Boolean::New(isolate, ok)); + args.GetReturnValue().Set(ok); } template @@ -668,7 +668,7 @@ void uWS_App_numSubscribers(const FunctionCallbackInfo &args) { return; } - args.GetReturnValue().Set(Integer::New(isolate, app->numSubscribers(topic.getString()))); + args.GetReturnValue().Set((uint32_t) app->numSubscribers(topic.getString())); } /* This one modified per-thread static strings temporarily */ @@ -832,7 +832,7 @@ void uWS_App_getDescriptor(const FunctionCallbackInfo &args) { //std::cout << "Loop: " << app->getLoop() << std::endl; - args.GetReturnValue().Set(Number::New(isolate, descriptor)); + args.GetReturnValue().Set(descriptor); } template From 156c12e4736ba158afb84d47e8134fd614234843 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 30 Sep 2026 23:04:12 +0000 Subject: [PATCH 4/4] Updated GetReturnValue().Set to POD variants in addon.cpp Co-authored-by: uNetworkingAB <110806833+uNetworkingAB@users.noreply.github.com> --- src/addon.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/addon.cpp b/src/addon.cpp index 84840c626..7e9a44db8 100644 --- a/src/addon.cpp +++ b/src/addon.cpp @@ -133,7 +133,7 @@ void uWS_setTimeout(const FunctionCallbackInfo &args) { //timerCallbacksJS[timer].Reset(args.GetIsolate(), Local::Cast(args[0])); - //args.GetReturnValue().Set(Integer::New(args.GetIsolate(), timer)); + //args.GetReturnValue().Set(timer); } void uWS_clearTimeout(const FunctionCallbackInfo &args) { @@ -185,7 +185,7 @@ void uWS_us_socket_local_port(const FunctionCallbackInfo &args) { return; } int port = us_socket_local_port(0, (struct us_socket_t *) External::Cast(*args[0])->Value()); - args.GetReturnValue().Set(Integer::New(args.GetIsolate(), port)); + args.GetReturnValue().Set(port); } /* Temporary KV store (doesn't belong here) */ @@ -245,7 +245,7 @@ void uWS_getInteger(const FunctionCallbackInfo &args) { uint32_t value = kvStoreInteger[std::string(collection.getString())][std::string(key.getString())]; - args.GetReturnValue().Set(Integer::New(args.GetIsolate(), value)); + args.GetReturnValue().Set(value); } void uWS_setInteger(const FunctionCallbackInfo &args) { @@ -279,7 +279,7 @@ void uWS_incInteger(const FunctionCallbackInfo &args) { uint32_t value = kvStoreInteger[std::string(collection.getString())][std::string(key.getString())] += change; - args.GetReturnValue().Set(Integer::New(args.GetIsolate(), value)); + args.GetReturnValue().Set(value); } /* This one will spike memory usage for large stores */ @@ -337,7 +337,7 @@ void uWS_deleteString(const FunctionCallbackInfo &args) { kvStoreString[std::string(collection.getString())].erase(std::string(key.getString())); - //args.GetReturnValue().Set(Integer::New(args.GetIsolate(), value)); + //args.GetReturnValue().Set(value); } void uWS_deleteInteger(const FunctionCallbackInfo &args) { @@ -354,7 +354,7 @@ void uWS_deleteInteger(const FunctionCallbackInfo &args) { kvStoreInteger[std::string(collection.getString())].erase(std::string(key.getString())); - //args.GetReturnValue().Set(Integer::New(args.GetIsolate(), value)); + //args.GetReturnValue().Set(value); } void uWS_deleteStringCollection(const FunctionCallbackInfo &args) {