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>
This commit is contained in:
Copilot
2026-03-11 19:40:42 +01:00
committed by GitHub
parent c51b086249
commit 9aeea4e715

View File

@@ -170,6 +170,17 @@ void uWS_App_ws(const FunctionCallbackInfo<Value> &args) {
).ToChecked();
}
}
/* Also copy symbol properties */
Local<Array> symbols;
if (userData->GetOwnPropertyNames(isolate->GetCurrentContext(), static_cast<PropertyFilter>(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 */