Skip to content

Normative: Support cross-realm source imports#61

Open
guybedford wants to merge 1 commit intomainfrom
cross-realm
Open

Normative: Support cross-realm source imports#61
guybedford wants to merge 1 commit intomainfrom
cross-realm

Conversation

@guybedford
Copy link
Copy Markdown
Collaborator

@guybedford guybedford commented Mar 5, 2026

The new Module Source Record refactoring 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.

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
Base automatically changed from module-source to main March 24, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants