From 9aeea4e715274da7960bd503679ffef14b66b968 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 19:40:42 +0100 Subject: [PATCH] Support symbol-keyed properties in WebSocket UserData (#1228) * Initial plan * Fix: Support symbol keys in UserData for WebSocket upgrade (issue #1184) Co-authored-by: uNetworkingAB <110806833+uNetworkingAB@users.noreply.github.com> * Remove accidentally committed build artifacts and add .gitignore Co-authored-by: uNetworkingAB <110806833+uNetworkingAB@users.noreply.github.com> * Delete .gitignore --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: uNetworkingAB <110806833+uNetworkingAB@users.noreply.github.com> --- src/AppWrapper.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/AppWrapper.h b/src/AppWrapper.h index ca3df6b9..ad69249e 100644 --- a/src/AppWrapper.h +++ b/src/AppWrapper.h @@ -170,6 +170,17 @@ void uWS_App_ws(const FunctionCallbackInfo &args) { ).ToChecked(); } } + + /* Also copy symbol properties */ + Local symbols; + if (userData->GetOwnPropertyNames(isolate->GetCurrentContext(), static_cast(SKIP_STRINGS)).ToLocal(&symbols)) { + for (int i = 0; i < symbols->Length(); i++) { + wsObject->Set(isolate->GetCurrentContext(), + symbols->Get(isolate->GetCurrentContext(), i).ToLocalChecked(), + userData->Get(isolate->GetCurrentContext(), symbols->Get(isolate->GetCurrentContext(), i).ToLocalChecked()).ToLocalChecked() + ).ToChecked(); + } + } } /* Attach a new V8 object with pointer to us, to it */