-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[browser] don't set js_handle for js prototypes #115773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses the issue of setting js_handle for JavaScript prototypes in the browser runtime by adding a conditional check in the gc-handles module and corresponding test coverage.
- Introduces a check in gc-handles.ts to bypass setting the js_handle on JS prototype objects.
- Adds a new unit test to verify distinct behavior for prototypes.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/mono/browser/runtime/gc-handles.ts | Adds a condition to avoid setting cs_owned_js_handle_symbol on JS prototype objects. |
src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs | Adds a new test to validate that prototypes are handled differently. |
Comments suppressed due to low confidence (1)
src/libraries/System.Runtime.InteropServices.JavaScript/tests/System.Runtime.InteropServices.JavaScript.UnitTests/System/Runtime/InteropServices/JavaScript/JSImportTest.cs:23
- Consider extending the test to also verify that the cs_owned_js_handle_symbol property is not set on prototype objects, ensuring complete coverage of the intended functionality.
[Fact]
Tagging subscribers to 'arch-wasm': @lewing |
Fixes #110716