Repository navigation
fix(runtime): expose the effective native member guard state to JS - #604
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 54 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
The native member guard is on only in debug builds under the rooted and canary wrapper lifetime modes, unless allowShadowingNativeMembers is set. The specs derived it from the mode and that config alone, so a Release run of the suite under rooted or canary expected a guard the runtime leaves off. Add the read-only ns:runtime config key wrapperLifetimeGuardsNativeMembers, which reports GuardsNativeMembers(), and have NativeMemberGuardTests and WrapperLifetimeModesTests read it. A spec checks the key both ways against the mode, the shadowing config and the build (detected through the debug-only ns:module canonicalizeHttpUrlKey export).
edusperoni
force-pushed
the
fix/native-member-guard-state
branch
from
November 23, 2026 03:33
e305012 to
fe7945b
Compare
edusperoni
marked this pull request as ready for review
November 23, 2026 03:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #593, from its last CodeRabbit review. The native member guard is on only in debug builds under
"rooted"or"canary"withoutallowShadowingNativeMembers, but the specs derived it from the mode and config alone. A Release run of the suite under rooted or canary therefore expected a guard the runtime leaves off.Changes
New read-only
ns:runtimekeywrapperLifetimeGuardsNativeMembers:getConfigreturns the runtime's effective guard state, andsetConfigthrows like the other read-only wrapper lifetime keys. It is documented in the config table and the "Native member guard" section, and typed intypes/ns-runtime.d.ts.NativeMemberGuardTests.jsandWrapperLifetimeModesTests.jsread the guard state from that key.The "reports the guard state read-only" spec checks both directions:
Debug is detected the way
HttpEsmLoaderTestsdoes it, fromcanonicalizeHttpUrlKey, which the runtime exposes under the sameIsDebugflag that gates the guard.Testing