Normative: Support cross-realm source imports#61
Open
guybedford wants to merge 1 commit intomainfrom
Open
Conversation
guybedford
added a commit
to guybedford/test262
that referenced
this pull request
Mar 5, 2026
Implementing normative change tc39/proposal-esm-phase-imports#61, pending approval
guybedford
added a commit
to guybedford/test262
that referenced
this pull request
Mar 5, 2026
Implementing normative change tc39/proposal-esm-phase-imports#61, pending approval In addition this better obtains coverage against cross-context imports, allowing us to remove the complex agent test harness
guybedford
added a commit
to guybedford/test262
that referenced
this pull request
Mar 5, 2026
Implementing normative change tc39/proposal-esm-phase-imports#61, pending approval In addition this better obtains coverage against cross-context imports, allowing us to remove the complex agent test harness
guybedford
added a commit
to guybedford/test262
that referenced
this pull request
Mar 5, 2026
Implementing normative change tc39/proposal-esm-phase-imports#61, pending approval In addition this better obtains coverage against cross-context imports, allowing us to remove the complex agent test harness
legendecas
approved these changes
Mar 11, 2026
nicolo-ribaudo
approved these changes
Mar 11, 2026
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.
The new
Module Source Recordrefactoring in #58 and Module Source Object identity approach in #58 now allow us to define cross-realm imports, thereby laying the groundwork for cross-compartment imports as well.In the Module Source Record refactoring, we no longer can do a
[[Realm]]check because the ModuleSource doesn't associate with a realm.Instead we had to replace this check with an explicit prototype check to retain the existing normative invariants.
By simply removing this check, we now support sources being passed between realms.
With this change, a source import in one Realm (say sent to an iframe) and imported in the other Realm, will have a unique instance and instance identity in that other realm.
In addition, its ID string will define into the realm's module registry when its ID has not previously been defined.