-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
At https://tc39.es/proposal-shadowrealm/#sec-export-getter-functions the 1. Assert: exports is a module namespace exotic object does not hold given a module that is also a thenable.
Repro:
export function then(resolve) {
resolve(42);
}
const sr = new ShadowRealm();
// Use import.meta.url to import this file itself as a module.
sr.importValue(import.meta.url, 'any_export').catch(() => {});
If I understand correctly this ends up doing:
7. Perform HostLoadImportedModule(referrer, specifierString, EMPTY, innerCapability).
-> "then it must perform FinishLoadingImportedModule(referrer, moduleRequest, payload, result)"
-> a. Perform ContinueDynamicImport(payload, result).
-> ii. Perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace »).
Which means the 42 in the above example will be passed to ExportGetter functions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels