diff --git a/features.txt b/features.txt index c254f1c6c50187e168864bcbf6380e547aa0cba9..63bd7d329280efadcbea6f08b75be3c806fde2d2 100644 --- a/features.txt +++ b/features.txt @@ -30,6 +30,10 @@ class-static-methods-private # https://github.com/tc39/proposal-private-methods class-methods-private +# Dynamic Import +# https://github.com/tc39/proposal-dynamic-import +dynamic-import + # Promise.prototype.finally # https://github.com/tc39/proposal-promise-finally Promise.prototype.finally diff --git a/src/dynamic-import/catch/nested-arrow.template b/src/dynamic-import/catch/nested-arrow.template new file mode 100644 index 0000000000000000000000000000000000000000..366ffdcd6d41878bb7e8672e18a5fab14ea771b3 --- /dev/null +++ b/src/dynamic-import/catch/nested-arrow.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/catch-nested-arrow-import-catch- +name: nested arrow +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] +---*/ + +let f = () => { + import(/*{ params }*/).catch(error => { + + /*{ body }*/ + + }).then($DONE, $DONE); +}; + +f(); diff --git a/src/dynamic-import/catch/nested-async-function-await.template b/src/dynamic-import/catch/nested-async-function-await.template new file mode 100644 index 0000000000000000000000000000000000000000..d30e585ad86cfbd123613fb97f9a17613e7cfa5f --- /dev/null +++ b/src/dynamic-import/catch/nested-async-function-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/catch-nested-async-function-await- +name: nested in async function, awaited +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] +---*/ + +async function f() { + await import(/*{ params }*/).catch(error => { + + /*{ body }*/ + + }).then($DONE, $DONE); +} + +f(); diff --git a/src/dynamic-import/catch/nested-async-function-return-await.template b/src/dynamic-import/catch/nested-async-function-return-await.template new file mode 100644 index 0000000000000000000000000000000000000000..c1faa66f1268b9f9d3b06bc0ed9912ec53d745cb --- /dev/null +++ b/src/dynamic-import/catch/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/catch-nested-async-function-return-await- +name: nested in async function, returns awaited +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] +---*/ + +async function f() { + return await import(/*{ params }*/).catch(error => { + + /*{ body }*/ + + }).then($DONE, $DONE); +} + +f(); diff --git a/src/dynamic-import/catch/nested-async-function.template b/src/dynamic-import/catch/nested-async-function.template new file mode 100644 index 0000000000000000000000000000000000000000..cad3c146fab9ab3f84a9a7ee987256c9fcd3999f --- /dev/null +++ b/src/dynamic-import/catch/nested-async-function.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/catch-nested-async-function- +name: nested in async function +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] +---*/ + +async function f() { + import(/*{ params }*/).catch(error => { + + /*{ body }*/ + + }).then($DONE, $DONE); +} + +f(); + diff --git a/src/dynamic-import/catch/nested-block-labeled.template b/src/dynamic-import/catch/nested-block-labeled.template new file mode 100644 index 0000000000000000000000000000000000000000..22f9a6acda7ab22fa3641f55ffdb7beda154ade3 --- /dev/null +++ b/src/dynamic-import/catch/nested-block-labeled.template @@ -0,0 +1,32 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +path: language/module-code/dynamic-import/catch-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] +---*/ + +label: { + import(/*{ params }*/).catch(error => { + + /*{ body }*/ + + }).then($DONE, $DONE); +}; diff --git a/src/dynamic-import/catch/nested-block.template b/src/dynamic-import/catch/nested-block.template new file mode 100644 index 0000000000000000000000000000000000000000..f8c07ed8d64b749afc994c47bb5a97a3f7a0fef6 --- /dev/null +++ b/src/dynamic-import/catch/nested-block.template @@ -0,0 +1,32 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +path: language/module-code/dynamic-import/catch-nested-block-import-catch- +name: nested block +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] +---*/ + +{ + import(/*{ params }*/).catch(error => { + + /*{ body }*/ + + }).then($DONE, $DONE); +}; diff --git a/src/dynamic-import/catch/nested-do-while.template b/src/dynamic-import/catch/nested-do-while.template new file mode 100644 index 0000000000000000000000000000000000000000..00a9fb26b1516751da00075ab07866c184451c9f --- /dev/null +++ b/src/dynamic-import/catch/nested-do-while.template @@ -0,0 +1,32 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +path: language/module-code/dynamic-import/catch-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] +---*/ + +do { + import(/*{ params }*/).catch(error => { + + /*{ body }*/ + + }).then($DONE, $DONE); +} while (false); diff --git a/src/dynamic-import/catch/nested-do.template b/src/dynamic-import/catch/nested-do.template new file mode 100644 index 0000000000000000000000000000000000000000..0fdec9c52e8346ac64879524c900740eadd76aed --- /dev/null +++ b/src/dynamic-import/catch/nested-do.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/catch-nested-do-import-catch- +name: nested do +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] +---*/ + +let x = 0; +do { + x++; + import(/*{ params }*/).catch(error => { + + /*{ body }*/ + + }).then($DONE, $DONE); +} while (!x); diff --git a/src/dynamic-import/catch/nested-else.template b/src/dynamic-import/catch/nested-else.template new file mode 100644 index 0000000000000000000000000000000000000000..332187b12445a2ac64ba65dd5f6a3ed2e43c5589 --- /dev/null +++ b/src/dynamic-import/catch/nested-else.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/catch-nested-else-import-catch- +name: nested else +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] +---*/ + +if (false) { + +} else { + import(/*{ params }*/).catch(error => { + + /*{ body }*/ + + }).then($DONE, $DONE); +} diff --git a/src/dynamic-import/catch/nested-function.template b/src/dynamic-import/catch/nested-function.template new file mode 100644 index 0000000000000000000000000000000000000000..8738d0951c01d8f5c4edff38f210ac2ae626ac09 --- /dev/null +++ b/src/dynamic-import/catch/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/catch-nested-function-import-catch- +name: nested function +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] +---*/ + +function f() { + import(/*{ params }*/).catch(error => { + + /*{ body }*/ + + }).then($DONE, $DONE); +} +f(); diff --git a/src/dynamic-import/catch/nested-if.template b/src/dynamic-import/catch/nested-if.template new file mode 100644 index 0000000000000000000000000000000000000000..a3ddc2c3d38b5b8fd721c85b735c0480ea787968 --- /dev/null +++ b/src/dynamic-import/catch/nested-if.template @@ -0,0 +1,32 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +path: language/module-code/dynamic-import/catch-nested-if-import-catch- +name: nested if +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] +---*/ + +if (true) { + import(/*{ params }*/).catch(error => { + + /*{ body }*/ + + }).then($DONE, $DONE); +} diff --git a/src/dynamic-import/catch/nested-labeled-block.template b/src/dynamic-import/catch/nested-labeled-block.template new file mode 100644 index 0000000000000000000000000000000000000000..deb4dcc283667994858d55c95dc842637666129f --- /dev/null +++ b/src/dynamic-import/catch/nested-labeled-block.template @@ -0,0 +1,32 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +path: language/module-code/dynamic-import/catch-nested-labeled-block-import-catch- +name: nested labeled block +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] +---*/ + +{ + import(/*{ params }*/).catch(error => { + + /*{ body }*/ + + }).then($DONE, $DONE); +}; diff --git a/src/dynamic-import/catch/nested-while.template b/src/dynamic-import/catch/nested-while.template new file mode 100644 index 0000000000000000000000000000000000000000..63aeedabc999c062367caf47313fad6f3c08be50 --- /dev/null +++ b/src/dynamic-import/catch/nested-while.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/catch-nested-while-import-catch- +name: nested while +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] +---*/ + +let x = 0; +while (!x) { + x++; + import(/*{ params }*/).catch(error => { + + /*{ body }*/ + + }).then($DONE, $DONE); +}; diff --git a/src/dynamic-import/catch/top-level.template b/src/dynamic-import/catch/top-level.template new file mode 100644 index 0000000000000000000000000000000000000000..44b6734fe230653568e9d4255330cd4a433f203d --- /dev/null +++ b/src/dynamic-import/catch/top-level.template @@ -0,0 +1,30 @@ +// 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/catch-top-level-import-catch- +name: top level +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] +---*/ + +import(/*{ params }*/).catch(error => { + + /*{ body }*/ + +}).then($DONE, $DONE); diff --git a/src/dynamic-import/default/nested-arrow-assignment-expression.template b/src/dynamic-import/default/nested-arrow-assignment-expression.template new file mode 100644 index 0000000000000000000000000000000000000000..91670f32a1008cae057db489e1d73d7588475927 --- /dev/null +++ b/src/dynamic-import/default/nested-arrow-assignment-expression.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/nested-arrow-assignment-expression- +name: nested arrow +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] +---*/ + +let f = () => import(/*{ params }*/).then(imported => { + + /*{ body }*/ + +}); + + +f().then($DONE, $DONE).catch($DONE); diff --git a/src/dynamic-import/default/nested-arrow.template b/src/dynamic-import/default/nested-arrow.template new file mode 100644 index 0000000000000000000000000000000000000000..300a417f3d2dab0825f8e65ee5d3e8db179984c3 --- /dev/null +++ b/src/dynamic-import/default/nested-arrow.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/nested-arrow-import-then- +name: nested arrow +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] +---*/ + +let f = () => { + return import(/*{ params }*/).then(imported => { + + /*{ body }*/ + + }).then($DONE, $DONE).catch($DONE); +}; + +f(); + diff --git a/src/dynamic-import/default/nested-async-function-await.template b/src/dynamic-import/default/nested-async-function-await.template new file mode 100644 index 0000000000000000000000000000000000000000..2c6acf5fc044ca2854856636ae28cd667042738b --- /dev/null +++ b/src/dynamic-import/default/nested-async-function-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/nested-async-function-await- +name: nested in async function, awaited +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] +---*/ + +async function f() { + await import(/*{ params }*/).then(imported => { + + /*{ body }*/ + + }).then($DONE, $DONE).catch($DONE); +} + +f(); diff --git a/src/dynamic-import/default/nested-async-function-return-await.template b/src/dynamic-import/default/nested-async-function-return-await.template new file mode 100644 index 0000000000000000000000000000000000000000..bc0b97f8026ab0fb16b4c75df08760b7bc2c7deb --- /dev/null +++ b/src/dynamic-import/default/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/nested-async-function-return-await- +name: nested in async function, returns awaited +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] +---*/ + +async function f() { + return await import(/*{ params }*/).then(imported => { + + /*{ body }*/ + + }).then($DONE, $DONE).catch($DONE); +} + +f(); diff --git a/src/dynamic-import/default/nested-async-function.template b/src/dynamic-import/default/nested-async-function.template new file mode 100644 index 0000000000000000000000000000000000000000..8f411529e2e0daa771e8e73a70c66a1ce7c32cf8 --- /dev/null +++ b/src/dynamic-import/default/nested-async-function.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/nested-async-function- +name: nested in async function +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] +---*/ + +async function f() { + import(/*{ params }*/).then(imported => { + + /*{ body }*/ + + }).then($DONE, $DONE).catch($DONE); +} + +f(); + diff --git a/src/dynamic-import/default/nested-block-labeled.template b/src/dynamic-import/default/nested-block-labeled.template new file mode 100644 index 0000000000000000000000000000000000000000..a08eb8c16742f1daaca7f252584ad65c40fcaf09 --- /dev/null +++ b/src/dynamic-import/default/nested-block-labeled.template @@ -0,0 +1,32 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +path: language/module-code/dynamic-import/syntax-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] +---*/ + +label: { + import(/*{ params }*/).then(imported => { + + /*{ body }*/ + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/src/dynamic-import/default/nested-block.template b/src/dynamic-import/default/nested-block.template new file mode 100644 index 0000000000000000000000000000000000000000..439d2c1632334bb92b83498b6ef2f5bcc3df4693 --- /dev/null +++ b/src/dynamic-import/default/nested-block.template @@ -0,0 +1,32 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +path: language/module-code/dynamic-import/nested-block-import-then- +name: nested block +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] +---*/ + +{ + import(/*{ params }*/).then(imported => { + + /*{ body }*/ + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/src/dynamic-import/default/nested-do-while.template b/src/dynamic-import/default/nested-do-while.template new file mode 100644 index 0000000000000000000000000000000000000000..ebe232a3ce061ce5ab0aa876191a90036ebb1c24 --- /dev/null +++ b/src/dynamic-import/default/nested-do-while.template @@ -0,0 +1,32 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +path: language/module-code/dynamic-import/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] +---*/ + +do { + import(/*{ params }*/).then(imported => { + + /*{ body }*/ + + }).then($DONE, $DONE).catch($DONE); +} while (false); diff --git a/src/dynamic-import/default/nested-do.template b/src/dynamic-import/default/nested-do.template new file mode 100644 index 0000000000000000000000000000000000000000..d6a19aae8d3984f8c7fa487374421424f5f00b05 --- /dev/null +++ b/src/dynamic-import/default/nested-do.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/nested-do-import-then- +name: nested do +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] +---*/ + +let x = 0; +do { + x++; + import(/*{ params }*/).then(imported => { + + /*{ body }*/ + + }).then($DONE, $DONE).catch($DONE); +} while (!x); diff --git a/src/dynamic-import/default/nested-else.template b/src/dynamic-import/default/nested-else.template new file mode 100644 index 0000000000000000000000000000000000000000..da093ff2220537558e39de414504e16880e13699 --- /dev/null +++ b/src/dynamic-import/default/nested-else.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/nested-else-import-then- +name: nested else +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] +---*/ + +if (false) { + +} else { + import(/*{ params }*/).then(imported => { + + /*{ body }*/ + + }).then($DONE, $DONE).catch($DONE); +} diff --git a/src/dynamic-import/default/nested-function.template b/src/dynamic-import/default/nested-function.template new file mode 100644 index 0000000000000000000000000000000000000000..2374db50c8aa389bac66e3f5ff18c6247e6ed6d7 --- /dev/null +++ b/src/dynamic-import/default/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/nested-function-import-then- +name: nested function +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] +---*/ + +function f() { + import(/*{ params }*/).then(imported => { + + /*{ body }*/ + + }).then($DONE, $DONE).catch($DONE); +} +f(); diff --git a/src/dynamic-import/default/nested-if-braceless.template b/src/dynamic-import/default/nested-if-braceless.template new file mode 100644 index 0000000000000000000000000000000000000000..c5eb7fa198773c9707560f061a9ecaeda92a2410 --- /dev/null +++ b/src/dynamic-import/default/nested-if-braceless.template @@ -0,0 +1,26 @@ +// 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/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] +---*/ + +if (true) import(/*{ params }*/); diff --git a/src/dynamic-import/default/nested-if.template b/src/dynamic-import/default/nested-if.template new file mode 100644 index 0000000000000000000000000000000000000000..42cb23a071d0f2fd869afc7eb7e7c75d10e058be --- /dev/null +++ b/src/dynamic-import/default/nested-if.template @@ -0,0 +1,32 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +path: language/module-code/dynamic-import/nested-if-import-then- +name: nested if +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] +---*/ + +if (true) { + import(/*{ params }*/).then(imported => { + + /*{ body }*/ + + }).then($DONE, $DONE).catch($DONE); +} diff --git a/src/dynamic-import/default/nested-labeled-block.template b/src/dynamic-import/default/nested-labeled-block.template new file mode 100644 index 0000000000000000000000000000000000000000..7888a99ae82b6415d9f07ec46fec5ce7c8be8616 --- /dev/null +++ b/src/dynamic-import/default/nested-labeled-block.template @@ -0,0 +1,32 @@ +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +path: language/module-code/dynamic-import/nested-labeled-block-import-then- +name: nested block +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] +---*/ + +{ + import(/*{ params }*/).then(imported => { + + /*{ body }*/ + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/src/dynamic-import/default/nested-while.template b/src/dynamic-import/default/nested-while.template new file mode 100644 index 0000000000000000000000000000000000000000..77573a431d15fc0ed7f98f619dc236c626d950fc --- /dev/null +++ b/src/dynamic-import/default/nested-while.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/nested-while-import-then- +name: nested while +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] +---*/ + +let x = 0; +while (!x) { + x++; + import(/*{ params }*/).then(imported => { + + /*{ body }*/ + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/src/dynamic-import/default/top-level.template b/src/dynamic-import/default/top-level.template new file mode 100644 index 0000000000000000000000000000000000000000..c0d7a1d7045ce8fae97709b70e469e5689cdeef6 --- /dev/null +++ b/src/dynamic-import/default/top-level.template @@ -0,0 +1,30 @@ +// 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/top-level-import-then- +name: top level +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] +---*/ + +import(/*{ params }*/).then(imported => { + + /*{ body }*/ + +}).then($DONE, $DONE).catch($DONE); diff --git a/src/dynamic-import/empty-args-early-error.case b/src/dynamic-import/empty-args-early-error.case new file mode 100644 index 0000000000000000000000000000000000000000..85a880268dbd252dde01878ff00f44f6a06a722b --- /dev/null +++ b/src/dynamic-import/empty-args-early-error.case @@ -0,0 +1,20 @@ +// 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. +/*--- +desc: It's a SyntaxError if AssignmentExpression is omitted +template: syntax +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import() + +---*/ +//- setup +throw "Test262: This statement should not be evaluated."; +//- params + +//- teardown +/* The params region intentionally empty */ diff --git a/src/dynamic-import/empty-str-arg.case b/src/dynamic-import/empty-str-arg.case new file mode 100644 index 0000000000000000000000000000000000000000..9d0ae8fac23016d5d5eb11cefb301c83af3e76ff --- /dev/null +++ b/src/dynamic-import/empty-str-arg.case @@ -0,0 +1,10 @@ +// 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. +/*--- +desc: Calling import('') +template: syntax +---*/ + +//- params +'' diff --git a/src/dynamic-import/eval-gtbdng-indirect-update-as.case b/src/dynamic-import/eval-gtbdng-indirect-update-as.case new file mode 100644 index 0000000000000000000000000000000000000000..d06375585548d83eab0fdd888821e282e70179b1 --- /dev/null +++ b/src/dynamic-import/eval-gtbdng-indirect-update-as.case @@ -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. +/*--- +desc: > + Modifications to named bindings that occur after dependency has been + evaluated are reflected in local binding +info: | + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). +includes: [fnGlobalObject.js] +template: default +flags: [async] +---*/ + +//- params +'./eval-gtbndng-indirect-update-as_FIXTURE.js' +//- body +assert.sameValue(imported.x, 1); + +// This function is exposed on the global scope (instead of as an imported +// binding) in order to avoid possible false positives from assuming correct +// behavior of the semantics under test. +fnGlobalObject().test262update(); + +assert.sameValue(imported.x, 2); diff --git a/src/dynamic-import/eval-gtbdng-indirect-update-dflt.case b/src/dynamic-import/eval-gtbdng-indirect-update-dflt.case new file mode 100644 index 0000000000000000000000000000000000000000..056e8e45ba39175f584e86d414598850e60d1e98 --- /dev/null +++ b/src/dynamic-import/eval-gtbdng-indirect-update-dflt.case @@ -0,0 +1,28 @@ +// 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. +/*--- +desc: > + Modifications to default binding that occur after dependency has been + evaluated are reflected in local binding +info: | + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +template: default +flags: [async] +---*/ + +//- params +'./eval-gtbndng-indirect-update-dflt_FIXTURE.js' +//- body +assert.sameValue(imported.default(), 1); +assert.sameValue(imported.default, 2); diff --git a/src/dynamic-import/eval-gtbndng-indirect-update.case b/src/dynamic-import/eval-gtbndng-indirect-update.case new file mode 100644 index 0000000000000000000000000000000000000000..c6862d3b76de7b684445c00ff0dd73c709bf68fa --- /dev/null +++ b/src/dynamic-import/eval-gtbndng-indirect-update.case @@ -0,0 +1,36 @@ +// 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. +/*--- +desc: > + Modifications to named bindings that occur after dependency has been + evaluated are reflected in local binding +esid: sec-moduleevaluation +info: | + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). +includes: [fnGlobalObject.js] +template: default +flags: [async] +---*/ + +//- params +'./eval-gtbndng-indirect-update_FIXTURE.js' +//- body +assert.sameValue(imported.x, 1); + +// This function is exposed on the global scope (instead of as an exported +// binding) in order to avoid possible false positives from assuming correct +// behavior of the semantics under test. +fnGlobalObject().test262update(); + +assert.sameValue(imported.x, 2); + diff --git a/src/dynamic-import/eval-rqstd-abrupt-typeerror.case b/src/dynamic-import/eval-rqstd-abrupt-typeerror.case new file mode 100644 index 0000000000000000000000000000000000000000..0629d59929044b5f1fde18e98e7051d9ab0b85ad --- /dev/null +++ b/src/dynamic-import/eval-rqstd-abrupt-typeerror.case @@ -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. +/*--- +desc: > + Abrupt completion during module evaluation precludes further evaluation +esid: sec-moduleevaluation +info: | + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). +template: catch +flags: [async] +---*/ + +//- params +'./eval-rqstd-abrupt-err-type_FIXTURE.js' +//- body +assert.sameValue(error.name, 'TypeError'); diff --git a/src/dynamic-import/eval-rqstd-abrupt-urierror.case b/src/dynamic-import/eval-rqstd-abrupt-urierror.case new file mode 100644 index 0000000000000000000000000000000000000000..1930388b55e6bdc57b3bc215f259dca81101cd6d --- /dev/null +++ b/src/dynamic-import/eval-rqstd-abrupt-urierror.case @@ -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. +/*--- +desc: > + Abrupt completion during module evaluation precludes further evaluation +esid: sec-moduleevaluation +info: | + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). +template: catch +flags: [async] +---*/ + +//- params +'./eval-rqstd-abrupt-err-uri_FIXTURE.js' +//- body +assert.sameValue(error.name, 'URIError'); diff --git a/src/dynamic-import/instn-iee-err-ambiguous-import.case b/src/dynamic-import/instn-iee-err-ambiguous-import.case new file mode 100644 index 0000000000000000000000000000000000000000..415643b95679ba4111cff943aa7ac325f841b0ea --- /dev/null +++ b/src/dynamic-import/instn-iee-err-ambiguous-import.case @@ -0,0 +1,41 @@ +// 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. +/*--- +desc: IndirectExportEntries validation - ambiguous imported bindings +esid: sec-moduledeclarationinstantiation +info: | + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". +template: catch +flags: [async] +---*/ + +//- params +'./instn-iee-err-ambiguous-export.js' +//- body +assert.sameValue(error.name, 'SyntaxError'); diff --git a/src/dynamic-import/instn-iee-err-circular.case b/src/dynamic-import/instn-iee-err-circular.case new file mode 100644 index 0000000000000000000000000000000000000000..61d5ddbdabd9defb14a7bd3e63cbd3e8d644b8d9 --- /dev/null +++ b/src/dynamic-import/instn-iee-err-circular.case @@ -0,0 +1,30 @@ +// 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. +/*--- +desc: IndirectExportEntries validation - circular imported bindings +esid: sec-moduledeclarationinstantiation +info: | + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: + a. If module and r.[[Module]] are the same Module Record and + SameValue(exportName, r.[[ExportName]]) is true, then + i. Assert: this is a circular import request. + ii. Return null. +template: catch +flags: [async] +---*/ + +//- params +'./instn-iee-err-circular-1_FIXTURE.js' +//- body +assert.sameValue(error.name, 'SyntaxError'); diff --git a/src/dynamic-import/instn-iee-err-not-found.case b/src/dynamic-import/instn-iee-err-not-found.case new file mode 100644 index 0000000000000000000000000000000000000000..3c6b40ea976c365d7aa5bce5f6bc814d9935b4b9 --- /dev/null +++ b/src/dynamic-import/instn-iee-err-not-found.case @@ -0,0 +1,29 @@ +// 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. +/*--- +desc: IndirectExportEntries validation - undefined imported bindings +esid: sec-moduledeclarationinstantiation +info: | + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + [...] + 11. Return starResolution. +template: catch +flags: [async] +---*/ + +//- params +'./instn-iee-err-not-found-empty_FIXTURE.js' +//- body +assert.sameValue(error.name, 'SyntaxError'); diff --git a/src/dynamic-import/returns-promise.case b/src/dynamic-import/returns-promise.case new file mode 100644 index 0000000000000000000000000000000000000000..84cba2a75968b8228acad14d5088c324d051cd54 --- /dev/null +++ b/src/dynamic-import/returns-promise.case @@ -0,0 +1,13 @@ +// 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. +/*--- +desc: Dynamic import() returns a Promise object. +template: default +flags: [async] +---*/ + +//- params +'./dynamic-import-module_FIXTURE.js' +//- body +assert.sameValue(imported.x, 1); diff --git a/src/dynamic-import/syntax/nested-arrow-assignment-expression.template b/src/dynamic-import/syntax/nested-arrow-assignment-expression.template new file mode 100644 index 0000000000000000000000000000000000000000..798c194643ea7cc34466535ee448ed02c5feeffc --- /dev/null +++ b/src/dynamic-import/syntax/nested-arrow-assignment-expression.template @@ -0,0 +1,26 @@ +// 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-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] +---*/ + +let f = () => import(/*{ params }*/); diff --git a/src/dynamic-import/syntax/nested-arrow.template b/src/dynamic-import/syntax/nested-arrow.template new file mode 100644 index 0000000000000000000000000000000000000000..5294e8f6328742646d5b3953f3bdda470fe7be04 --- /dev/null +++ b/src/dynamic-import/syntax/nested-arrow.template @@ -0,0 +1,28 @@ +// 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-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] +---*/ + +let f = () => { + import(/*{ params }*/); +}; diff --git a/src/dynamic-import/syntax/nested-async-function-await.template b/src/dynamic-import/syntax/nested-async-function-await.template new file mode 100644 index 0000000000000000000000000000000000000000..e52872095c1c71146160d85e5de7fbb5dffdd40b --- /dev/null +++ b/src/dynamic-import/syntax/nested-async-function-await.template @@ -0,0 +1,28 @@ +// 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-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] +---*/ + +async function f() { + await import(/*{ params }*/); +} diff --git a/src/dynamic-import/syntax/nested-async-function-return-await.template b/src/dynamic-import/syntax/nested-async-function-return-await.template new file mode 100644 index 0000000000000000000000000000000000000000..9229a809217d0b0539a422f7b3a1090e756af4ad --- /dev/null +++ b/src/dynamic-import/syntax/nested-async-function-return-await.template @@ -0,0 +1,29 @@ +// 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-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] +---*/ + +async function f() { + return await import(/*{ params }*/); +} + diff --git a/src/dynamic-import/syntax/nested-async-function.template b/src/dynamic-import/syntax/nested-async-function.template new file mode 100644 index 0000000000000000000000000000000000000000..e1b653a0e6123d9cd779dfd96d6c9d4af0f193a8 --- /dev/null +++ b/src/dynamic-import/syntax/nested-async-function.template @@ -0,0 +1,29 @@ +// 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-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] +---*/ + +async function f() { + import(/*{ params }*/); +} + diff --git a/src/dynamic-import/syntax/nested-block-labeled.template b/src/dynamic-import/syntax/nested-block-labeled.template new file mode 100644 index 0000000000000000000000000000000000000000..c9ce9398631535f7cc46a7909ac993237aed1b38 --- /dev/null +++ b/src/dynamic-import/syntax/nested-block-labeled.template @@ -0,0 +1,28 @@ +// 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-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] +---*/ + +label: { + import(/*{ params }*/); +}; diff --git a/src/dynamic-import/syntax/nested-block.template b/src/dynamic-import/syntax/nested-block.template new file mode 100644 index 0000000000000000000000000000000000000000..f243b01f7432934dede05e4cd7810e02c8c5ef5f --- /dev/null +++ b/src/dynamic-import/syntax/nested-block.template @@ -0,0 +1,28 @@ +// 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-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] +---*/ + +{ + import(/*{ params }*/); +}; diff --git a/src/dynamic-import/syntax/nested-do-while.template b/src/dynamic-import/syntax/nested-do-while.template new file mode 100644 index 0000000000000000000000000000000000000000..7526c2e7e315a1220b0b364a9cfe425fdf875893 --- /dev/null +++ b/src/dynamic-import/syntax/nested-do-while.template @@ -0,0 +1,28 @@ +// 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-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] +---*/ + +do { + import(/*{ params }*/); +} while (false); diff --git a/src/dynamic-import/syntax/nested-do.template b/src/dynamic-import/syntax/nested-do.template new file mode 100644 index 0000000000000000000000000000000000000000..260c92e9772b7005a695a64ad3e1f0532fe4d6d7 --- /dev/null +++ b/src/dynamic-import/syntax/nested-do.template @@ -0,0 +1,30 @@ +// 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-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] +---*/ + +let x = 0; +do { + x++; + import(/*{ params }*/); +} while (!x); diff --git a/src/dynamic-import/syntax/nested-else-braceless.template b/src/dynamic-import/syntax/nested-else-braceless.template new file mode 100644 index 0000000000000000000000000000000000000000..a5423c88c35d573f07ab599d946161d59a5c9257 --- /dev/null +++ b/src/dynamic-import/syntax/nested-else-braceless.template @@ -0,0 +1,28 @@ +// 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-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] +---*/ + +if (false) { + +} else import(/*{ params }*/); diff --git a/src/dynamic-import/syntax/nested-else.template b/src/dynamic-import/syntax/nested-else.template new file mode 100644 index 0000000000000000000000000000000000000000..1c4893c95e19fd84783f9972b8b7ec4d5fa47773 --- /dev/null +++ b/src/dynamic-import/syntax/nested-else.template @@ -0,0 +1,30 @@ +// 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-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] +---*/ + +if (false) { + +} else { + import(/*{ params }*/); +} diff --git a/src/dynamic-import/syntax/nested-function-return.template b/src/dynamic-import/syntax/nested-function-return.template new file mode 100644 index 0000000000000000000000000000000000000000..9cc9b6ed3aa1ddd15eddada2db9be6eae5c78aa1 --- /dev/null +++ b/src/dynamic-import/syntax/nested-function-return.template @@ -0,0 +1,28 @@ +// 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-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] +---*/ + +function fn() { + return import(/*{ params }*/); +} diff --git a/src/dynamic-import/syntax/nested-function.template b/src/dynamic-import/syntax/nested-function.template new file mode 100644 index 0000000000000000000000000000000000000000..44712eae6e0ffd4f39a6042979eb812ed7f31b87 --- /dev/null +++ b/src/dynamic-import/syntax/nested-function.template @@ -0,0 +1,28 @@ +// 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-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] +---*/ + +function fn() { + import(/*{ params }*/); +} diff --git a/src/dynamic-import/syntax/nested-if-braceless.template b/src/dynamic-import/syntax/nested-if-braceless.template new file mode 100644 index 0000000000000000000000000000000000000000..c76fec144d6e388c884cce3611ef01d3fe369ff9 --- /dev/null +++ b/src/dynamic-import/syntax/nested-if-braceless.template @@ -0,0 +1,26 @@ +// 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-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] +---*/ + +if (true) import(/*{ params }*/); diff --git a/src/dynamic-import/syntax/nested-if.template b/src/dynamic-import/syntax/nested-if.template new file mode 100644 index 0000000000000000000000000000000000000000..bf49ff3ed5d6b1bd041b7c9018c6da45e15db8c9 --- /dev/null +++ b/src/dynamic-import/syntax/nested-if.template @@ -0,0 +1,28 @@ +// 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-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] +---*/ + +if (true) { + import(/*{ params }*/); +} diff --git a/src/dynamic-import/syntax/nested-labeled.template b/src/dynamic-import/syntax/nested-labeled.template new file mode 100644 index 0000000000000000000000000000000000000000..2f8f01e9b5ce89f77a269297887f7600b8ab52fd --- /dev/null +++ b/src/dynamic-import/syntax/nested-labeled.template @@ -0,0 +1,28 @@ +// 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-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] +---*/ + +{ + import(/*{ params }*/); +}; diff --git a/src/dynamic-import/syntax/nested-while.template b/src/dynamic-import/syntax/nested-while.template new file mode 100644 index 0000000000000000000000000000000000000000..463935743118d8b542a80d1c5cf7f23e9ba52d25 --- /dev/null +++ b/src/dynamic-import/syntax/nested-while.template @@ -0,0 +1,30 @@ +// 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-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] +---*/ + +let x = 0; +while (!x) { + x++; + import(/*{ params }*/); +}; diff --git a/src/dynamic-import/syntax/top-level.template b/src/dynamic-import/syntax/top-level.template new file mode 100644 index 0000000000000000000000000000000000000000..f2f43a6a1a3ea0aad60e50876147c4396b890214 --- /dev/null +++ b/src/dynamic-import/syntax/top-level.template @@ -0,0 +1,16 @@ +// 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-top-level- +name: top level syntax +esid: sec-import-call-runtime-semantics-evaluation +info: | + ImportCall : + import( AssignmentExpression ) + +flags: [module] +features: [dynamic-import] +---*/ + +import(/*{ params }*/); diff --git a/test/language/module-code/dynamic-import/dynamic-import-module_FIXTURE.js b/test/language/module-code/dynamic-import/dynamic-import-module_FIXTURE.js new file mode 100644 index 0000000000000000000000000000000000000000..ef3f4207cd745179e169cb1aa8776c167dfe7d21 --- /dev/null +++ b/test/language/module-code/dynamic-import/dynamic-import-module_FIXTURE.js @@ -0,0 +1,4 @@ +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +export var x = 1; diff --git a/test/language/module-code/dynamic-import/eval-gtbndng-indirect-update-as_FIXTURE.js b/test/language/module-code/dynamic-import/eval-gtbndng-indirect-update-as_FIXTURE.js new file mode 100644 index 0000000000000000000000000000000000000000..bd505a021010f838de6fbc2236f3ec8b0a3e657e --- /dev/null +++ b/test/language/module-code/dynamic-import/eval-gtbndng-indirect-update-as_FIXTURE.js @@ -0,0 +1,9 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +var x = 1; +export { x }; + +Function('return this;')().test262update = function() { + x = 2; +}; diff --git a/test/language/module-code/dynamic-import/eval-gtbndng-indirect-update-dflt_FIXTURE.js b/test/language/module-code/dynamic-import/eval-gtbndng-indirect-update-dflt_FIXTURE.js new file mode 100644 index 0000000000000000000000000000000000000000..61b27a569e0e35bdf5a37206a31d672c5964f4ba --- /dev/null +++ b/test/language/module-code/dynamic-import/eval-gtbndng-indirect-update-dflt_FIXTURE.js @@ -0,0 +1,7 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +export default function fn() { + fn = 2; + return 1; +} diff --git a/test/language/module-code/dynamic-import/eval-gtbndng-indirect-update_FIXTURE.js b/test/language/module-code/dynamic-import/eval-gtbndng-indirect-update_FIXTURE.js new file mode 100644 index 0000000000000000000000000000000000000000..bd505a021010f838de6fbc2236f3ec8b0a3e657e --- /dev/null +++ b/test/language/module-code/dynamic-import/eval-gtbndng-indirect-update_FIXTURE.js @@ -0,0 +1,9 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +var x = 1; +export { x }; + +Function('return this;')().test262update = function() { + x = 2; +}; diff --git a/test/language/module-code/dynamic-import/eval-rqstd-abrupt-err-type_FIXTURE.js b/test/language/module-code/dynamic-import/eval-rqstd-abrupt-err-type_FIXTURE.js new file mode 100644 index 0000000000000000000000000000000000000000..13544ca36ad83b1b42027a6acd87f1f25c733b57 --- /dev/null +++ b/test/language/module-code/dynamic-import/eval-rqstd-abrupt-err-type_FIXTURE.js @@ -0,0 +1,4 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +throw new TypeError(); diff --git a/test/language/module-code/dynamic-import/eval-rqstd-abrupt-err-uri_FIXTURE.js b/test/language/module-code/dynamic-import/eval-rqstd-abrupt-err-uri_FIXTURE.js new file mode 100644 index 0000000000000000000000000000000000000000..3cdfc0dce74a43820ce34fd430ecd3c51dc1a055 --- /dev/null +++ b/test/language/module-code/dynamic-import/eval-rqstd-abrupt-err-uri_FIXTURE.js @@ -0,0 +1,4 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +throw new URIError(); diff --git a/test/language/module-code/dynamic-import/eval-rqstd-once.js b/test/language/module-code/dynamic-import/eval-rqstd-once.js new file mode 100644 index 0000000000000000000000000000000000000000..ca1a910122e5ce27d24da968c31d01f1da458ebd --- /dev/null +++ b/test/language/module-code/dynamic-import/eval-rqstd-once.js @@ -0,0 +1,31 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: Requested modules are evaluated exactly once +esid: sec-moduleevaluation +info: | + [...] + 4. If module.[[Evaluated]] is true, return undefined. + 5. Set module.[[Evaluated]] to true. + 6. For each String required that is an element of module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + [...] +includes: [fnGlobalObject.js] +flags: [async, module] +features: [dynamic-import] +---*/ + +var global = fnGlobalObject(); + + + +Promise.all([ + import('./eval-rqstd-once_FIXTURE.js'), + import('./eval-rqstd-once_FIXTURE.js'), + import('./eval-rqstd-once_FIXTURE.js'), +]).then((...importeds) => { + + assert.sameValue(global.test262, 262, 'global property was defined'); + +}).then($DONE, $DONE); diff --git a/test/language/module-code/dynamic-import/eval-rqstd-once_FIXTURE.js b/test/language/module-code/dynamic-import/eval-rqstd-once_FIXTURE.js new file mode 100644 index 0000000000000000000000000000000000000000..8af3363daf3d8842324f8e50d9427ef2d941362c --- /dev/null +++ b/test/language/module-code/dynamic-import/eval-rqstd-once_FIXTURE.js @@ -0,0 +1,15 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +export default null; +var global = Function('return this;')(); + +if (global.test262) { + throw new Error('Module was evaluated more than once.'); +} + +global.test262 = 262; + +if (global.test262 !== 262) { + throw new Error('Module was unable to signal evaluation.'); +} diff --git a/test/language/module-code/dynamic-import/eval-self-once.js b/test/language/module-code/dynamic-import/eval-self-once.js new file mode 100644 index 0000000000000000000000000000000000000000..2dbaf6e8180e4f54faca03900471f5a1a8ba2497 --- /dev/null +++ b/test/language/module-code/dynamic-import/eval-self-once.js @@ -0,0 +1,32 @@ +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: Module is evaluated exactly once +esid: sec-moduleevaluation +info: | + [...] + 4. If module.[[Evaluated]] is true, return undefined. + 5. Set module.[[Evaluated]] to true. + 6. For each String required that is an element of module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + [...] +includes: [fnGlobalObject.js] +flags: [async,module] +features: [dynamic-import] +---*/ + +var global = fnGlobalObject(); + +if (typeof global.evaluated === 'undefined') { + global.evaluated = 0; +} + +global.evaluated++; + +Promise.all([ + import('./eval-self-once.js'), + import('./eval-self-once.js'), +]).then((...importeds) => { + assert.sameValue(global.evaluated, 1, 'global property was defined and incremented only once'); +}).then($DONE, $DONE); diff --git a/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-1_FIXTURE.js b/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-1_FIXTURE.js new file mode 100644 index 0000000000000000000000000000000000000000..896bdff50a2e658637ae5144e883a22a8ac6c84c --- /dev/null +++ b/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-1_FIXTURE.js @@ -0,0 +1,4 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +export var x; diff --git a/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-2_FIXTURE.js b/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-2_FIXTURE.js new file mode 100644 index 0000000000000000000000000000000000000000..896bdff50a2e658637ae5144e883a22a8ac6c84c --- /dev/null +++ b/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-2_FIXTURE.js @@ -0,0 +1,4 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +export var x; diff --git a/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-export.js b/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-export.js new file mode 100644 index 0000000000000000000000000000000000000000..19864dd4272d761042e1f308e75cb76ba446548f --- /dev/null +++ b/test/language/module-code/dynamic-import/instn-iee-err-ambiguous-export.js @@ -0,0 +1,39 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: IndirectExportEntries validation - ambiguous imported bindings +esid: sec-moduledeclarationinstantiation +info: | + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". +negative: + phase: runtime + type: SyntaxError +flags: [module] +---*/ + +export { x } from './instn-iee-err-ambiguous_FIXTURE.js'; diff --git a/test/language/module-code/dynamic-import/instn-iee-err-ambiguous_FIXTURE.js b/test/language/module-code/dynamic-import/instn-iee-err-ambiguous_FIXTURE.js new file mode 100644 index 0000000000000000000000000000000000000000..7857161c3a3b3b73efcf0c353c59a8b9061f1d2c --- /dev/null +++ b/test/language/module-code/dynamic-import/instn-iee-err-ambiguous_FIXTURE.js @@ -0,0 +1,5 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +export * from './instn-iee-err-ambiguous-1_FIXTURE.js'; +export * from './instn-iee-err-ambiguous-2_FIXTURE.js'; diff --git a/test/language/module-code/dynamic-import/instn-iee-err-circular-1_FIXTURE.js b/test/language/module-code/dynamic-import/instn-iee-err-circular-1_FIXTURE.js new file mode 100644 index 0000000000000000000000000000000000000000..b4a127bfb5690c834d5e719e9e9b424cdff68b58 --- /dev/null +++ b/test/language/module-code/dynamic-import/instn-iee-err-circular-1_FIXTURE.js @@ -0,0 +1,4 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +export { x } from './instn-iee-err-circular-2_FIXTURE.js'; diff --git a/test/language/module-code/dynamic-import/instn-iee-err-circular-2_FIXTURE.js b/test/language/module-code/dynamic-import/instn-iee-err-circular-2_FIXTURE.js new file mode 100644 index 0000000000000000000000000000000000000000..77f5277dfcf82951c45cb8aa6a1d4d4d6b8628c0 --- /dev/null +++ b/test/language/module-code/dynamic-import/instn-iee-err-circular-2_FIXTURE.js @@ -0,0 +1,4 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +export { x } from './instn-iee-err-circular-1_FIXTURE.js'; diff --git a/test/language/module-code/dynamic-import/instn-iee-err-not-found-empty_FIXTURE.js b/test/language/module-code/dynamic-import/instn-iee-err-not-found-empty_FIXTURE.js new file mode 100644 index 0000000000000000000000000000000000000000..e46c626cf4c891ec4017bc2ab2281b9114c22e91 --- /dev/null +++ b/test/language/module-code/dynamic-import/instn-iee-err-not-found-empty_FIXTURE.js @@ -0,0 +1,4 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +;