mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Merge pull request #1832 from leobalter/dyn-import-part2
More test cases for dynamic import
This commit is contained in:
commit
eb4401ee44
src/dynamic-import
catch
nested-arrow.templatenested-async-function-await.templatenested-async-function-return-await.templatenested-async-function.templatenested-block-labeled.templatenested-block.templatenested-do-while.templatenested-else.templatenested-function.templatenested-if.templatenested-while.templatenested-with.templatetop-level.template
default
nested-arrow-assign-expr.templatenested-arrow.templatenested-async-function-await.templatenested-async-function-return-await.templatenested-async-function.templatenested-block-labeled.templatenested-block.templatenested-do-while.templatenested-else.templatenested-function.templatenested-if-braceless.templatenested-if.templatenested-while.templatenested-with.templatetop-level.template
eval-gtbndng-indirect-update-dflt.caseeval-gtbndng-indirect-update.caseeval-rqstd-abrupt-typeerror.caseeval-rqstd-abrupt-urierror.casefile-does-not-exist.caseinstn-iee-err-ambiguous-import.caseinstn-iee-err-circular.caseis-call-expression-square-brackets.casenested-imports.casenot-extensible-args.casenot-extensible-no-trailing-comma.casereturns-promise.casescript-code-valid.casesyntax
invalid
nested-arrow-assignment-expression.templatenested-arrow.templatenested-async-function-await.templatenested-async-function-return-await.templatenested-async-function.templatenested-block-labeled.templatenested-block.templatenested-do-while.templatenested-else-braceless.templatenested-else.templatenested-function-return.templatenested-function.templatenested-if-braceless.templatenested-if.templatenested-while.templatenested-with.templatetop-level.template
valid
nested-arrow-assignment-expression.templatenested-arrow.templatenested-async-function-await.templatenested-async-function-return-await.templatenested-async-function.templatenested-block-labeled.templatenested-block.templatenested-do-while.templatenested-else-braceless.templatenested-else.templatenested-function-return.templatenested-function.templatenested-if-braceless.templatenested-if.templatenested-while.templatenested-with.templatetop-level.template
test/language/module-code/dynamic-import
catch
nested-arrow-import-catch-file-does-not-exist.jsnested-async-function-await-file-does-not-exist.jsnested-async-function-file-does-not-exist.jsnested-async-function-return-await-file-does-not-exist.jsnested-block-import-catch-file-does-not-exist.jsnested-block-labeled-file-does-not-exist.jsnested-do-while-file-does-not-exist.jsnested-else-import-catch-file-does-not-exist.jsnested-function-import-catch-file-does-not-exist.jsnested-if-import-catch-file-does-not-exist.jsnested-while-import-catch-file-does-not-exist.jsnested-with-import-catch-eval-rqstd-abrupt-typeerror.jsnested-with-import-catch-eval-rqstd-abrupt-urierror.jsnested-with-import-catch-file-does-not-exist.jsnested-with-import-catch-instn-iee-err-ambiguous-import.jsnested-with-import-catch-instn-iee-err-circular.jstop-level-import-catch-file-does-not-exist.js
syntax/invalid
nested-arrow-assignment-expr-not-optional.jsnested-arrow-assignment-expression-assignment-expr-not-optional.jsnested-arrow-assignment-expression-not-extensible-args.jsnested-arrow-assignment-expression-not-extensible-no-trailing-comma.jsnested-arrow-not-extensible-args.jsnested-arrow-not-extensible-no-trailing-comma.jsnested-async-function-assignment-expr-not-optional.jsnested-async-function-await-assignment-expr-not-optional.js
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
let f = () => {
|
||||
import(/*{ params }*/).catch(error => {
|
||||
/*{ import }*/.catch(error => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
async function f() {
|
||||
await import(/*{ params }*/).catch(error => {
|
||||
await /*{ import }*/.catch(error => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
async function f() {
|
||||
return await import(/*{ params }*/).catch(error => {
|
||||
return await /*{ import }*/.catch(error => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
async function f() {
|
||||
import(/*{ params }*/).catch(error => {
|
||||
/*{ import }*/.catch(error => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
label: {
|
||||
import(/*{ params }*/).catch(error => {
|
||||
/*{ import }*/.catch(error => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
{
|
||||
import(/*{ params }*/).catch(error => {
|
||||
/*{ import }*/.catch(error => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
do {
|
||||
import(/*{ params }*/).catch(error => {
|
||||
/*{ import }*/.catch(error => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -27,7 +27,7 @@ flags: [async]
|
||||
if (false) {
|
||||
|
||||
} else {
|
||||
import(/*{ params }*/).catch(error => {
|
||||
/*{ import }*/.catch(error => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
function f() {
|
||||
import(/*{ params }*/).catch(error => {
|
||||
/*{ import }*/.catch(error => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
if (true) {
|
||||
import(/*{ params }*/).catch(error => {
|
||||
/*{ import }*/.catch(error => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -27,7 +27,7 @@ flags: [async]
|
||||
let x = 0;
|
||||
while (!x) {
|
||||
x++;
|
||||
import(/*{ params }*/).catch(error => {
|
||||
/*{ import }*/.catch(error => {
|
||||
|
||||
/*{ 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]
|
||||
---*/
|
||||
|
||||
import(/*{ params }*/).catch(error => {
|
||||
/*{ import }*/.catch(error => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -24,7 +24,7 @@ features: [dynamic-import]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
let f = () => import(/*{ params }*/).then(imported => {
|
||||
let f = () => /*{ import }*/.then(imported => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
let f = () => {
|
||||
return import(/*{ params }*/).then(imported => {
|
||||
return /*{ import }*/.then(imported => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
async function f() {
|
||||
await import(/*{ params }*/).then(imported => {
|
||||
await /*{ import }*/.then(imported => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
async function f() {
|
||||
return await import(/*{ params }*/);
|
||||
return await /*{ import }*/;
|
||||
}
|
||||
|
||||
f().then(imported => {
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
async function f() {
|
||||
import(/*{ params }*/).then(imported => {
|
||||
/*{ import }*/.then(imported => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
label: {
|
||||
import(/*{ params }*/).then(imported => {
|
||||
/*{ import }*/.then(imported => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
{
|
||||
import(/*{ params }*/).then(imported => {
|
||||
/*{ import }*/.then(imported => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
do {
|
||||
import(/*{ params }*/).then(imported => {
|
||||
/*{ import }*/.then(imported => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -27,7 +27,7 @@ flags: [async]
|
||||
if (false) {
|
||||
|
||||
} else {
|
||||
import(/*{ params }*/).then(imported => {
|
||||
/*{ import }*/.then(imported => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
function f() {
|
||||
import(/*{ params }*/).then(imported => {
|
||||
/*{ import }*/.then(imported => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -24,7 +24,7 @@ features: [dynamic-import]
|
||||
flags: [async]
|
||||
---*/
|
||||
|
||||
if (true) import(/*{ params }*/).then(imported => {
|
||||
if (true) /*{ import }*/.then(imported => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -25,7 +25,7 @@ flags: [async]
|
||||
---*/
|
||||
|
||||
if (true) {
|
||||
import(/*{ params }*/).then(imported => {
|
||||
/*{ import }*/.then(imported => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -27,7 +27,7 @@ flags: [async]
|
||||
let x = 0;
|
||||
while (!x) {
|
||||
x++;
|
||||
import(/*{ params }*/).then(imported => {
|
||||
/*{ import }*/.then(imported => {
|
||||
|
||||
/*{ 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]
|
||||
---*/
|
||||
|
||||
import(/*{ params }*/).then(imported => {
|
||||
/*{ import }*/.then(imported => {
|
||||
|
||||
/*{ body }*/
|
||||
|
||||
|
@ -20,8 +20,8 @@ info: |
|
||||
template: default
|
||||
---*/
|
||||
|
||||
//- params
|
||||
'./eval-gtbndng-indirect-update-dflt_FIXTURE.js'
|
||||
//- import
|
||||
import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js')
|
||||
//- body
|
||||
assert.sameValue(imported.default(), 1);
|
||||
assert.sameValue(imported.default, 2);
|
||||
|
@ -21,8 +21,8 @@ includes: [fnGlobalObject.js]
|
||||
template: default
|
||||
---*/
|
||||
|
||||
//- params
|
||||
'./eval-gtbndng-indirect-update_FIXTURE.js'
|
||||
//- import
|
||||
import('./eval-gtbndng-indirect-update_FIXTURE.js')
|
||||
//- body
|
||||
assert.sameValue(imported.x, 1);
|
||||
|
||||
|
@ -14,7 +14,7 @@ info: |
|
||||
template: catch
|
||||
---*/
|
||||
|
||||
//- params
|
||||
'./eval-rqstd-abrupt-err-type_FIXTURE.js'
|
||||
//- import
|
||||
import('./eval-rqstd-abrupt-err-type_FIXTURE.js')
|
||||
//- body
|
||||
assert.sameValue(error.name, 'TypeError');
|
||||
|
@ -14,7 +14,7 @@ info: |
|
||||
template: catch
|
||||
---*/
|
||||
|
||||
//- params
|
||||
'./eval-rqstd-abrupt-err-uri_FIXTURE.js'
|
||||
//- import
|
||||
import('./eval-rqstd-abrupt-err-uri_FIXTURE.js')
|
||||
//- body
|
||||
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
|
||||
---*/
|
||||
|
||||
//- params
|
||||
'./instn-iee-err-ambiguous-export_FIXTURE.js'
|
||||
//- import
|
||||
import('./instn-iee-err-ambiguous-export_FIXTURE.js')
|
||||
//- body
|
||||
assert.sameValue(error.name, 'SyntaxError');
|
||||
|
@ -23,7 +23,7 @@ info: |
|
||||
template: catch
|
||||
---*/
|
||||
|
||||
//- params
|
||||
'./instn-iee-err-circular-1_FIXTURE.js'
|
||||
//- import
|
||||
import('./instn-iee-err-circular-1_FIXTURE.js')
|
||||
//- body
|
||||
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
|
||||
---*/
|
||||
|
||||
//- params
|
||||
'./dynamic-import-module_FIXTURE.js'
|
||||
//- import
|
||||
import('./dynamic-import-module_FIXTURE.js')
|
||||
//- body
|
||||
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).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
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: |
|
||||
ImportCall :
|
||||
import( AssignmentExpression )
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
|
@ -18,8 +18,6 @@ info: |
|
||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
||||
9. Return promiseCapability.[[Promise]].
|
||||
|
||||
flags: [module]
|
||||
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: |
|
||||
ImportCall :
|
||||
import( AssignmentExpression )
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
|
37
test/language/module-code/dynamic-import/catch/nested-arrow-import-catch-file-does-not-exist.js
Normal file
37
test/language/module-code/dynamic-import/catch/nested-arrow-import-catch-file-does-not-exist.js
Normal file
@ -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();
|
37
test/language/module-code/dynamic-import/catch/nested-async-function-await-file-does-not-exist.js
Normal file
37
test/language/module-code/dynamic-import/catch/nested-async-function-await-file-does-not-exist.js
Normal file
@ -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();
|
38
test/language/module-code/dynamic-import/catch/nested-async-function-file-does-not-exist.js
Normal file
38
test/language/module-code/dynamic-import/catch/nested-async-function-file-does-not-exist.js
Normal file
@ -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();
|
||||
|
37
test/language/module-code/dynamic-import/catch/nested-async-function-return-await-file-does-not-exist.js
Normal file
37
test/language/module-code/dynamic-import/catch/nested-async-function-return-await-file-does-not-exist.js
Normal file
@ -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();
|
35
test/language/module-code/dynamic-import/catch/nested-block-import-catch-file-does-not-exist.js
Normal file
35
test/language/module-code/dynamic-import/catch/nested-block-import-catch-file-does-not-exist.js
Normal file
@ -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);
|
||||
};
|
35
test/language/module-code/dynamic-import/catch/nested-block-labeled-file-does-not-exist.js
Normal file
35
test/language/module-code/dynamic-import/catch/nested-block-labeled-file-does-not-exist.js
Normal file
@ -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);
|
||||
};
|
35
test/language/module-code/dynamic-import/catch/nested-do-while-file-does-not-exist.js
Normal file
35
test/language/module-code/dynamic-import/catch/nested-do-while-file-does-not-exist.js
Normal file
@ -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);
|
37
test/language/module-code/dynamic-import/catch/nested-else-import-catch-file-does-not-exist.js
Normal file
37
test/language/module-code/dynamic-import/catch/nested-else-import-catch-file-does-not-exist.js
Normal file
@ -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);
|
||||
}
|
36
test/language/module-code/dynamic-import/catch/nested-function-import-catch-file-does-not-exist.js
Normal file
36
test/language/module-code/dynamic-import/catch/nested-function-import-catch-file-does-not-exist.js
Normal file
@ -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();
|
35
test/language/module-code/dynamic-import/catch/nested-if-import-catch-file-does-not-exist.js
Normal file
35
test/language/module-code/dynamic-import/catch/nested-if-import-catch-file-does-not-exist.js
Normal file
@ -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);
|
||||
}
|
37
test/language/module-code/dynamic-import/catch/nested-while-import-catch-file-does-not-exist.js
Normal file
37
test/language/module-code/dynamic-import/catch/nested-while-import-catch-file-does-not-exist.js
Normal file
@ -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);
|
||||
};
|
39
test/language/module-code/dynamic-import/catch/nested-with-import-catch-eval-rqstd-abrupt-typeerror.js
Normal file
39
test/language/module-code/dynamic-import/catch/nested-with-import-catch-eval-rqstd-abrupt-typeerror.js
Normal file
@ -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);
|
||||
}
|
||||
|
39
test/language/module-code/dynamic-import/catch/nested-with-import-catch-eval-rqstd-abrupt-urierror.js
Normal file
39
test/language/module-code/dynamic-import/catch/nested-with-import-catch-eval-rqstd-abrupt-urierror.js
Normal file
@ -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);
|
||||
}
|
||||
|
36
test/language/module-code/dynamic-import/catch/nested-with-import-catch-file-does-not-exist.js
Normal file
36
test/language/module-code/dynamic-import/catch/nested-with-import-catch-file-does-not-exist.js
Normal file
@ -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);
|
||||
}
|
||||
|
60
test/language/module-code/dynamic-import/catch/nested-with-import-catch-instn-iee-err-ambiguous-import.js
Normal file
60
test/language/module-code/dynamic-import/catch/nested-with-import-catch-instn-iee-err-ambiguous-import.js
Normal file
@ -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);
|
||||
}
|
||||
|
49
test/language/module-code/dynamic-import/catch/nested-with-import-catch-instn-iee-err-circular.js
Normal file
49
test/language/module-code/dynamic-import/catch/nested-with-import-catch-instn-iee-err-circular.js
Normal file
@ -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);
|
||||
}
|
||||
|
33
test/language/module-code/dynamic-import/catch/top-level-import-catch-file-does-not-exist.js
Normal file
33
test/language/module-code/dynamic-import/catch/top-level-import-catch-file-does-not-exist.js
Normal file
@ -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);
|
2
test/language/module-code/dynamic-import/syntax/invalid/nested-arrow-assignment-expr-not-optional.js
2
test/language/module-code/dynamic-import/syntax/invalid/nested-arrow-assignment-expr-not-optional.js
@ -5,7 +5,7 @@
|
||||
description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
features: [dynamic-import]
|
||||
flags: [generated, module]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
|
@ -5,7 +5,7 @@
|
||||
description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
features: [dynamic-import]
|
||||
flags: [generated, module]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
|
37
test/language/module-code/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-not-extensible-args.js
Normal file
37
test/language/module-code/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-not-extensible-args.js
Normal file
@ -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('', '');
|
37
test/language/module-code/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-not-extensible-no-trailing-comma.js
Normal file
37
test/language/module-code/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-not-extensible-no-trailing-comma.js
Normal file
@ -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('',);
|
39
test/language/module-code/dynamic-import/syntax/invalid/nested-arrow-not-extensible-args.js
Normal file
39
test/language/module-code/dynamic-import/syntax/invalid/nested-arrow-not-extensible-args.js
Normal file
@ -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('', '');
|
||||
};
|
39
test/language/module-code/dynamic-import/syntax/invalid/nested-arrow-not-extensible-no-trailing-comma.js
Normal file
39
test/language/module-code/dynamic-import/syntax/invalid/nested-arrow-not-extensible-no-trailing-comma.js
Normal file
@ -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)
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
features: [dynamic-import]
|
||||
flags: [generated, module]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
|
@ -5,7 +5,7 @@
|
||||
description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
features: [dynamic-import]
|
||||
flags: [generated, module]
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: parse
|
||||
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