mirror of
https://github.com/tc39/test262.git
synced 2025-07-28 16:34:27 +02:00
Generate tests
This commit is contained in:
parent
f8fda5b6d2
commit
070198fbad
@ -0,0 +1,42 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-target.case
|
||||||
|
// - src/dynamic-import/catch/nested-arrow.template
|
||||||
|
/*---
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
let f = () => {
|
||||||
|
import('./script-code_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
};
|
||||||
|
|
||||||
|
f();
|
@ -0,0 +1,55 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
|
||||||
|
// - src/dynamic-import/catch/nested-arrow.template
|
||||||
|
/*---
|
||||||
|
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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
throw 'custom error';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
let f = () => {
|
||||||
|
import(obj).catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error, 'custom error');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
};
|
||||||
|
|
||||||
|
f();
|
@ -0,0 +1,42 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-target.case
|
||||||
|
// - src/dynamic-import/catch/nested-async-function-await.template
|
||||||
|
/*---
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
async function f() {
|
||||||
|
await import('./script-code_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
f();
|
@ -0,0 +1,55 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
|
||||||
|
// - src/dynamic-import/catch/nested-async-function-await.template
|
||||||
|
/*---
|
||||||
|
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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
throw 'custom error';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
async function f() {
|
||||||
|
await import(obj).catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error, 'custom error');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
f();
|
@ -0,0 +1,43 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-target.case
|
||||||
|
// - src/dynamic-import/catch/nested-async-function.template
|
||||||
|
/*---
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
async function f() {
|
||||||
|
import('./script-code_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
f();
|
||||||
|
|
@ -0,0 +1,42 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-target.case
|
||||||
|
// - src/dynamic-import/catch/nested-async-function-return-await.template
|
||||||
|
/*---
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
async function f() {
|
||||||
|
return await import('./script-code_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
f();
|
@ -0,0 +1,55 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
|
||||||
|
// - src/dynamic-import/catch/nested-async-function-return-await.template
|
||||||
|
/*---
|
||||||
|
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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
throw 'custom error';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
async function f() {
|
||||||
|
return await import(obj).catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error, 'custom error');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
f();
|
@ -0,0 +1,56 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
|
||||||
|
// - src/dynamic-import/catch/nested-async-function.template
|
||||||
|
/*---
|
||||||
|
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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
throw 'custom error';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
async function f() {
|
||||||
|
import(obj).catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error, 'custom error');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
f();
|
||||||
|
|
@ -0,0 +1,40 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-target.case
|
||||||
|
// - src/dynamic-import/catch/nested-block.template
|
||||||
|
/*---
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
{
|
||||||
|
import('./script-code_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
};
|
@ -0,0 +1,53 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
|
||||||
|
// - src/dynamic-import/catch/nested-block.template
|
||||||
|
/*---
|
||||||
|
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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
throw 'custom error';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
import(obj).catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error, 'custom error');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
};
|
@ -0,0 +1,40 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-target.case
|
||||||
|
// - src/dynamic-import/catch/nested-block-labeled.template
|
||||||
|
/*---
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
label: {
|
||||||
|
import('./script-code_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
};
|
@ -0,0 +1,53 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
|
||||||
|
// - src/dynamic-import/catch/nested-block-labeled.template
|
||||||
|
/*---
|
||||||
|
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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
throw 'custom error';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
label: {
|
||||||
|
import(obj).catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error, 'custom error');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
};
|
@ -0,0 +1,40 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-target.case
|
||||||
|
// - src/dynamic-import/catch/nested-do-while.template
|
||||||
|
/*---
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
do {
|
||||||
|
import('./script-code_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
} while (false);
|
@ -0,0 +1,53 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
|
||||||
|
// - src/dynamic-import/catch/nested-do-while.template
|
||||||
|
/*---
|
||||||
|
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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
throw 'custom error';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
do {
|
||||||
|
import(obj).catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error, 'custom error');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
} while (false);
|
@ -0,0 +1,42 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-target.case
|
||||||
|
// - src/dynamic-import/catch/nested-else.template
|
||||||
|
/*---
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (false) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
import('./script-code_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
|
||||||
|
// - src/dynamic-import/catch/nested-else.template
|
||||||
|
/*---
|
||||||
|
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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
throw 'custom error';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
if (false) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
import(obj).catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error, 'custom error');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-target.case
|
||||||
|
// - src/dynamic-import/catch/nested-function.template
|
||||||
|
/*---
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
function f() {
|
||||||
|
import('./script-code_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
f();
|
@ -0,0 +1,54 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
|
||||||
|
// - src/dynamic-import/catch/nested-function.template
|
||||||
|
/*---
|
||||||
|
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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
throw 'custom error';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
function f() {
|
||||||
|
import(obj).catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error, 'custom error');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
f();
|
@ -0,0 +1,40 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-target.case
|
||||||
|
// - src/dynamic-import/catch/nested-if.template
|
||||||
|
/*---
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) {
|
||||||
|
import('./script-code_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
|
||||||
|
// - src/dynamic-import/catch/nested-if.template
|
||||||
|
/*---
|
||||||
|
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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
throw 'custom error';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
if (true) {
|
||||||
|
import(obj).catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error, 'custom error');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-target.case
|
||||||
|
// - src/dynamic-import/catch/nested-while.template
|
||||||
|
/*---
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
let x = 0;
|
||||||
|
while (!x) {
|
||||||
|
x++;
|
||||||
|
import('./script-code_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
};
|
@ -0,0 +1,55 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
|
||||||
|
// - src/dynamic-import/catch/nested-while.template
|
||||||
|
/*---
|
||||||
|
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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
throw 'custom error';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
let x = 0;
|
||||||
|
while (!x) {
|
||||||
|
x++;
|
||||||
|
import(obj).catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error, 'custom error');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
};
|
@ -0,0 +1,38 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-target.case
|
||||||
|
// - src/dynamic-import/catch/top-level.template
|
||||||
|
/*---
|
||||||
|
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.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
import('./script-code_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
@ -0,0 +1,51 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
|
||||||
|
// - src/dynamic-import/catch/top-level.template
|
||||||
|
/*---
|
||||||
|
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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
throw 'custom error';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
import(obj).catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error, 'custom error');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
@ -26,4 +26,4 @@ info: |
|
|||||||
var smoosh; function smoosh() {}
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
let f = () => import('./script-code-valid.js');
|
let f = () => import('./empty_FIXTURE.js');
|
||||||
|
@ -27,5 +27,5 @@ var smoosh; function smoosh() {}
|
|||||||
|
|
||||||
|
|
||||||
let f = () => {
|
let f = () => {
|
||||||
import('./script-code-valid.js');
|
import('./empty_FIXTURE.js');
|
||||||
};
|
};
|
||||||
|
@ -27,5 +27,5 @@ var smoosh; function smoosh() {}
|
|||||||
|
|
||||||
|
|
||||||
async function f() {
|
async function f() {
|
||||||
await import('./script-code-valid.js');
|
await import('./empty_FIXTURE.js');
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,6 @@ var smoosh; function smoosh() {}
|
|||||||
|
|
||||||
|
|
||||||
async function f() {
|
async function f() {
|
||||||
return await import('./script-code-valid.js');
|
return await import('./empty_FIXTURE.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +27,6 @@ var smoosh; function smoosh() {}
|
|||||||
|
|
||||||
|
|
||||||
async function f() {
|
async function f() {
|
||||||
import('./script-code-valid.js');
|
import('./empty_FIXTURE.js');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,5 +27,5 @@ var smoosh; function smoosh() {}
|
|||||||
|
|
||||||
|
|
||||||
label: {
|
label: {
|
||||||
import('./script-code-valid.js');
|
import('./empty_FIXTURE.js');
|
||||||
};
|
};
|
||||||
|
@ -27,5 +27,5 @@ var smoosh; function smoosh() {}
|
|||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
import('./script-code-valid.js');
|
import('./empty_FIXTURE.js');
|
||||||
};
|
};
|
||||||
|
@ -27,5 +27,5 @@ var smoosh; function smoosh() {}
|
|||||||
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
import('./script-code-valid.js');
|
import('./empty_FIXTURE.js');
|
||||||
} while (false);
|
} while (false);
|
||||||
|
@ -28,4 +28,4 @@ var smoosh; function smoosh() {}
|
|||||||
|
|
||||||
if (false) {
|
if (false) {
|
||||||
|
|
||||||
} else import('./script-code-valid.js');
|
} else import('./empty_FIXTURE.js');
|
||||||
|
@ -29,5 +29,5 @@ var smoosh; function smoosh() {}
|
|||||||
if (false) {
|
if (false) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
import('./script-code-valid.js');
|
import('./empty_FIXTURE.js');
|
||||||
}
|
}
|
||||||
|
@ -27,5 +27,5 @@ var smoosh; function smoosh() {}
|
|||||||
|
|
||||||
|
|
||||||
function fn() {
|
function fn() {
|
||||||
return import('./script-code-valid.js');
|
return import('./empty_FIXTURE.js');
|
||||||
}
|
}
|
||||||
|
@ -27,5 +27,5 @@ var smoosh; function smoosh() {}
|
|||||||
|
|
||||||
|
|
||||||
function fn() {
|
function fn() {
|
||||||
import('./script-code-valid.js');
|
import('./empty_FIXTURE.js');
|
||||||
}
|
}
|
||||||
|
@ -26,4 +26,4 @@ info: |
|
|||||||
var smoosh; function smoosh() {}
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
if (true) import('./script-code-valid.js');
|
if (true) import('./empty_FIXTURE.js');
|
||||||
|
@ -27,5 +27,5 @@ var smoosh; function smoosh() {}
|
|||||||
|
|
||||||
|
|
||||||
if (true) {
|
if (true) {
|
||||||
import('./script-code-valid.js');
|
import('./empty_FIXTURE.js');
|
||||||
}
|
}
|
||||||
|
@ -29,5 +29,5 @@ var smoosh; function smoosh() {}
|
|||||||
let x = 0;
|
let x = 0;
|
||||||
while (!x) {
|
while (!x) {
|
||||||
x++;
|
x++;
|
||||||
import('./script-code-valid.js');
|
import('./empty_FIXTURE.js');
|
||||||
};
|
};
|
||||||
|
@ -27,5 +27,5 @@ var smoosh; function smoosh() {}
|
|||||||
|
|
||||||
|
|
||||||
with ({}) {
|
with ({}) {
|
||||||
import('./script-code-valid.js');
|
import('./empty_FIXTURE.js');
|
||||||
}
|
}
|
||||||
|
@ -16,4 +16,4 @@ info: |
|
|||||||
var smoosh; function smoosh() {}
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
import('./script-code-valid.js');
|
import('./empty_FIXTURE.js');
|
||||||
|
@ -0,0 +1,38 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
|
||||||
|
// - src/dynamic-import/default/nested-arrow-assign-expr.template
|
||||||
|
/*---
|
||||||
|
description: import() from a ascript code can load a file with module code (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
// This is still valid in script code, and should not be valid for module code
|
||||||
|
// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
|
||||||
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
|
let f = () => import('./module-code_FIXTURE.js').then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
f().then($DONE, $DONE).catch($DONE);
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/dynamic-import/returns-promise.case
|
// - src/dynamic-import/returns-thenable.case
|
||||||
// - src/dynamic-import/default/nested-arrow-assign-expr.template
|
// - src/dynamic-import/default/nested-arrow-assign-expr.template
|
||||||
/*---
|
/*---
|
||||||
description: Dynamic import() returns a Promise object. (nested arrow)
|
description: Dynamic import() returns a thenable object. (nested arrow)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, async]
|
flags: [generated, async]
|
@ -0,0 +1,56 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring.case
|
||||||
|
// - src/dynamic-import/default/nested-arrow-assign-expr.template
|
||||||
|
/*---
|
||||||
|
description: ToString value of specifier (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
return './module-code_FIXTURE.js';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
let f = () => import(obj).then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
f().then($DONE, $DONE).catch($DONE);
|
@ -0,0 +1,40 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
|
||||||
|
// - src/dynamic-import/default/nested-arrow.template
|
||||||
|
/*---
|
||||||
|
description: import() from a ascript code can load a file with module code (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
// This is still valid in script code, and should not be valid for module code
|
||||||
|
// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
|
||||||
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
|
let f = () => {
|
||||||
|
return import('./module-code_FIXTURE.js').then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
};
|
||||||
|
|
||||||
|
f();
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/dynamic-import/returns-promise.case
|
// - src/dynamic-import/returns-thenable.case
|
||||||
// - src/dynamic-import/default/nested-arrow.template
|
// - src/dynamic-import/default/nested-arrow.template
|
||||||
/*---
|
/*---
|
||||||
description: Dynamic import() returns a Promise object. (nested arrow)
|
description: Dynamic import() returns a thenable object. (nested arrow)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, async]
|
flags: [generated, async]
|
@ -0,0 +1,58 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring.case
|
||||||
|
// - src/dynamic-import/default/nested-arrow.template
|
||||||
|
/*---
|
||||||
|
description: ToString value of specifier (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
return './module-code_FIXTURE.js';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
let f = () => {
|
||||||
|
return import(obj).then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
};
|
||||||
|
|
||||||
|
f();
|
||||||
|
|
@ -0,0 +1,39 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
|
||||||
|
// - src/dynamic-import/default/nested-async-function-await.template
|
||||||
|
/*---
|
||||||
|
description: import() from a ascript code can load a file with module code (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
// This is still valid in script code, and should not be valid for module code
|
||||||
|
// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
|
||||||
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
|
async function f() {
|
||||||
|
await import('./module-code_FIXTURE.js').then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
f().then($DONE, $DONE).catch($DONE);
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/dynamic-import/returns-promise.case
|
// - src/dynamic-import/returns-thenable.case
|
||||||
// - src/dynamic-import/default/nested-async-function-await.template
|
// - src/dynamic-import/default/nested-async-function-await.template
|
||||||
/*---
|
/*---
|
||||||
description: Dynamic import() returns a Promise object. (nested in async function, awaited)
|
description: Dynamic import() returns a thenable object. (nested in async function, awaited)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, async]
|
flags: [generated, async]
|
@ -0,0 +1,57 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring.case
|
||||||
|
// - src/dynamic-import/default/nested-async-function-await.template
|
||||||
|
/*---
|
||||||
|
description: ToString value of specifier (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
return './module-code_FIXTURE.js';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
async function f() {
|
||||||
|
await import(obj).then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
f().then($DONE, $DONE).catch($DONE);
|
@ -0,0 +1,39 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
|
||||||
|
// - src/dynamic-import/default/nested-async-function.template
|
||||||
|
/*---
|
||||||
|
description: import() from a ascript code can load a file with module code (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
// This is still valid in script code, and should not be valid for module code
|
||||||
|
// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
|
||||||
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
|
async function f() {
|
||||||
|
import('./module-code_FIXTURE.js').then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
f();
|
@ -0,0 +1,39 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
|
||||||
|
// - src/dynamic-import/default/nested-async-function-return-await.template
|
||||||
|
/*---
|
||||||
|
description: import() from a ascript code can load a file with module code (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
// This is still valid in script code, and should not be valid for module code
|
||||||
|
// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
|
||||||
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
|
async function f() {
|
||||||
|
return await import('./module-code_FIXTURE.js');
|
||||||
|
}
|
||||||
|
|
||||||
|
f().then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/dynamic-import/returns-promise.case
|
// - src/dynamic-import/returns-thenable.case
|
||||||
// - src/dynamic-import/default/nested-async-function-return-await.template
|
// - src/dynamic-import/default/nested-async-function-return-await.template
|
||||||
/*---
|
/*---
|
||||||
description: Dynamic import() returns a Promise object. (nested in async function, returns awaited)
|
description: Dynamic import() returns a thenable object. (nested in async function, returns awaited)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, async]
|
flags: [generated, async]
|
@ -0,0 +1,57 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring.case
|
||||||
|
// - src/dynamic-import/default/nested-async-function-return-await.template
|
||||||
|
/*---
|
||||||
|
description: ToString value of specifier (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
return './module-code_FIXTURE.js';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
async function f() {
|
||||||
|
return await import(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
f().then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/dynamic-import/returns-promise.case
|
// - src/dynamic-import/returns-thenable.case
|
||||||
// - src/dynamic-import/default/nested-async-function.template
|
// - src/dynamic-import/default/nested-async-function.template
|
||||||
/*---
|
/*---
|
||||||
description: Dynamic import() returns a Promise object. (nested in async function)
|
description: Dynamic import() returns a thenable object. (nested in async function)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, async]
|
flags: [generated, async]
|
@ -0,0 +1,57 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring.case
|
||||||
|
// - src/dynamic-import/default/nested-async-function.template
|
||||||
|
/*---
|
||||||
|
description: ToString value of specifier (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
return './module-code_FIXTURE.js';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
async function f() {
|
||||||
|
import(obj).then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
f();
|
@ -0,0 +1,37 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
|
||||||
|
// - src/dynamic-import/default/nested-block.template
|
||||||
|
/*---
|
||||||
|
description: import() from a ascript code can load a file with module code (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
// This is still valid in script code, and should not be valid for module code
|
||||||
|
// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
|
||||||
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
import('./module-code_FIXTURE.js').then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
};
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/dynamic-import/returns-promise.case
|
// - src/dynamic-import/returns-thenable.case
|
||||||
// - src/dynamic-import/default/nested-block.template
|
// - src/dynamic-import/default/nested-block.template
|
||||||
/*---
|
/*---
|
||||||
description: Dynamic import() returns a Promise object. (nested block)
|
description: Dynamic import() returns a thenable object. (nested block)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, async]
|
flags: [generated, async]
|
@ -0,0 +1,55 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring.case
|
||||||
|
// - src/dynamic-import/default/nested-block.template
|
||||||
|
/*---
|
||||||
|
description: ToString value of specifier (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
return './module-code_FIXTURE.js';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
import(obj).then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
};
|
@ -0,0 +1,37 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
|
||||||
|
// - src/dynamic-import/default/nested-do-while.template
|
||||||
|
/*---
|
||||||
|
description: import() from a ascript code can load a file with module code (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
// This is still valid in script code, and should not be valid for module code
|
||||||
|
// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
|
||||||
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
|
do {
|
||||||
|
import('./module-code_FIXTURE.js').then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
} while (false);
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/dynamic-import/returns-promise.case
|
// - src/dynamic-import/returns-thenable.case
|
||||||
// - src/dynamic-import/default/nested-do-while.template
|
// - src/dynamic-import/default/nested-do-while.template
|
||||||
/*---
|
/*---
|
||||||
description: Dynamic import() returns a Promise object. (nested do while syntax)
|
description: Dynamic import() returns a thenable object. (nested do while syntax)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, async]
|
flags: [generated, async]
|
@ -0,0 +1,55 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring.case
|
||||||
|
// - src/dynamic-import/default/nested-do-while.template
|
||||||
|
/*---
|
||||||
|
description: ToString value of specifier (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
return './module-code_FIXTURE.js';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
do {
|
||||||
|
import(obj).then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
} while (false);
|
@ -0,0 +1,39 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
|
||||||
|
// - src/dynamic-import/default/nested-else.template
|
||||||
|
/*---
|
||||||
|
description: import() from a ascript code can load a file with module code (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
// This is still valid in script code, and should not be valid for module code
|
||||||
|
// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
|
||||||
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
|
if (false) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
import('./module-code_FIXTURE.js').then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
}
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/dynamic-import/returns-promise.case
|
// - src/dynamic-import/returns-thenable.case
|
||||||
// - src/dynamic-import/default/nested-else.template
|
// - src/dynamic-import/default/nested-else.template
|
||||||
/*---
|
/*---
|
||||||
description: Dynamic import() returns a Promise object. (nested else)
|
description: Dynamic import() returns a thenable object. (nested else)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, async]
|
flags: [generated, async]
|
@ -0,0 +1,57 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring.case
|
||||||
|
// - src/dynamic-import/default/nested-else.template
|
||||||
|
/*---
|
||||||
|
description: ToString value of specifier (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
return './module-code_FIXTURE.js';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
if (false) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
import(obj).then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
|
||||||
|
// - src/dynamic-import/default/nested-function.template
|
||||||
|
/*---
|
||||||
|
description: import() from a ascript code can load a file with module code (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
// This is still valid in script code, and should not be valid for module code
|
||||||
|
// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
|
||||||
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
|
function f() {
|
||||||
|
import('./module-code_FIXTURE.js').then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
}
|
||||||
|
f();
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/dynamic-import/returns-promise.case
|
// - src/dynamic-import/returns-thenable.case
|
||||||
// - src/dynamic-import/default/nested-function.template
|
// - src/dynamic-import/default/nested-function.template
|
||||||
/*---
|
/*---
|
||||||
description: Dynamic import() returns a Promise object. (nested function)
|
description: Dynamic import() returns a thenable object. (nested function)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, async]
|
flags: [generated, async]
|
@ -0,0 +1,56 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring.case
|
||||||
|
// - src/dynamic-import/default/nested-function.template
|
||||||
|
/*---
|
||||||
|
description: ToString value of specifier (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
return './module-code_FIXTURE.js';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
function f() {
|
||||||
|
import(obj).then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
}
|
||||||
|
f();
|
@ -0,0 +1,35 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
|
||||||
|
// - src/dynamic-import/default/nested-if-braceless.template
|
||||||
|
/*---
|
||||||
|
description: import() from a ascript code can load a file with module code (nested if 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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
// This is still valid in script code, and should not be valid for module code
|
||||||
|
// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
|
||||||
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
|
if (true) import('./module-code_FIXTURE.js').then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/dynamic-import/returns-promise.case
|
// - src/dynamic-import/returns-thenable.case
|
||||||
// - src/dynamic-import/default/nested-if-braceless.template
|
// - src/dynamic-import/default/nested-if-braceless.template
|
||||||
/*---
|
/*---
|
||||||
description: Dynamic import() returns a Promise object. (nested if syntax)
|
description: Dynamic import() returns a thenable object. (nested if syntax)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, async]
|
flags: [generated, async]
|
@ -0,0 +1,53 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring.case
|
||||||
|
// - src/dynamic-import/default/nested-if-braceless.template
|
||||||
|
/*---
|
||||||
|
description: ToString value of specifier (nested if 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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
return './module-code_FIXTURE.js';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
if (true) import(obj).then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
@ -0,0 +1,37 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
|
||||||
|
// - src/dynamic-import/default/nested-if.template
|
||||||
|
/*---
|
||||||
|
description: import() from a ascript code can load a file with module code (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
// This is still valid in script code, and should not be valid for module code
|
||||||
|
// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
|
||||||
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
|
if (true) {
|
||||||
|
import('./module-code_FIXTURE.js').then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
}
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/dynamic-import/returns-promise.case
|
// - src/dynamic-import/returns-thenable.case
|
||||||
// - src/dynamic-import/default/nested-if.template
|
// - src/dynamic-import/default/nested-if.template
|
||||||
/*---
|
/*---
|
||||||
description: Dynamic import() returns a Promise object. (nested if)
|
description: Dynamic import() returns a thenable object. (nested if)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, async]
|
flags: [generated, async]
|
@ -0,0 +1,55 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring.case
|
||||||
|
// - src/dynamic-import/default/nested-if.template
|
||||||
|
/*---
|
||||||
|
description: ToString value of specifier (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
return './module-code_FIXTURE.js';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
if (true) {
|
||||||
|
import(obj).then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
|
||||||
|
// - src/dynamic-import/default/nested-while.template
|
||||||
|
/*---
|
||||||
|
description: import() from a ascript code can load a file with module code (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
// This is still valid in script code, and should not be valid for module code
|
||||||
|
// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
|
||||||
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
|
let x = 0;
|
||||||
|
while (!x) {
|
||||||
|
x++;
|
||||||
|
import('./module-code_FIXTURE.js').then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
};
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/dynamic-import/returns-promise.case
|
// - src/dynamic-import/returns-thenable.case
|
||||||
// - src/dynamic-import/default/nested-while.template
|
// - src/dynamic-import/default/nested-while.template
|
||||||
/*---
|
/*---
|
||||||
description: Dynamic import() returns a Promise object. (nested while)
|
description: Dynamic import() returns a thenable object. (nested while)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, async]
|
flags: [generated, async]
|
@ -0,0 +1,57 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring.case
|
||||||
|
// - src/dynamic-import/default/nested-while.template
|
||||||
|
/*---
|
||||||
|
description: ToString value of specifier (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
return './module-code_FIXTURE.js';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
let x = 0;
|
||||||
|
while (!x) {
|
||||||
|
x++;
|
||||||
|
import(obj).then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
};
|
@ -1,44 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
|
|
||||||
// - src/dynamic-import/default/nested-with.template
|
|
||||||
/*---
|
|
||||||
description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested with)
|
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
|
||||||
features: [dynamic-import]
|
|
||||||
flags: [generated, async, noStrict]
|
|
||||||
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]].
|
|
||||||
|
|
||||||
|
|
||||||
GetBindingValue (N, S)
|
|
||||||
|
|
||||||
[...]
|
|
||||||
3. If the binding for N is an indirect binding, then
|
|
||||||
a. Let M and N2 be the indirection values provided when this binding for
|
|
||||||
N was created.
|
|
||||||
b. Let targetEnv be M.[[Environment]].
|
|
||||||
c. If targetEnv is undefined, throw a ReferenceError exception.
|
|
||||||
d. Let targetER be targetEnv's EnvironmentRecord.
|
|
||||||
e. Return ? targetER.GetBindingValue(N2, S).
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
with ({}) {
|
|
||||||
import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
|
|
||||||
|
|
||||||
assert.sameValue(imported.default(), 1);
|
|
||||||
assert.sameValue(imported.default, 2);
|
|
||||||
|
|
||||||
}).then($DONE, $DONE).catch($DONE);
|
|
||||||
}
|
|
@ -1,52 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/dynamic-import/eval-gtbndng-indirect-update.case
|
|
||||||
// - src/dynamic-import/default/nested-with.template
|
|
||||||
/*---
|
|
||||||
description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested with)
|
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
|
||||||
features: [dynamic-import]
|
|
||||||
flags: [generated, async, noStrict]
|
|
||||||
includes: [fnGlobalObject.js]
|
|
||||||
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]].
|
|
||||||
|
|
||||||
|
|
||||||
GetBindingValue (N, S)
|
|
||||||
|
|
||||||
[...]
|
|
||||||
3. If the binding for N is an indirect binding, then
|
|
||||||
a. Let M and N2 be the indirection values provided when this binding for
|
|
||||||
N was created.
|
|
||||||
b. Let targetEnv be M.[[Environment]].
|
|
||||||
c. If targetEnv is undefined, throw a ReferenceError exception.
|
|
||||||
d. Let targetER be targetEnv's EnvironmentRecord.
|
|
||||||
e. Return ? targetER.GetBindingValue(N2, S).
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
with ({}) {
|
|
||||||
import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
|
|
||||||
|
|
||||||
assert.sameValue(imported.x, 1);
|
|
||||||
|
|
||||||
// This function is exposed on the global scope (instead of as an exported
|
|
||||||
// binding) in order to avoid possible false positives from assuming correct
|
|
||||||
// behavior of the semantics under test.
|
|
||||||
fnGlobalObject().test262update();
|
|
||||||
|
|
||||||
assert.sameValue(imported.x, 2);
|
|
||||||
|
|
||||||
|
|
||||||
}).then($DONE, $DONE).catch($DONE);
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/dynamic-import/is-call-expression-square-brackets.case
|
|
||||||
// - src/dynamic-import/default/nested-with.template
|
|
||||||
/*---
|
|
||||||
description: ImportCall is a CallExpression, it can be followed by square brackets (nested with)
|
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
|
||||||
features: [dynamic-import]
|
|
||||||
flags: [generated, async, noStrict]
|
|
||||||
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]].
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
with ({}) {
|
|
||||||
import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
|
|
||||||
|
|
||||||
assert.sameValue(imported.x, 1);
|
|
||||||
|
|
||||||
}).then($DONE, $DONE).catch($DONE);
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
|
||||||
// - src/dynamic-import/returns-promise.case
|
|
||||||
// - src/dynamic-import/default/nested-with.template
|
|
||||||
/*---
|
|
||||||
description: Dynamic import() returns a Promise object. (nested with)
|
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
|
||||||
features: [dynamic-import]
|
|
||||||
flags: [generated, async, noStrict]
|
|
||||||
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]].
|
|
||||||
|
|
||||||
---*/
|
|
||||||
|
|
||||||
with ({}) {
|
|
||||||
import('./dynamic-import-module_FIXTURE.js').then(imported => {
|
|
||||||
|
|
||||||
assert.sameValue(imported.x, 1);
|
|
||||||
|
|
||||||
}).then($DONE, $DONE).catch($DONE);
|
|
||||||
}
|
|
@ -0,0 +1,37 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
|
||||||
|
// - src/dynamic-import/default/nested-block-labeled.template
|
||||||
|
/*---
|
||||||
|
description: import() from a ascript code can load a file with module code (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
// This is still valid in script code, and should not be valid for module code
|
||||||
|
// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
|
||||||
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
|
label: {
|
||||||
|
import('./module-code_FIXTURE.js').then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
};
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/dynamic-import/returns-promise.case
|
// - src/dynamic-import/returns-thenable.case
|
||||||
// - src/dynamic-import/default/nested-block-labeled.template
|
// - src/dynamic-import/default/nested-block-labeled.template
|
||||||
/*---
|
/*---
|
||||||
description: Dynamic import() returns a Promise object. (nested block syntax)
|
description: Dynamic import() returns a thenable object. (nested block syntax)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, async]
|
flags: [generated, async]
|
@ -0,0 +1,55 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring.case
|
||||||
|
// - src/dynamic-import/default/nested-block-labeled.template
|
||||||
|
/*---
|
||||||
|
description: ToString value of specifier (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
return './module-code_FIXTURE.js';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
label: {
|
||||||
|
import(obj).then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
};
|
@ -0,0 +1,35 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
|
||||||
|
// - src/dynamic-import/default/top-level.template
|
||||||
|
/*---
|
||||||
|
description: import() from a ascript code can load a file with module code (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
// This is still valid in script code, and should not be valid for module code
|
||||||
|
// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
|
||||||
|
var smoosh; function smoosh() {}
|
||||||
|
|
||||||
|
|
||||||
|
import('./module-code_FIXTURE.js').then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
@ -1,8 +1,8 @@
|
|||||||
// This file was procedurally generated from the following sources:
|
// This file was procedurally generated from the following sources:
|
||||||
// - src/dynamic-import/returns-promise.case
|
// - src/dynamic-import/returns-thenable.case
|
||||||
// - src/dynamic-import/default/top-level.template
|
// - src/dynamic-import/default/top-level.template
|
||||||
/*---
|
/*---
|
||||||
description: Dynamic import() returns a Promise object. (top level)
|
description: Dynamic import() returns a thenable object. (top level)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, async]
|
flags: [generated, async]
|
@ -0,0 +1,53 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/specifier-tostring.case
|
||||||
|
// - src/dynamic-import/default/top-level.template
|
||||||
|
/*---
|
||||||
|
description: ToString value of specifier (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]].
|
||||||
|
|
||||||
|
---*/
|
||||||
|
const obj = {
|
||||||
|
toString() {
|
||||||
|
return './module-code_FIXTURE.js';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
import(obj).then(imported => {
|
||||||
|
|
||||||
|
assert.sameValue(imported.default, 42);
|
||||||
|
assert.sameValue(imported.x, 'Test262');
|
||||||
|
assert.sameValue(imported.z, 42);
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
Loading…
x
Reference in New Issue
Block a user