Debian Codegraph @

js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-instn-iee-err-circular.js

raw
1 // |reftest| async
2 // This file was procedurally generated from the following sources:
3 // - src/dynamic-import/instn-iee-err-circular.case
4 // - src/dynamic-import/catch/nested-async-arrow-fn-await.template
5 /*---
6 description: IndirectExportEntries validation - circular imported bindings (nested in async arrow function, awaited)
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 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
36 a. If module and r.[[Module]] are the same Module Record and
37 SameValue(exportName, r.[[ExportName]]) is true, then
38 i. Assert: this is a circular import request.
39 ii. Return null.
40
41 ---*/
42
43 const f = async () => {
44 await import('./instn-iee-err-circular-1_FIXTURE.js');
45 }
46
47 f().catch(error => {
48
49 assert.sameValue(error.name, 'SyntaxError');
50
51 }).then($DONE, $DONE);