Skip to content

ESM Phase Imports Test Suite#4971

Draft
guybedford wants to merge 4 commits intotc39:mainfrom
guybedford:esm-phase-imports-tests
Draft

ESM Phase Imports Test Suite#4971
guybedford wants to merge 4 commits intotc39:mainfrom
guybedford:esm-phase-imports-tests

Conversation

@guybedford
Copy link

@guybedford guybedford commented Mar 5, 2026

This implements a draft 262 test suite for ESM Phase Imports, which is based to the following two normative changes that have not yet obtained consensus in plenary:

This includes full coverage of the detailed module keying semantics for the behaviour of import(source) for a module source including consolidation with string imports, injective behaviour across contexts and cross realm imports.

Since there is no ModuleConstructor, we depend on a host intrinsic $262.createModuleSource(sourceText, id) to create module sources.

To carefully ensure we can determine module identity, we also define $262.importMetaHook which allows us to define import.meta.moduleId as a proxy for import.meta.url to ensure we can validate cross-keying semantics.

@guybedford guybedford force-pushed the esm-phase-imports-tests branch from e90ec63 to ac34904 Compare March 5, 2026 03:53
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 guybedford force-pushed the esm-phase-imports-tests branch 2 times, most recently from 634ab92 to 53f8ac5 Compare March 5, 2026 23:22
@guybedford guybedford force-pushed the esm-phase-imports-tests branch from 53f8ac5 to 0facc6a Compare March 5, 2026 23:23
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.

1 participant