From cd9ca65787c3776ddc66b8936d9b85c60a8d93f7 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Wed, 24 Oct 2018 18:18:02 -0400 Subject: [PATCH] Generate tests --- ...row-assignment-expression-no-rest-param.js | 41 +++++++++++++++++ .../invalid/nested-arrow-no-rest-param.js | 43 ++++++++++++++++++ ...sync-arrow-function-await-no-rest-param.js | 43 ++++++++++++++++++ ...row-function-return-await-no-rest-param.js | 41 +++++++++++++++++ ...sted-async-function-await-no-rest-param.js | 43 ++++++++++++++++++ .../nested-async-function-no-rest-param.js | 44 ++++++++++++++++++ ...ync-function-return-await-no-rest-param.js | 44 ++++++++++++++++++ .../nested-async-gen-await-no-rest-param.js | 43 ++++++++++++++++++ .../nested-block-labeled-no-rest-param.js | 43 ++++++++++++++++++ .../invalid/nested-block-no-rest-param.js | 43 ++++++++++++++++++ .../invalid/nested-do-while-no-rest-param.js | 43 ++++++++++++++++++ .../nested-else-braceless-no-rest-param.js | 43 ++++++++++++++++++ .../invalid/nested-else-no-rest-param.js | 45 +++++++++++++++++++ .../invalid/nested-function-no-rest-param.js | 43 ++++++++++++++++++ .../nested-function-return-no-rest-param.js | 43 ++++++++++++++++++ .../nested-if-braceless-no-rest-param.js | 41 +++++++++++++++++ .../syntax/invalid/nested-if-no-rest-param.js | 43 ++++++++++++++++++ .../invalid/nested-while-no-rest-param.js | 45 +++++++++++++++++++ .../invalid/nested-with-no-rest-param.js | 43 ++++++++++++++++++ .../syntax/invalid/top-level-no-rest-param.js | 31 +++++++++++++ 20 files changed, 848 insertions(+) create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-block-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-else-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-function-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-if-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-while-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-with-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/top-level-no-rest-param.js diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-no-rest-param.js new file mode 100644 index 0000000000..ec20e91cf8 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-no-rest-param.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-arrow-assignment-expression.template +/*--- +description: ImportCall is not extensible - no rest parameter (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. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +let f = () => import(...['']); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-no-rest-param.js new file mode 100644 index 0000000000..2969112f03 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-no-rest-param.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-arrow.template +/*--- +description: ImportCall is not extensible - no rest parameter (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. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +let f = () => { + import(...['']); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-no-rest-param.js new file mode 100644 index 0000000000..06e5d3e5e8 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-no-rest-param.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-await.template +/*--- +description: ImportCall is not extensible - no rest parameter (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]]. + + + ImportCall : + import( AssignmentExpression[+In, ?Yield] ) + + Forbidden Extensions + + - ImportCall must not be extended. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +(async () => { + await import(...['']) +}); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-no-rest-param.js new file mode 100644 index 0000000000..9d5af03790 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-no-rest-param.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-return-await.template +/*--- +description: ImportCall is not extensible - no rest parameter (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]]. + + + ImportCall : + import( AssignmentExpression[+In, ?Yield] ) + + Forbidden Extensions + + - ImportCall must not be extended. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +(async () => await import(...[''])) diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-no-rest-param.js new file mode 100644 index 0000000000..529fafbdbc --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-no-rest-param.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-async-function-await.template +/*--- +description: ImportCall is not extensible - no rest parameter (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. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +async function f() { + await import(...['']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-no-rest-param.js new file mode 100644 index 0000000000..05f1300570 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-no-rest-param.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-async-function.template +/*--- +description: ImportCall is not extensible - no rest parameter (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. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +async function f() { + import(...['']); +} + diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-no-rest-param.js new file mode 100644 index 0000000000..bb3ed5a51f --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-no-rest-param.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-async-function-return-await.template +/*--- +description: ImportCall is not extensible - no rest parameter (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. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +async function f() { + return await import(...['']); +} + diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-no-rest-param.js new file mode 100644 index 0000000000..7ebce283f8 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-no-rest-param.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-async-generator-await.template +/*--- +description: ImportCall is not extensible - no rest parameter (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]]. + + + ImportCall : + import( AssignmentExpression[+In, ?Yield] ) + + Forbidden Extensions + + - ImportCall must not be extended. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +async function * f() { + await import(...['']) +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-rest-param.js new file mode 100644 index 0000000000..ce0fb2c360 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-rest-param.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-block-labeled.template +/*--- +description: ImportCall is not extensible - no rest parameter (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]]. + + + ImportCall : + import( AssignmentExpression[+In, ?Yield] ) + + Forbidden Extensions + + - ImportCall must not be extended. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +label: { + import(...['']); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-no-rest-param.js new file mode 100644 index 0000000000..fc7dc51f45 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-no-rest-param.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-block.template +/*--- +description: ImportCall is not extensible - no rest parameter (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]]. + + + ImportCall : + import( AssignmentExpression[+In, ?Yield] ) + + Forbidden Extensions + + - ImportCall must not be extended. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +{ + import(...['']); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-no-rest-param.js new file mode 100644 index 0000000000..59e402bf04 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-no-rest-param.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-do-while.template +/*--- +description: ImportCall is not extensible - no rest parameter (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]]. + + + ImportCall : + import( AssignmentExpression[+In, ?Yield] ) + + Forbidden Extensions + + - ImportCall must not be extended. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +do { + import(...['']); +} while (false); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-no-rest-param.js new file mode 100644 index 0000000000..eb797a96dd --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-no-rest-param.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-else-braceless.template +/*--- +description: ImportCall is not extensible - no rest parameter (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]]. + + + ImportCall : + import( AssignmentExpression[+In, ?Yield] ) + + Forbidden Extensions + + - ImportCall must not be extended. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +if (false) { + +} else import(...['']); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-no-rest-param.js new file mode 100644 index 0000000000..5328de789f --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-no-rest-param.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-else.template +/*--- +description: ImportCall is not extensible - no rest parameter (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]]. + + + ImportCall : + import( AssignmentExpression[+In, ?Yield] ) + + Forbidden Extensions + + - ImportCall must not be extended. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +if (false) { + +} else { + import(...['']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-no-rest-param.js new file mode 100644 index 0000000000..2be167f481 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-no-rest-param.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-function.template +/*--- +description: ImportCall is not extensible - no rest parameter (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]]. + + + ImportCall : + import( AssignmentExpression[+In, ?Yield] ) + + Forbidden Extensions + + - ImportCall must not be extended. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +function fn() { + import(...['']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-no-rest-param.js new file mode 100644 index 0000000000..2a93a6e924 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-no-rest-param.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-function-return.template +/*--- +description: ImportCall is not extensible - no rest parameter (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]]. + + + ImportCall : + import( AssignmentExpression[+In, ?Yield] ) + + Forbidden Extensions + + - ImportCall must not be extended. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +function fn() { + return import(...['']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-no-rest-param.js new file mode 100644 index 0000000000..80f320ed03 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-no-rest-param.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-if-braceless.template +/*--- +description: ImportCall is not extensible - no rest parameter (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]]. + + + ImportCall : + import( AssignmentExpression[+In, ?Yield] ) + + Forbidden Extensions + + - ImportCall must not be extended. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +if (true) import(...['']); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-no-rest-param.js new file mode 100644 index 0000000000..ed467022f0 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-no-rest-param.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-if.template +/*--- +description: ImportCall is not extensible - no rest parameter (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]]. + + + ImportCall : + import( AssignmentExpression[+In, ?Yield] ) + + Forbidden Extensions + + - ImportCall must not be extended. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +if (true) { + import(...['']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-while-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-no-rest-param.js new file mode 100644 index 0000000000..1029668bf9 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-no-rest-param.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-while.template +/*--- +description: ImportCall is not extensible - no rest parameter (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]]. + + + ImportCall : + import( AssignmentExpression[+In, ?Yield] ) + + Forbidden Extensions + + - ImportCall must not be extended. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +let x = 0; +while (!x) { + x++; + import(...['']); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-no-rest-param.js new file mode 100644 index 0000000000..0489ac9ad4 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-no-rest-param.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-with.template +/*--- +description: ImportCall is not extensible - no rest parameter (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]]. + + + ImportCall : + import( AssignmentExpression[+In, ?Yield] ) + + Forbidden Extensions + + - ImportCall must not be extended. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +with ({}) { + import(...['']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/top-level-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/top-level-no-rest-param.js new file mode 100644 index 0000000000..7e308d480e --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/top-level-no-rest-param.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/no-rest-param.case +// - src/dynamic-import/syntax/invalid/top-level.template +/*--- +description: ImportCall is not extensible - no rest parameter (top level syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + + ImportCall : + import( AssignmentExpression[+In, ?Yield] ) + + Forbidden Extensions + + - ImportCall must not be extended. + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +---*/ + +throw "Test262: This statement should not be evaluated."; + +import(...['']);