Name Description Size
browser.js 0
empty_FIXTURE.js 181
eval-rqstd-abrupt-err-type_FIXTURE.js 199
eval-rqstd-abrupt-err-uri_FIXTURE.js 198
instn-iee-err-ambiguous-1_FIXTURE.js 190
instn-iee-err-ambiguous-2_FIXTURE.js 190
instn-iee-err-ambiguous-export_FIXTURE.js 234
instn-iee-err-ambiguous_FIXTURE.js 288
instn-iee-err-circular-1_FIXTURE.js 235
instn-iee-err-circular-2_FIXTURE.js 235
nested-arrow-import-catch-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested arrow) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1502
nested-arrow-import-catch-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested arrow) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1499
nested-arrow-import-catch-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested arrow) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1639
nested-arrow-import-catch-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (nested arrow) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1414
nested-arrow-import-catch-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (nested arrow) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2489
nested-arrow-import-catch-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested arrow) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2290
nested-arrow-import-catch-import-source-specifier-tostring.js --- description: ToString value of specifier (nested arrow) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2597
nested-arrow-import-catch-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (nested arrow) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2484
nested-arrow-import-catch-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (nested arrow) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1864
nested-arrow-import-catch-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested arrow) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1901
nested-async-arrow-function-await-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested in async arrow function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1553
nested-async-arrow-function-await-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested in async arrow function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1550
nested-async-arrow-function-await-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested in async arrow function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1690
nested-async-arrow-function-await-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (nested in async arrow function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1465
nested-async-arrow-function-await-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (nested in async arrow function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2540
nested-async-arrow-function-await-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested in async arrow function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2341
nested-async-arrow-function-await-import-source-specifier-tostring.js --- description: ToString value of specifier (nested in async arrow function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2648
nested-async-arrow-function-await-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (nested in async arrow function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2535
nested-async-arrow-function-await-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (nested in async arrow function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1915
nested-async-arrow-function-await-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested in async arrow function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1952
nested-async-arrow-function-return-await-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested in async arrow function, returned) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1555
nested-async-arrow-function-return-await-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested in async arrow function, returned) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1552
nested-async-arrow-function-return-await-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested in async arrow function, returned) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1692
nested-async-arrow-function-return-await-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (nested in async arrow function, returned) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1467
nested-async-arrow-function-return-await-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (nested in async arrow function, returned) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2542
nested-async-arrow-function-return-await-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested in async arrow function, returned) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2343
nested-async-arrow-function-return-await-import-source-specifier-tostring.js --- description: ToString value of specifier (nested in async arrow function, returned) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2650
nested-async-arrow-function-return-await-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (nested in async arrow function, returned) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2537
nested-async-arrow-function-return-await-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (nested in async arrow function, returned) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1917
nested-async-arrow-function-return-await-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested in async arrow function, returned) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1954
nested-async-function-await-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested in async function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1548
nested-async-function-await-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested in async function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1545
nested-async-function-await-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested in async function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1685
nested-async-function-await-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (nested in async function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1460
nested-async-function-await-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (nested in async function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2535
nested-async-function-await-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested in async function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2336
nested-async-function-await-import-source-specifier-tostring.js --- description: ToString value of specifier (nested in async function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2643
nested-async-function-await-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (nested in async function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2530
nested-async-function-await-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (nested in async function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1910
nested-async-function-await-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested in async function, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1947
nested-async-function-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested in async function) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1528
nested-async-function-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested in async function) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1525
nested-async-function-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested in async function) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1665
nested-async-function-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (nested in async function) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1440
nested-async-function-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (nested in async function) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2515
nested-async-function-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested in async function) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2316
nested-async-function-import-source-specifier-tostring.js --- description: ToString value of specifier (nested in async function) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2623
nested-async-function-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (nested in async function) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2510
nested-async-function-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (nested in async function) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1890
nested-async-function-return-await-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested in async function, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1570
nested-async-function-return-await-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested in async function, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1567
nested-async-function-return-await-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested in async function, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1707
nested-async-function-return-await-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (nested in async function, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1482
nested-async-function-return-await-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (nested in async function, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2557
nested-async-function-return-await-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested in async function, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2358
nested-async-function-return-await-import-source-specifier-tostring.js --- description: ToString value of specifier (nested in async function, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2665
nested-async-function-return-await-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (nested in async function, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2552
nested-async-function-return-await-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (nested in async function, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1932
nested-async-function-return-await-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested in async function, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1969
nested-async-function-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested in async function) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1927
nested-async-gen-await-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested in async generator, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1572
nested-async-gen-await-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested in async generator, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1569
nested-async-gen-await-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested in async generator, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import, async-iteration] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1709
nested-async-gen-await-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (nested in async generator, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1484
nested-async-gen-await-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (nested in async generator, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2559
nested-async-gen-await-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested in async generator, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2360
nested-async-gen-await-import-source-specifier-tostring.js --- description: ToString value of specifier (nested in async generator, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2667
nested-async-gen-await-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (nested in async generator, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2554
nested-async-gen-await-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (nested in async generator, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1934
nested-async-gen-await-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested in async generator, awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1971
nested-async-gen-return-await-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested in async generator, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1594
nested-async-gen-return-await-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested in async generator, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1591
nested-async-gen-return-await-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested in async generator, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import, async-iteration] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1731
nested-async-gen-return-await-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (nested in async generator, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1506
nested-async-gen-return-await-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (nested in async generator, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2581
nested-async-gen-return-await-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested in async generator, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2382
nested-async-gen-return-await-import-source-specifier-tostring.js --- description: ToString value of specifier (nested in async generator, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2689
nested-async-gen-return-await-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (nested in async generator, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2576
nested-async-gen-return-await-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (nested in async generator, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1956
nested-async-gen-return-await-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested in async generator, returns awaited) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import, async-iteration] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1993
nested-block-import-catch-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested block) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1482
nested-block-import-catch-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested block) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1479
nested-block-import-catch-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested block) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1619
nested-block-import-catch-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (nested block) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1394
nested-block-import-catch-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (nested block) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2469
nested-block-import-catch-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested block) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2270
nested-block-import-catch-import-source-specifier-tostring.js --- description: ToString value of specifier (nested block) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2577
nested-block-import-catch-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (nested block) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2464
nested-block-import-catch-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (nested block) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1844
nested-block-import-catch-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested block) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1881
nested-block-labeled-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested block syntax) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1504
nested-block-labeled-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested block syntax) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1501
nested-block-labeled-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested block syntax) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1641
nested-block-labeled-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (nested block syntax) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1416
nested-block-labeled-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (nested block syntax) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2491
nested-block-labeled-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested block syntax) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2292
nested-block-labeled-import-source-specifier-tostring.js --- description: ToString value of specifier (nested block syntax) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2599
nested-block-labeled-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (nested block syntax) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2486
nested-block-labeled-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (nested block syntax) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1866
nested-block-labeled-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested block syntax) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1903
nested-do-while-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested do while syntax) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1512
nested-do-while-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested do while syntax) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1509
nested-do-while-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested do while syntax) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1649
nested-do-while-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (nested do while syntax) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1424
nested-do-while-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (nested do while syntax) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2499
nested-do-while-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested do while syntax) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2300
nested-do-while-import-source-specifier-tostring.js --- description: ToString value of specifier (nested do while syntax) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2607
nested-do-while-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (nested do while syntax) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2494
nested-do-while-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (nested do while syntax) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1874
nested-do-while-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested do while syntax) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1911
nested-else-import-catch-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested else) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1500
nested-else-import-catch-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested else) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1497
nested-else-import-catch-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested else) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1637
nested-else-import-catch-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (nested else) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1412
nested-else-import-catch-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (nested else) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2487
nested-else-import-catch-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested else) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2288
nested-else-import-catch-import-source-specifier-tostring.js --- description: ToString value of specifier (nested else) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2595
nested-else-import-catch-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (nested else) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2482
nested-else-import-catch-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (nested else) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1862
nested-else-import-catch-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested else) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1899
nested-function-import-catch-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested function) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1505
nested-function-import-catch-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested function) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1502
nested-function-import-catch-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested function) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1642
nested-function-import-catch-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (nested function) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1417
nested-function-import-catch-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (nested function) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2492
nested-function-import-catch-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested function) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2293
nested-function-import-catch-import-source-specifier-tostring.js --- description: ToString value of specifier (nested function) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2600
nested-function-import-catch-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (nested function) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2487
nested-function-import-catch-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (nested function) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1867
nested-function-import-catch-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested function) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1904
nested-if-import-catch-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested if) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1485
nested-if-import-catch-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested if) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1482
nested-if-import-catch-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested if) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1622
nested-if-import-catch-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (nested if) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1397
nested-if-import-catch-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (nested if) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2472
nested-if-import-catch-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested if) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2273
nested-if-import-catch-import-source-specifier-tostring.js --- description: ToString value of specifier (nested if) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2580
nested-if-import-catch-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (nested if) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2467
nested-if-import-catch-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (nested if) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1847
nested-if-import-catch-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested if) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1884
nested-while-import-catch-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested while) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1511
nested-while-import-catch-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (nested while) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1508
nested-while-import-catch-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested while) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1648
nested-while-import-catch-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (nested while) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1423
nested-while-import-catch-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (nested while) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2498
nested-while-import-catch-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested while) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2299
nested-while-import-catch-import-source-specifier-tostring.js --- description: ToString value of specifier (nested while) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2606
nested-while-import-catch-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (nested while) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2493
nested-while-import-catch-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (nested while) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1873
nested-while-import-catch-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (nested while) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1910
script-code_FIXTURE.js 388
shell.js 0
top-level-import-catch-eval-rqstd-abrupt-typeerror.js --- description: Abrupt completion during module evaluation precludes further evaluation (top level) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1465
top-level-import-catch-eval-rqstd-abrupt-urierror.js --- description: Abrupt completion during module evaluation precludes further evaluation (top level) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 6. For each String required that is an element of module.[[RequestedModules]] do, a. Let requiredModule be ? HostResolveImportedModule(module, required). b. Perform ? requiredModule.ModuleEvaluation(). --- 1462
top-level-import-catch-eval-script-code-target.js --- description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (top level) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, module, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Modules Static Semantics: Early Errors ModuleBody : ModuleItemList - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries. - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList. --- 1602
top-level-import-catch-file-does-not-exist.js --- description: Non existent file can't resolve to a Script or Module Record (top level) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule, specifier does not exist or cannot be created, an exception must be thrown. --- 1377
top-level-import-catch-import-source-source-text-module.js --- description: GetModuleSource of SourceTextModule always returns an abrupt completion. (top level) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2452
top-level-import-catch-import-source-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (top level) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. --- 2253
top-level-import-catch-import-source-specifier-tostring.js --- description: ToString value of specifier (top level) esid: sec-import-call-runtime-semantics-evaluation features: [source-phase-imports, dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import . source ( AssignmentExpression ) 1. Return ? EvaluateImportCall(AssignmentExpression, source). 13.3.10.1.1 EvaluateImportCall ( specifierExpression, phase ) 1. Let referrer be GetActiveScriptOrModule(). 2. If referrer is null, set referrer to the current Realm Record. 3. Let specifierRef be ? Evaluation of specifierExpression. 4. Let specifier be ? GetValue(specifierRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be Completion(ToString(specifier)). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Let moduleRequest be a new ModuleRequest Record { [[Specifier]]: specifierString, [[Phase]]: phase }. 9. Perform HostLoadImportedModule(referrer, moduleRequest, empty, promiseCapability). 10. Return promiseCapability.[[Promise]]. 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. 1. Throw a SyntaxError exception. --- 2560
top-level-import-catch-instn-iee-err-ambiguous-import.js --- description: IndirectExportEntries validation - ambiguous imported bindings (top level) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 9. Let starResolution be null. 10. For each ExportEntry Record e in module.[[StarExportEntries]], do a. Let importedModule be ? HostResolveImportedModule(module, e.[[ModuleRequest]]). b. Let resolution be ? importedModule.ResolveExport(exportName, resolveSet, exportStarSet). c. If resolution is "ambiguous", return "ambiguous". d. If resolution is not null, then i. If starResolution is null, let starResolution be resolution. ii. Else, 1. Assert: there is more than one * import that includes the requested name. 2. If resolution.[[Module]] and starResolution.[[Module]] are not the same Module Record or SameValue(resolution.[[BindingName]], starResolution.[[BindingName]]) is false, return "ambiguous". --- 2447
top-level-import-catch-instn-iee-err-circular.js --- description: IndirectExportEntries validation - circular imported bindings (top level) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. [...] 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). b. If resolution is null or resolution is "ambiguous", throw a SyntaxError exception. [...] 15.2.1.16.3 ResolveExport [...] 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: a. If module and r.[[Module]] are the same Module Record and SameValue(exportName, r.[[ExportName]]) is true, then i. Assert: this is a circular import request. ii. Return null. --- 1827
top-level-import-catch-specifier-tostring-abrupt-rejects.js --- description: Abrupt from ToString(specifier) rejects the promise (top level) esid: sec-import-call-runtime-semantics-evaluation features: [dynamic-import] flags: [generated, async] info: | ImportCall : import( AssignmentExpression ) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). 3. Let argRef be the result of evaluating AssignmentExpression. 4. Let specifier be ? GetValue(argRef). 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). 6. Let specifierString be ToString(specifier). 7. IfAbruptRejectPromise(specifierString, promiseCapability). 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 9. Return promiseCapability.[[Promise]]. Import Calls Runtime Semantics: Evaluation ImportCall : import(AssignmentExpression) 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). 2. Let argRef be the result of evaluating AssignmentExpression. 3. Let specifier be ? GetValue(argRef). 4. Let promiseCapability be ! NewPromiseCapability(%Promise%). 5. Let specifierString be ToString(specifier). 6. IfAbruptRejectPromise(specifierString, promiseCapability). 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). 8. Return promiseCapability.[[Promise]]. --- 1864