| 1 |
// |reftest| skip error:SyntaxError -- source-phase-imports,source-phase-imports-module-source is not supported |
| 2 |
// This file was procedurally generated from the following sources: |
| 3 |
// - src/dynamic-import/import-source-no-rest-param.case |
| 4 |
// - src/dynamic-import/syntax/invalid/nested-async-generator-await.template |
| 5 |
/*--- |
| 6 |
description: ImportCall is not extensible - no rest parameter (nested in async generator, awaited) |
| 7 |
esid: sec-import-call-runtime-semantics-evaluation |
| 8 |
features: [source-phase-imports, source-phase-imports-module-source, dynamic-import, async-iteration] |
| 9 |
flags: [generated] |
| 10 |
negative: |
| 11 |
phase: parse |
| 12 |
type: SyntaxError |
| 13 |
info: | |
| 14 |
ImportCall : |
| 15 |
import( AssignmentExpression ) |
| 16 |
|
| 17 |
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). |
| 18 |
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). |
| 19 |
3. Let argRef be the result of evaluating AssignmentExpression. |
| 20 |
4. Let specifier be ? GetValue(argRef). |
| 21 |
5. Let promiseCapability be ! NewPromiseCapability(%Promise%). |
| 22 |
6. Let specifierString be ToString(specifier). |
| 23 |
7. IfAbruptRejectPromise(specifierString, promiseCapability). |
| 24 |
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). |
| 25 |
9. Return promiseCapability.[[Promise]]. |
| 26 |
|
| 27 |
|
| 28 |
ImportCall : |
| 29 |
import . source ( AssignmentExpression[+In, ?Yield] ) |
| 30 |
|
| 31 |
Forbidden Extensions |
| 32 |
|
| 33 |
- ImportCall must not be extended. |
| 34 |
|
| 35 |
This production doesn't allow the following production from ArgumentsList: |
| 36 |
|
| 37 |
... AssignmentExpression |
| 38 |
|
| 39 |
---*/ |
| 40 |
|
| 41 |
$DONOTEVALUATE(); |
| 42 |
|
| 43 |
async function * f() { |
| 44 |
await import.source(...['<module source>']) |
| 45 |
} |