Draft: Initial implementation of ShadowRealm built-in with realm isolation#5077
Draft
ParthMozarkar wants to merge 20 commits intoboa-dev:mainfrom
Draft
Draft: Initial implementation of ShadowRealm built-in with realm isolation#5077ParthMozarkar wants to merge 20 commits intoboa-dev:mainfrom
ParthMozarkar wants to merge 20 commits intoboa-dev:mainfrom
Conversation
The test test_complex_tuple_decode_out_of_bounds provided an array of size 3 for a type that requires 3 bytes ((u8, i8) where the first is the format u8). Modifying the test array to [0, 1] reduces length to 2, correctly testing the bounds error. Also explicitly used the unified read::<u8> to bounds check reading the format byte across decode implementations.
Test262 conformance changes
Tested main commit: |
jedel1043
reviewed
Mar 15, 2026
Member
|
Don't forget to gate everything behind the |
…wRealm behind 'experimental'
Author
yaa sure you could check my next commit and review once if anything is else needed? |
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.
Draft PR: Initial Implementation of ShadowRealm Built-in
This PR introduces an initial implementation of the
ShadowRealmbuilt-in object based on the TC39 ShadowRealm proposal.The purpose of this draft PR is to establish the core realm isolation mechanism and provide a foundation for the remaining features of
ShadowRealm.Implemented Features
ShadowRealm Constructor
ShadowRealmbuilt-in constructor.new ShadowRealm()correctly creates a ShadowRealm instance.Realm Isolation
ShadowRealm.prototype.evaluate.evaluateruns in a separate and fully isolated realm.Example behavior:
This confirms that state changes inside the ShadowRealm do not affect the host realm.
Tests
Unit tests were added to verify:
evaluateAll added tests are currently passing.
Test file:
Code Changes
New files:
Updated files:
These updates register the
ShadowRealmbuilt-in and integrate it into the engine intrinsics and static strings.Remaining Work
This PR is opened as a Draft because some parts of the ShadowRealm specification are not yet implemented.
Callable Masking
Functions returned across realms are not yet supported. Proper wrapped callable objects still need to be implemented.
importValueSupport for dynamic module imports inside the ShadowRealm (
ShadowRealm.prototype.importValue) has not yet been implemented.Next Steps
Planned follow-up work includes:
ShadowRealm.prototype.importValueRequest for Feedback
Opening this as a Draft PR to get early feedback on the approach and integration before continuing with the remaining parts of the implementation.