| 1 |
// |reftest| async |
| 2 |
// This file was procedurally generated from the following sources: |
| 3 |
// - src/dynamic-import/instn-iee-err-ambiguous-import.case |
| 4 |
// - src/dynamic-import/catch/nested-block-labeled.template |
| 5 |
/*--- |
| 6 |
description: IndirectExportEntries validation - ambiguous imported bindings (nested block syntax) |
| 7 |
esid: sec-import-call-runtime-semantics-evaluation |
| 8 |
features: [dynamic-import] |
| 9 |
flags: [generated, async] |
| 10 |
info: | |
| 11 |
ImportCall : |
| 12 |
import( AssignmentExpression ) |
| 13 |
|
| 14 |
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). |
| 15 |
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). |
| 16 |
3. Let argRef be the result of evaluating AssignmentExpression. |
| 17 |
4. Let specifier be ? GetValue(argRef). |
| 18 |
5. Let promiseCapability be ! NewPromiseCapability(%Promise%). |
| 19 |
6. Let specifierString be ToString(specifier). |
| 20 |
7. IfAbruptRejectPromise(specifierString, promiseCapability). |
| 21 |
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). |
| 22 |
9. Return promiseCapability.[[Promise]]. |
| 23 |
|
| 24 |
|
| 25 |
[...] |
| 26 |
9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do |
| 27 |
a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). |
| 28 |
b. If resolution is null or resolution is "ambiguous", throw a |
| 29 |
SyntaxError exception. |
| 30 |
[...] |
| 31 |
|
| 32 |
15.2.1.16.3 ResolveExport |
| 33 |
|
| 34 |
[...] |
| 35 |
9. Let starResolution be null. |
| 36 |
10. For each ExportEntry Record e in module.[[StarExportEntries]], do |
| 37 |
a. Let importedModule be ? HostResolveImportedModule(module, |
| 38 |
e.[[ModuleRequest]]). |
| 39 |
b. Let resolution be ? importedModule.ResolveExport(exportName, |
| 40 |
resolveSet, exportStarSet). |
| 41 |
c. If resolution is "ambiguous", return "ambiguous". |
| 42 |
d. If resolution is not null, then |
| 43 |
i. If starResolution is null, let starResolution be resolution. |
| 44 |
ii. Else, |
| 45 |
1. Assert: there is more than one * import that includes the |
| 46 |
requested name. |
| 47 |
2. If resolution.[[Module]] and starResolution.[[Module]] are |
| 48 |
not the same Module Record or |
| 49 |
SameValue(resolution.[[BindingName]], |
| 50 |
starResolution.[[BindingName]]) is false, return "ambiguous". |
| 51 |
|
| 52 |
---*/ |
| 53 |
|
| 54 |
label: { |
| 55 |
import('./instn-iee-err-ambiguous-export_FIXTURE.js').catch(error => { |
| 56 |
|
| 57 |
assert.sameValue(error.name, 'SyntaxError'); |
| 58 |
|
| 59 |
}).then($DONE, $DONE); |
| 60 |
}; |