diff --git a/src/dynamic-import/empty-args-early-error.case b/src/dynamic-import/empty-args-early-error.case index 85a880268dbd252dde01878ff00f44f6a06a722b..1d10aed93171224d2a96c8edc47cd246bdf2379c 100644 --- a/src/dynamic-import/empty-args-early-error.case +++ b/src/dynamic-import/empty-args-early-error.case @@ -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 diff --git a/src/dynamic-import/empty-str-arg.case b/src/dynamic-import/empty-str-arg.case index 9d0ae8fac23016d5d5eb11cefb301c83af3e76ff..0a83fe4979e3949244f00b602c6383c49985115a 100644 --- a/src/dynamic-import/empty-str-arg.case +++ b/src/dynamic-import/empty-str-arg.case @@ -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 diff --git a/src/dynamic-import/syntax/invalid/nested-arrow-assignment-expression.template b/src/dynamic-import/syntax/invalid/nested-arrow-assignment-expression.template new file mode 100644 index 0000000000000000000000000000000000000000..d7ba06d126d4e91049ab1d162272555d2ecd0467 --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-arrow-assignment-expression.template @@ -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 }*/); diff --git a/src/dynamic-import/syntax/invalid/nested-arrow.template b/src/dynamic-import/syntax/invalid/nested-arrow.template new file mode 100644 index 0000000000000000000000000000000000000000..87d81473acd432f0799501d05be8df1d85964854 --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-arrow.template @@ -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 }*/); +}; diff --git a/src/dynamic-import/syntax/invalid/nested-async-function-await.template b/src/dynamic-import/syntax/invalid/nested-async-function-await.template new file mode 100644 index 0000000000000000000000000000000000000000..36cf95be9773703f48fc5e07e2e654e0b1499d78 --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-async-function-await.template @@ -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 }*/); +} diff --git a/src/dynamic-import/syntax/invalid/nested-async-function-return-await.template b/src/dynamic-import/syntax/invalid/nested-async-function-return-await.template new file mode 100644 index 0000000000000000000000000000000000000000..6d3c320b6fc61050c647fa7b8cc8c4bc50d2b271 --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-async-function-return-await.template @@ -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 }*/); +} + diff --git a/src/dynamic-import/syntax/invalid/nested-async-function.template b/src/dynamic-import/syntax/invalid/nested-async-function.template new file mode 100644 index 0000000000000000000000000000000000000000..30cff1cd0b32b0f945dc984e376187f244611fca --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-async-function.template @@ -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 }*/); +} + diff --git a/src/dynamic-import/syntax/invalid/nested-block-labeled.template b/src/dynamic-import/syntax/invalid/nested-block-labeled.template new file mode 100644 index 0000000000000000000000000000000000000000..e4f3060026cb511c6d2f42245419cd76bc5d591b --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-block-labeled.template @@ -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 }*/); +}; diff --git a/src/dynamic-import/syntax/invalid/nested-block.template b/src/dynamic-import/syntax/invalid/nested-block.template new file mode 100644 index 0000000000000000000000000000000000000000..402289a11aae1582ee5182149f295af82cbbfb72 --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-block.template @@ -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 }*/); +}; diff --git a/src/dynamic-import/syntax/invalid/nested-do-while.template b/src/dynamic-import/syntax/invalid/nested-do-while.template new file mode 100644 index 0000000000000000000000000000000000000000..2e4e386913a3de03315a916580ab8f1d79419cac --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-do-while.template @@ -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); diff --git a/src/dynamic-import/syntax/invalid/nested-do.template b/src/dynamic-import/syntax/invalid/nested-do.template new file mode 100644 index 0000000000000000000000000000000000000000..0b02887b2179a2618f39cb7fe69d9f73a406a8bd --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-do.template @@ -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); diff --git a/src/dynamic-import/syntax/invalid/nested-else-braceless.template b/src/dynamic-import/syntax/invalid/nested-else-braceless.template new file mode 100644 index 0000000000000000000000000000000000000000..71ee8417d3ee114edf4dace0f234fce0c04e86fc --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-else-braceless.template @@ -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 }*/); diff --git a/src/dynamic-import/syntax/invalid/nested-else.template b/src/dynamic-import/syntax/invalid/nested-else.template new file mode 100644 index 0000000000000000000000000000000000000000..09f8144185d70bec5cf13c549ce3b6058ee0b9ab --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-else.template @@ -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 }*/); +} diff --git a/src/dynamic-import/syntax/invalid/nested-function-return.template b/src/dynamic-import/syntax/invalid/nested-function-return.template new file mode 100644 index 0000000000000000000000000000000000000000..855b080e11cfe179c3a77970781747ba0856bda1 --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-function-return.template @@ -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 }*/); +} diff --git a/src/dynamic-import/syntax/invalid/nested-function.template b/src/dynamic-import/syntax/invalid/nested-function.template new file mode 100644 index 0000000000000000000000000000000000000000..595ef5f31c64f2259ce3637b89d7869e9a04e715 --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-function.template @@ -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 }*/); +} diff --git a/src/dynamic-import/syntax/invalid/nested-if-braceless.template b/src/dynamic-import/syntax/invalid/nested-if-braceless.template new file mode 100644 index 0000000000000000000000000000000000000000..5855636f365a99b676542a68fd5158c1be7c77da --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-if-braceless.template @@ -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 }*/); diff --git a/src/dynamic-import/syntax/invalid/nested-if.template b/src/dynamic-import/syntax/invalid/nested-if.template new file mode 100644 index 0000000000000000000000000000000000000000..365e293d89ae040e7ab2cad477a364811ae87ea3 --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-if.template @@ -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 }*/); +} diff --git a/src/dynamic-import/syntax/invalid/nested-labeled.template b/src/dynamic-import/syntax/invalid/nested-labeled.template new file mode 100644 index 0000000000000000000000000000000000000000..bfaf1267c7d3b49e50259b9e4b4d700e819d965c --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-labeled.template @@ -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 }*/); +}; diff --git a/src/dynamic-import/syntax/invalid/nested-while.template b/src/dynamic-import/syntax/invalid/nested-while.template new file mode 100644 index 0000000000000000000000000000000000000000..33deb3305d34df06dc0da1ece6cadeb32a178615 --- /dev/null +++ b/src/dynamic-import/syntax/invalid/nested-while.template @@ -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 }*/); +}; diff --git a/src/dynamic-import/syntax/invalid/top-level.template b/src/dynamic-import/syntax/invalid/top-level.template new file mode 100644 index 0000000000000000000000000000000000000000..400baa31a4690c9e6197f23d2a355982d7dcf7f0 --- /dev/null +++ b/src/dynamic-import/syntax/invalid/top-level.template @@ -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 }*/); diff --git a/src/dynamic-import/syntax/nested-arrow-assignment-expression.template b/src/dynamic-import/syntax/valid/nested-arrow-assignment-expression.template similarity index 91% rename from src/dynamic-import/syntax/nested-arrow-assignment-expression.template rename to src/dynamic-import/syntax/valid/nested-arrow-assignment-expression.template index 798c194643ea7cc34466535ee448ed02c5feeffc..054ee113f1d8db10814ef072c934460e5a506feb 100644 --- a/src/dynamic-import/syntax/nested-arrow-assignment-expression.template +++ b/src/dynamic-import/syntax/valid/nested-arrow-assignment-expression.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-arrow.template b/src/dynamic-import/syntax/valid/nested-arrow.template similarity index 93% rename from src/dynamic-import/syntax/nested-arrow.template rename to src/dynamic-import/syntax/valid/nested-arrow.template index 22319216003e78f38624919340e5a3f6ca6c80e9..a30d99b7f102decf79dcc530d6592e58aa1af6b2 100644 --- a/src/dynamic-import/syntax/nested-arrow.template +++ b/src/dynamic-import/syntax/valid/nested-arrow.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-async-function-await.template b/src/dynamic-import/syntax/valid/nested-async-function-await.template similarity index 93% rename from src/dynamic-import/syntax/nested-async-function-await.template rename to src/dynamic-import/syntax/valid/nested-async-function-await.template index 29244230c6ea450157aa0b4375913314a37f1b68..4fbcf30651db1c791e368b826d5aea414ec0827b 100644 --- a/src/dynamic-import/syntax/nested-async-function-await.template +++ b/src/dynamic-import/syntax/valid/nested-async-function-await.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-async-function-return-await.template b/src/dynamic-import/syntax/valid/nested-async-function-return-await.template similarity index 93% rename from src/dynamic-import/syntax/nested-async-function-return-await.template rename to src/dynamic-import/syntax/valid/nested-async-function-return-await.template index 5f602950372b3a14802abb82e64efc37cc7bfa41..f693b00d2b3a6f60f1d38b7a7c356c71df0c5442 100644 --- a/src/dynamic-import/syntax/nested-async-function-return-await.template +++ b/src/dynamic-import/syntax/valid/nested-async-function-return-await.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-async-function.template b/src/dynamic-import/syntax/valid/nested-async-function.template similarity index 93% rename from src/dynamic-import/syntax/nested-async-function.template rename to src/dynamic-import/syntax/valid/nested-async-function.template index 263bd0d4acc79f1ff6c986ebc969cf4cfb1dd770..003d6b36b7466f068ac41473bf011a24b195273e 100644 --- a/src/dynamic-import/syntax/nested-async-function.template +++ b/src/dynamic-import/syntax/valid/nested-async-function.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-block-labeled.template b/src/dynamic-import/syntax/valid/nested-block-labeled.template similarity index 92% rename from src/dynamic-import/syntax/nested-block-labeled.template rename to src/dynamic-import/syntax/valid/nested-block-labeled.template index 66b595a2f4d1136a6b2566f70634d47f0731b453..d61a3660ab9702eed06af7216721bd76618a980c 100644 --- a/src/dynamic-import/syntax/nested-block-labeled.template +++ b/src/dynamic-import/syntax/valid/nested-block-labeled.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-block.template b/src/dynamic-import/syntax/valid/nested-block.template similarity index 93% rename from src/dynamic-import/syntax/nested-block.template rename to src/dynamic-import/syntax/valid/nested-block.template index 4f4a5f0b0adad745619677eadac9dd31fe2d7fbd..d4426718be773ace648a9f33000de457aa4eba68 100644 --- a/src/dynamic-import/syntax/nested-block.template +++ b/src/dynamic-import/syntax/valid/nested-block.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-do-while.template b/src/dynamic-import/syntax/valid/nested-do-while.template similarity index 93% rename from src/dynamic-import/syntax/nested-do-while.template rename to src/dynamic-import/syntax/valid/nested-do-while.template index 49c36d243f269de696fa1ce138fae35ef3ed09dd..6f45278a4e23f1c27779f36878a20b60bc042fca 100644 --- a/src/dynamic-import/syntax/nested-do-while.template +++ b/src/dynamic-import/syntax/valid/nested-do-while.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-do.template b/src/dynamic-import/syntax/valid/nested-do.template similarity index 93% rename from src/dynamic-import/syntax/nested-do.template rename to src/dynamic-import/syntax/valid/nested-do.template index 7ca410f47114f55e817dfcb49f52298c0d9af674..ee1c149d7040ad789a0e0f90f01e8dfa529b3d36 100644 --- a/src/dynamic-import/syntax/nested-do.template +++ b/src/dynamic-import/syntax/valid/nested-do.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-else-braceless.template b/src/dynamic-import/syntax/valid/nested-else-braceless.template similarity index 92% rename from src/dynamic-import/syntax/nested-else-braceless.template rename to src/dynamic-import/syntax/valid/nested-else-braceless.template index ad7ff059475bcb7dc0c8bce0a364a27b22f65e9c..b020744eab9db2db52b3b9b3a54c4c3bb7528fb3 100644 --- a/src/dynamic-import/syntax/nested-else-braceless.template +++ b/src/dynamic-import/syntax/valid/nested-else-braceless.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-else.template b/src/dynamic-import/syntax/valid/nested-else.template similarity index 93% rename from src/dynamic-import/syntax/nested-else.template rename to src/dynamic-import/syntax/valid/nested-else.template index 04552060a7277c855a8355f21fd79b930c229999..3189049b788beca064a6e35b6d652856573e480f 100644 --- a/src/dynamic-import/syntax/nested-else.template +++ b/src/dynamic-import/syntax/valid/nested-else.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-function-return.template b/src/dynamic-import/syntax/valid/nested-function-return.template similarity index 92% rename from src/dynamic-import/syntax/nested-function-return.template rename to src/dynamic-import/syntax/valid/nested-function-return.template index 9cc9b6ed3aa1ddd15eddada2db9be6eae5c78aa1..640468fb3495644c82a12cb15f8da2d599a5995d 100644 --- a/src/dynamic-import/syntax/nested-function-return.template +++ b/src/dynamic-import/syntax/valid/nested-function-return.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-function.template b/src/dynamic-import/syntax/valid/nested-function.template similarity index 93% rename from src/dynamic-import/syntax/nested-function.template rename to src/dynamic-import/syntax/valid/nested-function.template index 44712eae6e0ffd4f39a6042979eb812ed7f31b87..7a599c4d3eafd16c1d3484931bb6494d6b87d07c 100644 --- a/src/dynamic-import/syntax/nested-function.template +++ b/src/dynamic-import/syntax/valid/nested-function.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-if-braceless.template b/src/dynamic-import/syntax/valid/nested-if-braceless.template similarity index 92% rename from src/dynamic-import/syntax/nested-if-braceless.template rename to src/dynamic-import/syntax/valid/nested-if-braceless.template index a900189b5d147284cd509bb59adaeaf3fcc2d252..93d067376104e25c2ffa60e6f1667c1e8c81bd37 100644 --- a/src/dynamic-import/syntax/nested-if-braceless.template +++ b/src/dynamic-import/syntax/valid/nested-if-braceless.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-if.template b/src/dynamic-import/syntax/valid/nested-if.template similarity index 93% rename from src/dynamic-import/syntax/nested-if.template rename to src/dynamic-import/syntax/valid/nested-if.template index 95dffd11595a1781d79372eac8362a0918884bd0..a58c649ba5c5d3dbb7d19cb66df8368efd8688c3 100644 --- a/src/dynamic-import/syntax/nested-if.template +++ b/src/dynamic-import/syntax/valid/nested-if.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-labeled.template b/src/dynamic-import/syntax/valid/nested-labeled.template similarity index 92% rename from src/dynamic-import/syntax/nested-labeled.template rename to src/dynamic-import/syntax/valid/nested-labeled.template index 0b34bf952e851a4aee27ba9fedefaadcd473633a..c58078c523f373b3c8409df83a3c2161b670dbe8 100644 --- a/src/dynamic-import/syntax/nested-labeled.template +++ b/src/dynamic-import/syntax/valid/nested-labeled.template @@ -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: | diff --git a/src/dynamic-import/syntax/nested-while.template b/src/dynamic-import/syntax/valid/nested-while.template similarity index 93% rename from src/dynamic-import/syntax/nested-while.template rename to src/dynamic-import/syntax/valid/nested-while.template index 463935743118d8b542a80d1c5cf7f23e9ba52d25..6a4c4ab8148c289041e7616340a2ff81d9a443fa 100644 --- a/src/dynamic-import/syntax/nested-while.template +++ b/src/dynamic-import/syntax/valid/nested-while.template @@ -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: | diff --git a/src/dynamic-import/syntax/top-level.template b/src/dynamic-import/syntax/valid/top-level.template similarity index 86% rename from src/dynamic-import/syntax/top-level.template rename to src/dynamic-import/syntax/valid/top-level.template index f2f43a6a1a3ea0aad60e50876147c4396b890214..6782aee0bd53dd8dca11ba4001d1d5e135bacfe7 100644 --- a/src/dynamic-import/syntax/top-level.template +++ b/src/dynamic-import/syntax/valid/top-level.template @@ -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: |