mirror of https://github.com/tc39/test262.git
split valid and invalid syntax templates
This commit is contained in:
parent
c31feb753d
commit
290bbfbbfc
|
@ -3,17 +3,12 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: It's a SyntaxError if AssignmentExpression is omitted
|
||||
template: syntax
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
template: syntax/invalid
|
||||
info: |
|
||||
ImportCall :
|
||||
import()
|
||||
|
||||
---*/
|
||||
//- setup
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
//- params
|
||||
|
||||
//- teardown
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Calling import('')
|
||||
template: syntax
|
||||
template: syntax/valid
|
||||
---*/
|
||||
|
||||
//- params
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
// 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-arrow-assignment-expression-
|
||||
name: nested arrow 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
let f = () => import(/*{ params }*/);
|
|
@ -0,0 +1,33 @@
|
|||
// 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-arrow-
|
||||
name: nested arrow 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
let f = () => {
|
||||
import(/*{ params }*/);
|
||||
};
|
|
@ -0,0 +1,33 @@
|
|||
// 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-arrow-
|
||||
name: nested arrow 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
async function f() {
|
||||
await import(/*{ params }*/);
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
// 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-arrow-
|
||||
name: nested arrow 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
async function f() {
|
||||
return await import(/*{ params }*/);
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
// 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-arrow-
|
||||
name: nested arrow 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
async function f() {
|
||||
import(/*{ params }*/);
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
// 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-block-labeled-
|
||||
name: nested block 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
label: {
|
||||
import(/*{ params }*/);
|
||||
};
|
|
@ -0,0 +1,33 @@
|
|||
// 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-block-
|
||||
name: nested block 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
{
|
||||
import(/*{ params }*/);
|
||||
};
|
|
@ -0,0 +1,33 @@
|
|||
// 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-do-while-
|
||||
name: nested do 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
do {
|
||||
import(/*{ params }*/);
|
||||
} while (false);
|
|
@ -0,0 +1,35 @@
|
|||
// 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-do-
|
||||
name: nested do 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
let x = 0;
|
||||
do {
|
||||
x++;
|
||||
import(/*{ params }*/);
|
||||
} while (!x);
|
|
@ -0,0 +1,33 @@
|
|||
// 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-else-braceless-
|
||||
name: nested else 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
if (false) {
|
||||
|
||||
} else import(/*{ params }*/);
|
|
@ -0,0 +1,35 @@
|
|||
// 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-else-
|
||||
name: nested else 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
if (false) {
|
||||
|
||||
} else {
|
||||
import(/*{ params }*/);
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
// 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-function-return-
|
||||
name: nested function 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
function fn() {
|
||||
return import(/*{ params }*/);
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
// 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-function-
|
||||
name: nested function 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
function fn() {
|
||||
import(/*{ params }*/);
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
// 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-if-braceless-
|
||||
name: nested if 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
if (true) import(/*{ params }*/);
|
|
@ -0,0 +1,33 @@
|
|||
// 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-if-
|
||||
name: nested if 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
if (true) {
|
||||
import(/*{ params }*/);
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
// 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-labeled-block-
|
||||
name: nested block 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
{
|
||||
import(/*{ params }*/);
|
||||
};
|
|
@ -0,0 +1,35 @@
|
|||
// 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-while-
|
||||
name: nested while 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]].
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
let x = 0;
|
||||
while (!x) {
|
||||
x++;
|
||||
import(/*{ params }*/);
|
||||
};
|
|
@ -0,0 +1,21 @@
|
|||
// 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/top-level-
|
||||
name: top level syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
||||
ImportCall :
|
||||
import( AssignmentExpression )
|
||||
|
||||
flags: [module]
|
||||
features: [dynamic-import]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
import(/*{ params }*/);
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-arrow-assignment-expression-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-arrow-assignment-expression-
|
||||
name: nested arrow syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-arrow-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-arrow-
|
||||
name: nested arrow syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-arrow-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-arrow-
|
||||
name: nested arrow syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-arrow-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-arrow-
|
||||
name: nested arrow syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-arrow-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-arrow-
|
||||
name: nested arrow syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-block-labeled-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-block-labeled-
|
||||
name: nested block syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-block-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-block-
|
||||
name: nested block syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-do-while-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-do-while-
|
||||
name: nested do syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-do-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-do-
|
||||
name: nested do syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-else-braceless-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-else-braceless-
|
||||
name: nested else syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-else-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-else-
|
||||
name: nested else syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-function-return-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-function-return-
|
||||
name: nested function syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-function-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-function-
|
||||
name: nested function syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-if-braceless-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-if-braceless-
|
||||
name: nested if syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-if-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-if-
|
||||
name: nested if syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-labeled-block-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-labeled-block-
|
||||
name: nested block syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-nested-while-
|
||||
path: language/module-code/dynamic-import/syntax/valid/nested-while-
|
||||
name: nested while syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
|
@ -2,7 +2,7 @@
|
|||
// 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-top-level-
|
||||
path: language/module-code/dynamic-import/syntax/valid/top-level-
|
||||
name: top level syntax
|
||||
esid: sec-import-call-runtime-semantics-evaluation
|
||||
info: |
|
Loading…
Reference in New Issue