mirror of
https://github.com/tc39/test262.git
synced 2025-07-27 07:54:41 +02:00
Merge pull request #1832 from leobalter/dyn-import-part2
More test cases for dynamic import
This commit is contained in:
commit
eb4401ee44
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
let f = () => {
|
let f = () => {
|
||||||
import(/*{ params }*/).catch(error => {
|
/*{ import }*/.catch(error => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
async function f() {
|
async function f() {
|
||||||
await import(/*{ params }*/).catch(error => {
|
await /*{ import }*/.catch(error => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
async function f() {
|
async function f() {
|
||||||
return await import(/*{ params }*/).catch(error => {
|
return await /*{ import }*/.catch(error => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
async function f() {
|
async function f() {
|
||||||
import(/*{ params }*/).catch(error => {
|
/*{ import }*/.catch(error => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
label: {
|
label: {
|
||||||
import(/*{ params }*/).catch(error => {
|
/*{ import }*/.catch(error => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
{
|
{
|
||||||
import(/*{ params }*/).catch(error => {
|
/*{ import }*/.catch(error => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
do {
|
do {
|
||||||
import(/*{ params }*/).catch(error => {
|
/*{ import }*/.catch(error => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ flags: [async]
|
|||||||
if (false) {
|
if (false) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
import(/*{ params }*/).catch(error => {
|
/*{ import }*/.catch(error => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function f() {
|
function f() {
|
||||||
import(/*{ params }*/).catch(error => {
|
/*{ import }*/.catch(error => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
if (true) {
|
if (true) {
|
||||||
import(/*{ params }*/).catch(error => {
|
/*{ import }*/.catch(error => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ flags: [async]
|
|||||||
let x = 0;
|
let x = 0;
|
||||||
while (!x) {
|
while (!x) {
|
||||||
x++;
|
x++;
|
||||||
import(/*{ params }*/).catch(error => {
|
/*{ import }*/.catch(error => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
31
src/dynamic-import/catch/nested-with.template
Normal file
31
src/dynamic-import/catch/nested-with.template
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
path: language/module-code/dynamic-import/catch/nested-with-import-catch-
|
||||||
|
name: nested with
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
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]].
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [async, noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
with ({}) {
|
||||||
|
/*{ import }*/.catch(error => {
|
||||||
|
|
||||||
|
/*{ body }*/
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
|
@ -24,7 +24,7 @@ features: [dynamic-import]
|
|||||||
flags: [async]
|
flags: [async]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
import(/*{ params }*/).catch(error => {
|
/*{ import }*/.catch(error => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ features: [dynamic-import]
|
|||||||
flags: [async]
|
flags: [async]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
let f = () => import(/*{ params }*/).then(imported => {
|
let f = () => /*{ import }*/.then(imported => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
let f = () => {
|
let f = () => {
|
||||||
return import(/*{ params }*/).then(imported => {
|
return /*{ import }*/.then(imported => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
async function f() {
|
async function f() {
|
||||||
await import(/*{ params }*/).then(imported => {
|
await /*{ import }*/.then(imported => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
async function f() {
|
async function f() {
|
||||||
return await import(/*{ params }*/);
|
return await /*{ import }*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
f().then(imported => {
|
f().then(imported => {
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
async function f() {
|
async function f() {
|
||||||
import(/*{ params }*/).then(imported => {
|
/*{ import }*/.then(imported => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
label: {
|
label: {
|
||||||
import(/*{ params }*/).then(imported => {
|
/*{ import }*/.then(imported => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
{
|
{
|
||||||
import(/*{ params }*/).then(imported => {
|
/*{ import }*/.then(imported => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
do {
|
do {
|
||||||
import(/*{ params }*/).then(imported => {
|
/*{ import }*/.then(imported => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ flags: [async]
|
|||||||
if (false) {
|
if (false) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
import(/*{ params }*/).then(imported => {
|
/*{ import }*/.then(imported => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
function f() {
|
function f() {
|
||||||
import(/*{ params }*/).then(imported => {
|
/*{ import }*/.then(imported => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ features: [dynamic-import]
|
|||||||
flags: [async]
|
flags: [async]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
if (true) import(/*{ params }*/).then(imported => {
|
if (true) /*{ import }*/.then(imported => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
if (true) {
|
if (true) {
|
||||||
import(/*{ params }*/).then(imported => {
|
/*{ import }*/.then(imported => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ flags: [async]
|
|||||||
let x = 0;
|
let x = 0;
|
||||||
while (!x) {
|
while (!x) {
|
||||||
x++;
|
x++;
|
||||||
import(/*{ params }*/).then(imported => {
|
/*{ import }*/.then(imported => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
30
src/dynamic-import/default/nested-with.template
Normal file
30
src/dynamic-import/default/nested-with.template
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
path: language/module-code/dynamic-import/usage/nested-with-import-then-
|
||||||
|
name: nested with
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
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]].
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [async, noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
with ({}) {
|
||||||
|
/*{ import }*/.then(imported => {
|
||||||
|
|
||||||
|
/*{ body }*/
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
}
|
@ -24,7 +24,7 @@ features: [dynamic-import]
|
|||||||
flags: [async]
|
flags: [async]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
import(/*{ params }*/).then(imported => {
|
/*{ import }*/.then(imported => {
|
||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
|
@ -20,8 +20,8 @@ info: |
|
|||||||
template: default
|
template: default
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- params
|
//- import
|
||||||
'./eval-gtbndng-indirect-update-dflt_FIXTURE.js'
|
import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js')
|
||||||
//- body
|
//- body
|
||||||
assert.sameValue(imported.default(), 1);
|
assert.sameValue(imported.default(), 1);
|
||||||
assert.sameValue(imported.default, 2);
|
assert.sameValue(imported.default, 2);
|
||||||
|
@ -21,8 +21,8 @@ includes: [fnGlobalObject.js]
|
|||||||
template: default
|
template: default
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- params
|
//- import
|
||||||
'./eval-gtbndng-indirect-update_FIXTURE.js'
|
import('./eval-gtbndng-indirect-update_FIXTURE.js')
|
||||||
//- body
|
//- body
|
||||||
assert.sameValue(imported.x, 1);
|
assert.sameValue(imported.x, 1);
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ info: |
|
|||||||
template: catch
|
template: catch
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- params
|
//- import
|
||||||
'./eval-rqstd-abrupt-err-type_FIXTURE.js'
|
import('./eval-rqstd-abrupt-err-type_FIXTURE.js')
|
||||||
//- body
|
//- body
|
||||||
assert.sameValue(error.name, 'TypeError');
|
assert.sameValue(error.name, 'TypeError');
|
||||||
|
@ -14,7 +14,7 @@ info: |
|
|||||||
template: catch
|
template: catch
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- params
|
//- import
|
||||||
'./eval-rqstd-abrupt-err-uri_FIXTURE.js'
|
import('./eval-rqstd-abrupt-err-uri_FIXTURE.js')
|
||||||
//- body
|
//- body
|
||||||
assert.sameValue(error.name, 'URIError');
|
assert.sameValue(error.name, 'URIError');
|
||||||
|
16
src/dynamic-import/file-does-not-exist.case
Normal file
16
src/dynamic-import/file-does-not-exist.case
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
desc: >
|
||||||
|
Non existent file can't resolve to a Script or Module Record
|
||||||
|
esid: sec-hostresolveimportedmodule
|
||||||
|
info: |
|
||||||
|
If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
|
||||||
|
specifier does not exist or cannot be created, an exception must be thrown.
|
||||||
|
template: catch
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- import
|
||||||
|
import('./THIS_FILE_DOES_NOT_EXIST.js')
|
||||||
|
//- body
|
||||||
|
assert.notSameValue(typeof error, 'undefined');
|
@ -34,7 +34,7 @@ info: |
|
|||||||
template: catch
|
template: catch
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- params
|
//- import
|
||||||
'./instn-iee-err-ambiguous-export_FIXTURE.js'
|
import('./instn-iee-err-ambiguous-export_FIXTURE.js')
|
||||||
//- body
|
//- body
|
||||||
assert.sameValue(error.name, 'SyntaxError');
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
@ -23,7 +23,7 @@ info: |
|
|||||||
template: catch
|
template: catch
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- params
|
//- import
|
||||||
'./instn-iee-err-circular-1_FIXTURE.js'
|
import('./instn-iee-err-circular-1_FIXTURE.js')
|
||||||
//- body
|
//- body
|
||||||
assert.sameValue(error.name, 'SyntaxError');
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
11
src/dynamic-import/is-call-expression-square-brackets.case
Normal file
11
src/dynamic-import/is-call-expression-square-brackets.case
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
desc: ImportCall is a CallExpression, it can be followed by square brackets
|
||||||
|
template: default
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- import
|
||||||
|
import('./dynamic-import-module_FIXTURE.js')['then'](x => x)
|
||||||
|
//- body
|
||||||
|
assert.sameValue(imported.x, 1);
|
9
src/dynamic-import/nested-imports.case
Normal file
9
src/dynamic-import/nested-imports.case
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
desc: ImportCall is a CallExpression can be nested in other import calls
|
||||||
|
template: syntax/valid
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- import
|
||||||
|
import(import(import('./empty_FIXTURE.js')))
|
16
src/dynamic-import/not-extensible-args.case
Normal file
16
src/dynamic-import/not-extensible-args.case
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
desc: ImportCall is not extensible - no arguments list
|
||||||
|
template: syntax/invalid
|
||||||
|
info: |
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression[+In, ?Yield] )
|
||||||
|
|
||||||
|
Forbidden Extensions
|
||||||
|
|
||||||
|
- ImportCall must not be extended.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- import
|
||||||
|
import('', '')
|
16
src/dynamic-import/not-extensible-no-trailing-comma.case
Normal file
16
src/dynamic-import/not-extensible-no-trailing-comma.case
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
desc: ImportCall is not extensible - trailing comma
|
||||||
|
template: syntax/invalid
|
||||||
|
info: |
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression[+In, ?Yield] )
|
||||||
|
|
||||||
|
Forbidden Extensions
|
||||||
|
|
||||||
|
- ImportCall must not be extended.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- import
|
||||||
|
import('',)
|
@ -6,7 +6,7 @@ desc: Dynamic import() returns a Promise object.
|
|||||||
template: default
|
template: default
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
//- params
|
//- import
|
||||||
'./dynamic-import-module_FIXTURE.js'
|
import('./dynamic-import-module_FIXTURE.js')
|
||||||
//- body
|
//- body
|
||||||
assert.sameValue(imported.x, 1);
|
assert.sameValue(imported.x, 1);
|
||||||
|
14
src/dynamic-import/script-code-valid.case
Normal file
14
src/dynamic-import/script-code-valid.case
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
desc: import() can be used in script code
|
||||||
|
template: syntax/valid
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- setup
|
||||||
|
// 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
|
||||||
|
import('./script-code-valid.js')
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
32
src/dynamic-import/syntax/invalid/nested-with.template
Normal file
32
src/dynamic-import/syntax/invalid/nested-with.template
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
// Copyright (C) 2018 Rick Waldron. All rights reserved.
|
||||||
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
path: language/module-code/dynamic-import/syntax/invalid/nested-with-
|
||||||
|
name: nested with syntax
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
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]].
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [noStrict]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
with ({}) {
|
||||||
|
/*{ import }*/;
|
||||||
|
}
|
@ -8,8 +8,6 @@ esid: sec-import-call-runtime-semantics-evaluation
|
|||||||
info: |
|
info: |
|
||||||
ImportCall :
|
ImportCall :
|
||||||
import( AssignmentExpression )
|
import( AssignmentExpression )
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ info: |
|
|||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
9. Return promiseCapability.[[Promise]].
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
27
src/dynamic-import/syntax/valid/nested-with.template
Normal file
27
src/dynamic-import/syntax/valid/nested-with.template
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// Copyright (C) 2018 Rick Waldron. All rights reserved.
|
||||||
|
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
path: language/module-code/dynamic-import/syntax/valid/nested-with-
|
||||||
|
name: nested with syntax
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
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]].
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [noStrict]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
with ({}) {
|
||||||
|
/*{ import }*/;
|
||||||
|
}
|
@ -8,8 +8,6 @@ esid: sec-import-call-runtime-semantics-evaluation
|
|||||||
info: |
|
info: |
|
||||||
ImportCall :
|
ImportCall :
|
||||||
import( AssignmentExpression )
|
import( AssignmentExpression )
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/file-does-not-exist.case
|
||||||
|
// - src/dynamic-import/catch/nested-arrow.template
|
||||||
|
/*---
|
||||||
|
description: Non existent file can't resolve to a Script or Module Record (nested arrow)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated, async]
|
||||||
|
info: |
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression )
|
||||||
|
|
||||||
|
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
||||||
|
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
||||||
|
3. Let argRef be the result of evaluating AssignmentExpression.
|
||||||
|
4. Let specifier be ? GetValue(argRef).
|
||||||
|
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||||
|
6. Let specifierString be ToString(specifier).
|
||||||
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
|
If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
|
||||||
|
specifier does not exist or cannot be created, an exception must be thrown.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
let f = () => {
|
||||||
|
import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
|
||||||
|
|
||||||
|
assert.notSameValue(typeof error, 'undefined');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
};
|
||||||
|
|
||||||
|
f();
|
@ -0,0 +1,37 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/file-does-not-exist.case
|
||||||
|
// - src/dynamic-import/catch/nested-async-function-await.template
|
||||||
|
/*---
|
||||||
|
description: Non existent file can't resolve to a Script or Module Record (nested in async function, awaited)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated, async]
|
||||||
|
info: |
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression )
|
||||||
|
|
||||||
|
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
||||||
|
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
||||||
|
3. Let argRef be the result of evaluating AssignmentExpression.
|
||||||
|
4. Let specifier be ? GetValue(argRef).
|
||||||
|
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||||
|
6. Let specifierString be ToString(specifier).
|
||||||
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
|
If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
|
||||||
|
specifier does not exist or cannot be created, an exception must be thrown.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
async function f() {
|
||||||
|
await import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
|
||||||
|
|
||||||
|
assert.notSameValue(typeof error, 'undefined');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
f();
|
@ -0,0 +1,38 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/file-does-not-exist.case
|
||||||
|
// - src/dynamic-import/catch/nested-async-function.template
|
||||||
|
/*---
|
||||||
|
description: Non existent file can't resolve to a Script or Module Record (nested in async function)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated, async]
|
||||||
|
info: |
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression )
|
||||||
|
|
||||||
|
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
||||||
|
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
||||||
|
3. Let argRef be the result of evaluating AssignmentExpression.
|
||||||
|
4. Let specifier be ? GetValue(argRef).
|
||||||
|
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||||
|
6. Let specifierString be ToString(specifier).
|
||||||
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
|
If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
|
||||||
|
specifier does not exist or cannot be created, an exception must be thrown.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
async function f() {
|
||||||
|
import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
|
||||||
|
|
||||||
|
assert.notSameValue(typeof error, 'undefined');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
f();
|
||||||
|
|
@ -0,0 +1,37 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/file-does-not-exist.case
|
||||||
|
// - src/dynamic-import/catch/nested-async-function-return-await.template
|
||||||
|
/*---
|
||||||
|
description: Non existent file can't resolve to a Script or Module Record (nested in async function, returns awaited)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated, async]
|
||||||
|
info: |
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression )
|
||||||
|
|
||||||
|
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
||||||
|
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
||||||
|
3. Let argRef be the result of evaluating AssignmentExpression.
|
||||||
|
4. Let specifier be ? GetValue(argRef).
|
||||||
|
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||||
|
6. Let specifierString be ToString(specifier).
|
||||||
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
|
If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
|
||||||
|
specifier does not exist or cannot be created, an exception must be thrown.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
async function f() {
|
||||||
|
return await import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
|
||||||
|
|
||||||
|
assert.notSameValue(typeof error, 'undefined');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
f();
|
@ -0,0 +1,35 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/file-does-not-exist.case
|
||||||
|
// - src/dynamic-import/catch/nested-block.template
|
||||||
|
/*---
|
||||||
|
description: Non existent file can't resolve to a Script or Module Record (nested block)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated, async]
|
||||||
|
info: |
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression )
|
||||||
|
|
||||||
|
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
||||||
|
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
||||||
|
3. Let argRef be the result of evaluating AssignmentExpression.
|
||||||
|
4. Let specifier be ? GetValue(argRef).
|
||||||
|
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||||
|
6. Let specifierString be ToString(specifier).
|
||||||
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
|
If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
|
||||||
|
specifier does not exist or cannot be created, an exception must be thrown.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
{
|
||||||
|
import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
|
||||||
|
|
||||||
|
assert.notSameValue(typeof error, 'undefined');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
};
|
@ -0,0 +1,35 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/file-does-not-exist.case
|
||||||
|
// - src/dynamic-import/catch/nested-block-labeled.template
|
||||||
|
/*---
|
||||||
|
description: Non existent file can't resolve to a Script or Module Record (nested block syntax)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated, async]
|
||||||
|
info: |
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression )
|
||||||
|
|
||||||
|
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
||||||
|
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
||||||
|
3. Let argRef be the result of evaluating AssignmentExpression.
|
||||||
|
4. Let specifier be ? GetValue(argRef).
|
||||||
|
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||||
|
6. Let specifierString be ToString(specifier).
|
||||||
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
|
If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
|
||||||
|
specifier does not exist or cannot be created, an exception must be thrown.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
label: {
|
||||||
|
import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
|
||||||
|
|
||||||
|
assert.notSameValue(typeof error, 'undefined');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
};
|
@ -0,0 +1,35 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/file-does-not-exist.case
|
||||||
|
// - src/dynamic-import/catch/nested-do-while.template
|
||||||
|
/*---
|
||||||
|
description: Non existent file can't resolve to a Script or Module Record (nested do while syntax)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated, async]
|
||||||
|
info: |
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression )
|
||||||
|
|
||||||
|
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
||||||
|
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
||||||
|
3. Let argRef be the result of evaluating AssignmentExpression.
|
||||||
|
4. Let specifier be ? GetValue(argRef).
|
||||||
|
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||||
|
6. Let specifierString be ToString(specifier).
|
||||||
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
|
If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
|
||||||
|
specifier does not exist or cannot be created, an exception must be thrown.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
do {
|
||||||
|
import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
|
||||||
|
|
||||||
|
assert.notSameValue(typeof error, 'undefined');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
} while (false);
|
@ -0,0 +1,37 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/file-does-not-exist.case
|
||||||
|
// - src/dynamic-import/catch/nested-else.template
|
||||||
|
/*---
|
||||||
|
description: Non existent file can't resolve to a Script or Module Record (nested else)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated, async]
|
||||||
|
info: |
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression )
|
||||||
|
|
||||||
|
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
||||||
|
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
||||||
|
3. Let argRef be the result of evaluating AssignmentExpression.
|
||||||
|
4. Let specifier be ? GetValue(argRef).
|
||||||
|
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||||
|
6. Let specifierString be ToString(specifier).
|
||||||
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
|
If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
|
||||||
|
specifier does not exist or cannot be created, an exception must be thrown.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (false) {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
|
||||||
|
|
||||||
|
assert.notSameValue(typeof error, 'undefined');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/file-does-not-exist.case
|
||||||
|
// - src/dynamic-import/catch/nested-function.template
|
||||||
|
/*---
|
||||||
|
description: Non existent file can't resolve to a Script or Module Record (nested function)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated, async]
|
||||||
|
info: |
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression )
|
||||||
|
|
||||||
|
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
||||||
|
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
||||||
|
3. Let argRef be the result of evaluating AssignmentExpression.
|
||||||
|
4. Let specifier be ? GetValue(argRef).
|
||||||
|
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||||
|
6. Let specifierString be ToString(specifier).
|
||||||
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
|
If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
|
||||||
|
specifier does not exist or cannot be created, an exception must be thrown.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
function f() {
|
||||||
|
import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
|
||||||
|
|
||||||
|
assert.notSameValue(typeof error, 'undefined');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
f();
|
@ -0,0 +1,35 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/file-does-not-exist.case
|
||||||
|
// - src/dynamic-import/catch/nested-if.template
|
||||||
|
/*---
|
||||||
|
description: Non existent file can't resolve to a Script or Module Record (nested if)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated, async]
|
||||||
|
info: |
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression )
|
||||||
|
|
||||||
|
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
||||||
|
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
||||||
|
3. Let argRef be the result of evaluating AssignmentExpression.
|
||||||
|
4. Let specifier be ? GetValue(argRef).
|
||||||
|
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||||
|
6. Let specifierString be ToString(specifier).
|
||||||
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
|
If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
|
||||||
|
specifier does not exist or cannot be created, an exception must be thrown.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) {
|
||||||
|
import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
|
||||||
|
|
||||||
|
assert.notSameValue(typeof error, 'undefined');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/file-does-not-exist.case
|
||||||
|
// - src/dynamic-import/catch/nested-while.template
|
||||||
|
/*---
|
||||||
|
description: Non existent file can't resolve to a Script or Module Record (nested while)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated, async]
|
||||||
|
info: |
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression )
|
||||||
|
|
||||||
|
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
||||||
|
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
||||||
|
3. Let argRef be the result of evaluating AssignmentExpression.
|
||||||
|
4. Let specifier be ? GetValue(argRef).
|
||||||
|
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||||
|
6. Let specifierString be ToString(specifier).
|
||||||
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
|
If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
|
||||||
|
specifier does not exist or cannot be created, an exception must be thrown.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
let x = 0;
|
||||||
|
while (!x) {
|
||||||
|
x++;
|
||||||
|
import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
|
||||||
|
|
||||||
|
assert.notSameValue(typeof error, 'undefined');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
};
|
@ -0,0 +1,39 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
|
||||||
|
// - src/dynamic-import/catch/nested-with.template
|
||||||
|
/*---
|
||||||
|
description: Abrupt completion during module evaluation precludes further evaluation (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]].
|
||||||
|
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. For each String required that is an element of
|
||||||
|
module.[[RequestedModules]] do,
|
||||||
|
a. Let requiredModule be ? HostResolveImportedModule(module, required).
|
||||||
|
b. Perform ? requiredModule.ModuleEvaluation().
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
with ({}) {
|
||||||
|
import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'TypeError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
|
||||||
|
// - src/dynamic-import/catch/nested-with.template
|
||||||
|
/*---
|
||||||
|
description: Abrupt completion during module evaluation precludes further evaluation (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]].
|
||||||
|
|
||||||
|
|
||||||
|
[...]
|
||||||
|
6. For each String required that is an element of
|
||||||
|
module.[[RequestedModules]] do,
|
||||||
|
a. Let requiredModule be ? HostResolveImportedModule(module, required).
|
||||||
|
b. Perform ? requiredModule.ModuleEvaluation().
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
with ({}) {
|
||||||
|
import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'URIError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/file-does-not-exist.case
|
||||||
|
// - src/dynamic-import/catch/nested-with.template
|
||||||
|
/*---
|
||||||
|
description: Non existent file can't resolve to a Script or Module Record (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]].
|
||||||
|
|
||||||
|
|
||||||
|
If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
|
||||||
|
specifier does not exist or cannot be created, an exception must be thrown.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
with ({}) {
|
||||||
|
import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
|
||||||
|
|
||||||
|
assert.notSameValue(typeof error, 'undefined');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,60 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/instn-iee-err-ambiguous-import.case
|
||||||
|
// - src/dynamic-import/catch/nested-with.template
|
||||||
|
/*---
|
||||||
|
description: IndirectExportEntries validation - ambiguous imported bindings (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]].
|
||||||
|
|
||||||
|
|
||||||
|
[...]
|
||||||
|
9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
|
||||||
|
a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
|
||||||
|
b. If resolution is null or resolution is "ambiguous", throw a
|
||||||
|
SyntaxError exception.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
15.2.1.16.3 ResolveExport
|
||||||
|
|
||||||
|
[...]
|
||||||
|
9. Let starResolution be null.
|
||||||
|
10. For each ExportEntry Record e in module.[[StarExportEntries]], do
|
||||||
|
a. Let importedModule be ? HostResolveImportedModule(module,
|
||||||
|
e.[[ModuleRequest]]).
|
||||||
|
b. Let resolution be ? importedModule.ResolveExport(exportName,
|
||||||
|
resolveSet, exportStarSet).
|
||||||
|
c. If resolution is "ambiguous", return "ambiguous".
|
||||||
|
d. If resolution is not null, then
|
||||||
|
i. If starResolution is null, let starResolution be resolution.
|
||||||
|
ii. Else,
|
||||||
|
1. Assert: there is more than one * import that includes the
|
||||||
|
requested name.
|
||||||
|
2. If resolution.[[Module]] and starResolution.[[Module]] are
|
||||||
|
not the same Module Record or
|
||||||
|
SameValue(resolution.[[BindingName]],
|
||||||
|
starResolution.[[BindingName]]) is false, return "ambiguous".
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
with ({}) {
|
||||||
|
import('./instn-iee-err-ambiguous-export_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,49 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/instn-iee-err-circular.case
|
||||||
|
// - src/dynamic-import/catch/nested-with.template
|
||||||
|
/*---
|
||||||
|
description: IndirectExportEntries validation - circular imported bindings (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]].
|
||||||
|
|
||||||
|
|
||||||
|
[...]
|
||||||
|
9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
|
||||||
|
a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
|
||||||
|
b. If resolution is null or resolution is "ambiguous", throw a
|
||||||
|
SyntaxError exception.
|
||||||
|
[...]
|
||||||
|
|
||||||
|
15.2.1.16.3 ResolveExport
|
||||||
|
|
||||||
|
[...]
|
||||||
|
2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
|
||||||
|
a. If module and r.[[Module]] are the same Module Record and
|
||||||
|
SameValue(exportName, r.[[ExportName]]) is true, then
|
||||||
|
i. Assert: this is a circular import request.
|
||||||
|
ii. Return null.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
with ({}) {
|
||||||
|
import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => {
|
||||||
|
|
||||||
|
assert.sameValue(error.name, 'SyntaxError');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/file-does-not-exist.case
|
||||||
|
// - src/dynamic-import/catch/top-level.template
|
||||||
|
/*---
|
||||||
|
description: Non existent file can't resolve to a Script or Module Record (top level)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated, async]
|
||||||
|
info: |
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression )
|
||||||
|
|
||||||
|
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
||||||
|
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
||||||
|
3. Let argRef be the result of evaluating AssignmentExpression.
|
||||||
|
4. Let specifier be ? GetValue(argRef).
|
||||||
|
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
||||||
|
6. Let specifierString be ToString(specifier).
|
||||||
|
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||||
|
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||||
|
9. Return promiseCapability.[[Promise]].
|
||||||
|
|
||||||
|
|
||||||
|
If a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
|
||||||
|
specifier does not exist or cannot be created, an exception must be thrown.
|
||||||
|
|
||||||
|
---*/
|
||||||
|
|
||||||
|
import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
|
||||||
|
|
||||||
|
assert.notSameValue(typeof error, 'undefined');
|
||||||
|
|
||||||
|
}).then($DONE, $DONE);
|
@ -5,7 +5,7 @@
|
|||||||
description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
|
description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, module]
|
flags: [generated]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
|
description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, module]
|
flags: [generated]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/not-extensible-args.case
|
||||||
|
// - src/dynamic-import/syntax/invalid/nested-arrow-assignment-expression.template
|
||||||
|
/*---
|
||||||
|
description: ImportCall is not extensible - no arguments list (nested arrow syntax)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
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]].
|
||||||
|
|
||||||
|
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression[+In, ?Yield] )
|
||||||
|
|
||||||
|
Forbidden Extensions
|
||||||
|
|
||||||
|
- ImportCall must not be extended.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
let f = () => import('', '');
|
@ -0,0 +1,37 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/not-extensible-no-trailing-comma.case
|
||||||
|
// - src/dynamic-import/syntax/invalid/nested-arrow-assignment-expression.template
|
||||||
|
/*---
|
||||||
|
description: ImportCall is not extensible - trailing comma (nested arrow syntax)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
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]].
|
||||||
|
|
||||||
|
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression[+In, ?Yield] )
|
||||||
|
|
||||||
|
Forbidden Extensions
|
||||||
|
|
||||||
|
- ImportCall must not be extended.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
let f = () => import('',);
|
@ -0,0 +1,39 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/not-extensible-args.case
|
||||||
|
// - src/dynamic-import/syntax/invalid/nested-arrow.template
|
||||||
|
/*---
|
||||||
|
description: ImportCall is not extensible - no arguments list (nested arrow syntax)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
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]].
|
||||||
|
|
||||||
|
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression[+In, ?Yield] )
|
||||||
|
|
||||||
|
Forbidden Extensions
|
||||||
|
|
||||||
|
- ImportCall must not be extended.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
let f = () => {
|
||||||
|
import('', '');
|
||||||
|
};
|
@ -0,0 +1,39 @@
|
|||||||
|
// This file was procedurally generated from the following sources:
|
||||||
|
// - src/dynamic-import/not-extensible-no-trailing-comma.case
|
||||||
|
// - src/dynamic-import/syntax/invalid/nested-arrow.template
|
||||||
|
/*---
|
||||||
|
description: ImportCall is not extensible - trailing comma (nested arrow syntax)
|
||||||
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
|
features: [dynamic-import]
|
||||||
|
flags: [generated]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
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]].
|
||||||
|
|
||||||
|
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression[+In, ?Yield] )
|
||||||
|
|
||||||
|
Forbidden Extensions
|
||||||
|
|
||||||
|
- ImportCall must not be extended.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
let f = () => {
|
||||||
|
import('',);
|
||||||
|
};
|
@ -5,7 +5,7 @@
|
|||||||
description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
|
description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, module]
|
flags: [generated]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
|
description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
features: [dynamic-import]
|
features: [dynamic-import]
|
||||||
flags: [generated, module]
|
flags: [generated]
|
||||||
negative:
|
negative:
|
||||||
phase: parse
|
phase: parse
|
||||||
type: SyntaxError
|
type: SyntaxError
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user