Generate tests

This commit is contained in:
Leo Balter 2018-10-24 16:11:41 -04:00 committed by Rick Waldron
parent 65df2bd23c
commit 51a0bad7d4
20 changed files with 748 additions and 0 deletions

View File

@ -0,0 +1,36 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-arrow-assignment-expression.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
let f = () => new import('');

View File

@ -0,0 +1,38 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-arrow.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
let f = () => {
new import('');
};

View File

@ -0,0 +1,38 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-await.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (nested in async arrow function, awaited)
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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
(async () => {
await new import('')
});

View File

@ -0,0 +1,36 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-return-await.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (nested in async arrow function, returned)
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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
(async () => await new import(''))

View File

@ -0,0 +1,38 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-async-function-await.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
async function f() {
await new import('');
}

View File

@ -0,0 +1,39 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-async-function.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
async function f() {
new import('');
}

View File

@ -0,0 +1,39 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-async-function-return-await.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
async function f() {
return await new import('');
}

View File

@ -0,0 +1,38 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-async-generator-await.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (nested in async generator, awaited)
esid: sec-import-call-runtime-semantics-evaluation
features: [dynamic-import, async-iteration]
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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
async function * f() {
await new import('')
}

View File

@ -0,0 +1,38 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-block-labeled.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (nested block 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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
label: {
new import('');
};

View File

@ -0,0 +1,38 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-block.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (nested block 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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
{
new import('');
};

View File

@ -0,0 +1,38 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-do-while.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (nested do while 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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
do {
new import('');
} while (false);

View File

@ -0,0 +1,38 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-else-braceless.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (nested else 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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
if (false) {
} else new import('');

View File

@ -0,0 +1,40 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-else.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (nested else 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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
if (false) {
} else {
new import('');
}

View File

@ -0,0 +1,38 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-function.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (nested function 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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
function fn() {
new import('');
}

View File

@ -0,0 +1,38 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-function-return.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (nested function 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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
function fn() {
return new import('');
}

View File

@ -0,0 +1,36 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-if-braceless.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (nested if 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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
if (true) new import('');

View File

@ -0,0 +1,38 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-if.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (nested if 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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
if (true) {
new import('');
}

View File

@ -0,0 +1,40 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-while.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (nested while 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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
let x = 0;
while (!x) {
x++;
new import('');
};

View File

@ -0,0 +1,38 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/nested-with.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (nested with syntax)
esid: sec-import-call-runtime-semantics-evaluation
features: [dynamic-import]
flags: [generated, noStrict]
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]].
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
with ({}) {
new import('');
}

View File

@ -0,0 +1,26 @@
// This file was procedurally generated from the following sources:
// - src/dynamic-import/no-new-call-expression.case
// - src/dynamic-import/syntax/invalid/top-level.template
/*---
description: ImportCall is a CallExpression, it can't be preceeded by the new keyword (top level syntax)
esid: sec-import-call-runtime-semantics-evaluation
features: [dynamic-import]
flags: [generated]
negative:
phase: parse
type: SyntaxError
info: |
ImportCall :
import( AssignmentExpression )
CallExpression:
ImportCall
ImportCall :
import( AssignmentExpression[+In, ?Yield] )
---*/
throw "Test262: This statement should not be evaluated.";
new import('');