diff --git a/src/assignment-target-type/importcall-defer.case b/src/assignment-target-type/importcall-defer.case new file mode 100644 index 00000000000..06eaaca4b84 --- /dev/null +++ b/src/assignment-target-type/importcall-defer.case @@ -0,0 +1,25 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-static-semantics-static-semantics-assignmenttargettype +desc: > + Static Semantics AssignmentTargetType, Return invalid. +info: | + ImportCall + Static Semantics AssignmentTargetType, Return invalid. +template: invalid +flags: [module] +features: [import-defer] +negative: + phase: parse + type: SyntaxError +---*/ + +//- assignmenttarget +import.defer() +//- operator += +//- value +1 diff --git a/src/dynamic-import/import-defer-assignment-expr-not-optional.case b/src/dynamic-import/import-defer-assignment-expr-not-optional.case new file mode 100644 index 00000000000..7cec300e038 --- /dev/null +++ b/src/dynamic-import/import-defer-assignment-expr-not-optional.case @@ -0,0 +1,16 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// 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/invalid +info: | + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) +features: [import-defer] +---*/ +//- import +import.defer() +//- teardown +/* The params region intentionally empty */ diff --git a/src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case b/src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case new file mode 100644 index 00000000000..d606272e894 --- /dev/null +++ b/src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case @@ -0,0 +1,12 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// 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.defer('') +template: syntax/valid +features: [import-defer] +---*/ + +//- import +import.defer('./empty_FIXTURE.js') diff --git a/src/dynamic-import/import-defer-no-new-call-expression.case b/src/dynamic-import/import-defer-no-new-call-expression.case new file mode 100644 index 00000000000..7b1ae48cf80 --- /dev/null +++ b/src/dynamic-import/import-defer-no-new-call-expression.case @@ -0,0 +1,18 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +desc: ImportCall is a CallExpression, it can't be preceded by the new keyword +template: syntax/invalid +info: | + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +features: [import-defer] +---*/ + +//- import +new import.defer('./empty_FIXTURE.js') diff --git a/src/dynamic-import/import-defer-no-rest-param.case b/src/dynamic-import/import-defer-no-rest-param.case new file mode 100644 index 00000000000..ddf5dcb3a4f --- /dev/null +++ b/src/dynamic-import/import-defer-no-rest-param.case @@ -0,0 +1,18 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +desc: ImportCall is not extensible - no rest parameter +template: syntax/invalid +info: | + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +features: [import-defer] +---*/ + +//- import +import.defer(...['./empty_FIXTURE.js']) diff --git a/src/dynamic-import/import-defer-script-code-valid.case b/src/dynamic-import/import-defer-script-code-valid.case new file mode 100644 index 00000000000..6205de6681e --- /dev/null +++ b/src/dynamic-import/import-defer-script-code-valid.case @@ -0,0 +1,11 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +desc: import.defer() can be used in script code +template: syntax/valid +features: [import-defer] +---*/ + +//- import +import.defer('./empty_FIXTURE.js') diff --git a/src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case b/src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case new file mode 100644 index 00000000000..efbc58bfce0 --- /dev/null +++ b/src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case @@ -0,0 +1,40 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// 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 from ToString(specifier) rejects the promise +esid: sec-moduleevaluation +info: | + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... +template: catch +features: [import-defer] +---*/ + +//- setup +const obj = { + toString() { + throw 'custom error'; + } +}; + +//- import +import.defer(obj) +//- body +assert.sameValue(error, 'custom error'); diff --git a/test/language/expressions/assignmenttargettype/direct-importcall-defer.js b/test/language/expressions/assignmenttargettype/direct-importcall-defer.js new file mode 100644 index 00000000000..cf36b1cf832 --- /dev/null +++ b/test/language/expressions/assignmenttargettype/direct-importcall-defer.js @@ -0,0 +1,21 @@ +// This file was procedurally generated from the following sources: +// - src/assignment-target-type/importcall-defer.case +// - src/assignment-target-type/invalid/direct.template +/*--- +description: Static Semantics AssignmentTargetType, Return invalid. (Direct assignment) +features: [import-defer] +flags: [generated, module] +negative: + phase: parse + type: SyntaxError +info: | + Direct assignment + + ImportCall + Static Semantics AssignmentTargetType, Return invalid. + +---*/ + +$DONOTEVALUATE(); + +import.defer() = 1; diff --git a/test/language/expressions/assignmenttargettype/parenthesized-importcall-defer.js b/test/language/expressions/assignmenttargettype/parenthesized-importcall-defer.js new file mode 100644 index 00000000000..927f9e46b68 --- /dev/null +++ b/test/language/expressions/assignmenttargettype/parenthesized-importcall-defer.js @@ -0,0 +1,24 @@ +// This file was procedurally generated from the following sources: +// - src/assignment-target-type/importcall-defer.case +// - src/assignment-target-type/invalid/parenthesized.template +/*--- +description: Static Semantics AssignmentTargetType, Return invalid. (ParenthesizedExpression) +esid: sec-grouping-operator-static-semantics-assignmenttargettype +features: [import-defer] +flags: [generated, module] +negative: + phase: parse + type: SyntaxError +info: | + ParenthesizedExpression: (Expression) + + Return AssignmentTargetType of Expression. + + ImportCall + Static Semantics AssignmentTargetType, Return invalid. + +---*/ + +$DONOTEVALUATE(); + +(import.defer()) = 1; diff --git a/test/language/expressions/dynamic-import/catch/nested-arrow-import-catch-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-arrow-import-catch-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..4a29c659221 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-arrow-import-catch-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/nested-arrow.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (nested arrow) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +let f = () => { + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +}; + +f(); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..fd0be3deeda --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/nested-async-arrow-fn-await.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (nested in async arrow function, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +const f = async () => { + await import.defer(obj); +} + +f().catch(error => { + + assert.sameValue(error, 'custom error'); + +}).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..938eb8932de --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/nested-async-arrow-fn-return-await.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (nested in async arrow function, returned) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +const f = async () => await import.defer(obj); + +f().catch(error => { + + assert.sameValue(error, 'custom error'); + +}).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-function-await-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-async-function-await-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..6dc81c817f1 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-async-function-await-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/nested-async-function-await.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (nested in async function, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +async function f() { + await import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +} + +f(); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-function-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-async-function-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..f7dcd35010c --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-async-function-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/nested-async-function.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (nested in async function) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +async function f() { + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +} + +f(); + diff --git a/test/language/expressions/dynamic-import/catch/nested-async-function-return-await-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-async-function-return-await-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..bf484e0bd6f --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-async-function-return-await-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/nested-async-function-return-await.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (nested in async function, returns awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +async function f() { + return await import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +} + +f(); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-gen-await-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-async-gen-await-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..5ebc27ea7f3 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-async-gen-await-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/nested-async-generator-await.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (nested in async generator, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import, async-iteration] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +async function * f() { + await import.defer(obj); +} + +f().next().catch(error => { + + assert.sameValue(error, 'custom error'); + +}).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-gen-return-await-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-async-gen-return-await-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..a6fd391b114 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-async-gen-return-await-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/nested-async-generator-return-await.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (nested in async generator, returns awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import, async-iteration] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +async function * f() { + return await import.defer(obj); +} + +f().next().catch(error => { + + assert.sameValue(error, 'custom error'); + +}).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-block-import-catch-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-block-import-catch-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..314c791eec1 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-block-import-catch-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/nested-block.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (nested block) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +{ + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/expressions/dynamic-import/catch/nested-block-labeled-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-block-labeled-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..445e4bd0d7b --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-block-labeled-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/nested-block-labeled.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +label: { + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/expressions/dynamic-import/catch/nested-do-while-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-do-while-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..bfc1691fa46 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-do-while-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/nested-do-while.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (nested do while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +do { + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +} while (false); diff --git a/test/language/expressions/dynamic-import/catch/nested-else-import-catch-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-else-import-catch-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..64d291f4154 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-else-import-catch-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/nested-else.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (nested else) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +if (false) { + +} else { + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +} diff --git a/test/language/expressions/dynamic-import/catch/nested-function-import-catch-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-function-import-catch-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..fd30fa8137a --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-function-import-catch-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/nested-function.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (nested function) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +function f() { + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +} +f(); diff --git a/test/language/expressions/dynamic-import/catch/nested-if-import-catch-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-if-import-catch-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..037234391c7 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-if-import-catch-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/nested-if.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (nested if) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +if (true) { + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +} diff --git a/test/language/expressions/dynamic-import/catch/nested-while-import-catch-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-while-import-catch-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..86bf40e8dc9 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-while-import-catch-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/nested-while.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (nested while) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +let x = 0; +while (!x) { + x++; + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/expressions/dynamic-import/catch/top-level-import-catch-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/top-level-import-catch-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..564ddfbb2ef --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/top-level-import-catch-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case +// - src/dynamic-import/catch/top-level.template +/*--- +description: Abrupt from ToString(specifier) rejects the promise (top level) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, async] +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]]. + + + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + +}).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..dc5aa770931 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-arrow-assignment-expression.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +let f = () => import.defer(); + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..4eb77f4e5f9 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-new-call-expression.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-arrow-assignment-expression.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +let f = () => new import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-rest-param.js new file mode 100644 index 00000000000..36dc8653de5 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-rest-param.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-arrow-assignment-expression.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +let f = () => import.defer(...['./empty_FIXTURE.js']); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..cc9156baa54 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-arrow.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +let f = () => { + import.defer(); +}; + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..638808f0f55 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-arrow.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +let f = () => { + new import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-rest-param.js new file mode 100644 index 00000000000..1e57fdfe76e --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-arrow.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +let f = () => { + import.defer(...['./empty_FIXTURE.js']); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..cec4eea3754 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-await.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested in async arrow function, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +(async () => { + await import.defer() +}); + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..39a1fdaaa53 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-await.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested in async arrow function, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +(async () => { + await new import.defer('./empty_FIXTURE.js') +}); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-rest-param.js new file mode 100644 index 00000000000..22a5e081f4f --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-await.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested in async arrow function, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +(async () => { + await import.defer(...['./empty_FIXTURE.js']) +}); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..30255f57280 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-return-await.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested in async arrow function, returned) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +(async () => await import.defer()) + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..ca540341c24 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-new-call-expression.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-return-await.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested in async arrow function, returned) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +(async () => await new import.defer('./empty_FIXTURE.js')) diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-rest-param.js new file mode 100644 index 00000000000..db2c249a23c --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-rest-param.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-return-await.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested in async arrow function, returned) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +(async () => await import.defer(...['./empty_FIXTURE.js'])) diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..ffb328424f0 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-async-function-await.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function f() { + await import.defer(); +} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..bc1fa4d1416 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-async-function-await.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function f() { + await new import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-rest-param.js new file mode 100644 index 00000000000..5b7e2bf803f --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-async-function-await.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +async function f() { + await import.defer(...['./empty_FIXTURE.js']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..935169ab094 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-async-function.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function f() { + import.defer(); +} + + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..7bb1c22911f --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-new-call-expression.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-async-function.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function f() { + new import.defer('./empty_FIXTURE.js'); +} + diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-rest-param.js new file mode 100644 index 00000000000..a1a90080e5b --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-rest-param.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-async-function.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +async function f() { + import.defer(...['./empty_FIXTURE.js']); +} + diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..4573cca670a --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-async-function-return-await.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function f() { + return await import.defer(); +} + + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..501854f2d7b --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-new-call-expression.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-async-function-return-await.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function f() { + return await new import.defer('./empty_FIXTURE.js'); +} + diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-rest-param.js new file mode 100644 index 00000000000..cd64f3e05fc --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-rest-param.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-async-function-return-await.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +async function f() { + return await import.defer(...['./empty_FIXTURE.js']); +} + diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..46a6da824a7 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-async-generator-await.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested in async generator, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import, async-iteration] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function * f() { + await import.defer() +} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..34cc167f7b1 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-async-generator-await.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested in async generator, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import, async-iteration] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function * f() { + await new import.defer('./empty_FIXTURE.js') +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-rest-param.js new file mode 100644 index 00000000000..7327bb0331d --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-async-generator-await.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested in async generator, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import, async-iteration] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +async function * f() { + await import.defer(...['./empty_FIXTURE.js']) +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..1d6a7dca2d2 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-block.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +{ + import.defer(); +}; + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..959d8b070aa --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-block.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +{ + new import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-rest-param.js new file mode 100644 index 00000000000..1283572dba6 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-block.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +{ + import.defer(...['./empty_FIXTURE.js']); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..f80e559ab1f --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-block-labeled.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +label: { + import.defer(); +}; + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..cc9e2461149 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-block-labeled.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +label: { + new import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-rest-param.js new file mode 100644 index 00000000000..8db4ae84222 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-block-labeled.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +label: { + import.defer(...['./empty_FIXTURE.js']); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..63f321e3aa5 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-do-while.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested do while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +do { + import.defer(); +} while (false); + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..2409a5dd070 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-do-while.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested do while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +do { + new import.defer('./empty_FIXTURE.js'); +} while (false); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-rest-param.js new file mode 100644 index 00000000000..d65cdc136b3 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-do-while.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested do while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +do { + import.defer(...['./empty_FIXTURE.js']); +} while (false); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..0be28a2b2ae --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-else-braceless.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (false) { + +} else import.defer(); + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..e8ca2ae8f8a --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-else-braceless.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (false) { + +} else new import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-rest-param.js new file mode 100644 index 00000000000..fb5cf17e42e --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-else-braceless.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +if (false) { + +} else import.defer(...['./empty_FIXTURE.js']); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..8af57918ca4 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-else.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (false) { + +} else { + import.defer(); +} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..7461ae77e04 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-new-call-expression.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-else.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (false) { + +} else { + new import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-rest-param.js new file mode 100644 index 00000000000..f5512b9ce0f --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-rest-param.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-else.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +if (false) { + +} else { + import.defer(...['./empty_FIXTURE.js']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..2d97bd986fe --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-function.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +function fn() { + import.defer(); +} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..008d4a40d5e --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-function.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +function fn() { + new import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-rest-param.js new file mode 100644 index 00000000000..a491d923136 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-function.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +function fn() { + import.defer(...['./empty_FIXTURE.js']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..7e436fa46bf --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-function-return.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +function fn() { + return import.defer(); +} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..3a5d6e61ab0 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-function-return.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +function fn() { + return new import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-rest-param.js new file mode 100644 index 00000000000..12ce40f3646 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-function-return.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +function fn() { + return import.defer(...['./empty_FIXTURE.js']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..47f7a0bd461 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-if-braceless.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (true) import.defer(); + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..5878734ea57 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-new-call-expression.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-if-braceless.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (true) new import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-rest-param.js new file mode 100644 index 00000000000..f09463f785b --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-rest-param.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-if-braceless.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +if (true) import.defer(...['./empty_FIXTURE.js']); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..b659460c076 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-if.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (true) { + import.defer(); +} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..4b73727103d --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-if.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (true) { + new import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-rest-param.js new file mode 100644 index 00000000000..722c57b30cb --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-if.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +if (true) { + import.defer(...['./empty_FIXTURE.js']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..24779ab0a0c --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-while.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +let x = 0; +while (!x) { + x++; + import.defer(); +}; + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..af97d6a9ebb --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-new-call-expression.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-while.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +let x = 0; +while (!x) { + x++; + new import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-rest-param.js new file mode 100644 index 00000000000..3d076437a62 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-rest-param.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-while.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +let x = 0; +while (!x) { + x++; + import.defer(...['./empty_FIXTURE.js']); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..97bc80796e4 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-with-expression.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested with syntax in the expression position) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, noStrict] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +with (import.defer()) {} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..f015efa59c6 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-new-call-expression.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-with-expression.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested with syntax in the expression position) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, noStrict] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +with (new import.defer('./empty_FIXTURE.js')) {} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-rest-param.js new file mode 100644 index 00000000000..6e7e1345346 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-rest-param.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-with-expression.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested with syntax in the expression position) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, noStrict] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +with (import.defer(...['./empty_FIXTURE.js'])) {} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..ed47194418e --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/nested-with.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested with syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, noStrict] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +with ({}) { + import.defer(); +} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..990418f4953 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/nested-with.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested with syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, noStrict] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +with ({}) { + new import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-rest-param.js new file mode 100644 index 00000000000..46f3d58e2c7 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/nested-with.template +/*--- +description: ImportCall is not extensible - no rest parameter (nested with syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, noStrict] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +with ({}) { + import.defer(...['./empty_FIXTURE.js']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..52a01d89b61 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,26 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-assignment-expr-not-optional.case +// - src/dynamic-import/syntax/invalid/top-level.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (top level syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +import.defer(); + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..61c8bbeccf6 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-new-call-expression.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-new-call-expression.case +// - src/dynamic-import/syntax/invalid/top-level.template +/*--- +description: ImportCall is a CallExpression, it can't be preceded by the new keyword (top level syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +new import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-rest-param.js new file mode 100644 index 00000000000..253c662311a --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-rest-param.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-no-rest-param.case +// - src/dynamic-import/syntax/invalid/top-level.template +/*--- +description: ImportCall is not extensible - no rest parameter (top level syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +import.defer(...['./empty_FIXTURE.js']); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..193c11cbc85 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-arrow-assignment-expression.template +/*--- +description: Calling import.defer('') (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +let f = () => import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-script-code-valid.js new file mode 100644 index 00000000000..bd14d343ef2 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-script-code-valid.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-arrow-assignment-expression.template +/*--- +description: import.defer() can be used in script code (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +let f = () => import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..24d32fe0ae3 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-arrow.template +/*--- +description: Calling import.defer('') (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +let f = () => { + import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-script-code-valid.js new file mode 100644 index 00000000000..8d6ae752a16 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-script-code-valid.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-arrow.template +/*--- +description: import.defer() can be used in script code (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +let f = () => { + import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..b107f5e49e3 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-await.template +/*--- +description: Calling import.defer('') (nested in async arrow function) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +(async () => { + await import.defer('./empty_FIXTURE.js') +}); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-script-code-valid.js new file mode 100644 index 00000000000..c4dd4e8d3eb --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-script-code-valid.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-await.template +/*--- +description: import.defer() can be used in script code (nested in async arrow function) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +(async () => { + await import.defer('./empty_FIXTURE.js') +}); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..0d89d59654e --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-return-await.template +/*--- +description: Calling import.defer('') (nested in async arrow function, returned) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +(async () => await import.defer('./empty_FIXTURE.js')); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-script-code-valid.js new file mode 100644 index 00000000000..13d6a41d4ea --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-script-code-valid.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-return-await.template +/*--- +description: import.defer() can be used in script code (nested in async arrow function, returned) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +(async () => await import.defer('./empty_FIXTURE.js')); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..79334eb834a --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-async-function-await.template +/*--- +description: Calling import.defer('') (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +async function f() { + await import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-script-code-valid.js new file mode 100644 index 00000000000..2e80b611226 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-script-code-valid.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-async-function-await.template +/*--- +description: import.defer() can be used in script code (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +async function f() { + await import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..3fd238d2017 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-async-function.template +/*--- +description: Calling import.defer('') (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +async function f() { + import.defer('./empty_FIXTURE.js'); +} + diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-script-code-valid.js new file mode 100644 index 00000000000..63f0ec007bf --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-script-code-valid.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-async-function.template +/*--- +description: import.defer() can be used in script code (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +async function f() { + import.defer('./empty_FIXTURE.js'); +} + diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..41cf6bef5db --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-async-function-return-await.template +/*--- +description: Calling import.defer('') (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +async function f() { + return await import.defer('./empty_FIXTURE.js'); +} + diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-script-code-valid.js new file mode 100644 index 00000000000..1a791e5a40a --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-script-code-valid.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-async-function-return-await.template +/*--- +description: import.defer() can be used in script code (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +async function f() { + return await import.defer('./empty_FIXTURE.js'); +} + diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..8b7f3ef0d43 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-async-generator-await.template +/*--- +description: Calling import.defer('') (nested in async generator, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import, async-iteration] +flags: [generated] +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]]. + +---*/ + +async function * f() { + await import.defer('./empty_FIXTURE.js') +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-script-code-valid.js new file mode 100644 index 00000000000..dbe3c4725b9 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-script-code-valid.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-async-generator-await.template +/*--- +description: import.defer() can be used in script code (nested in async generator, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import, async-iteration] +flags: [generated] +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]]. + +---*/ + +async function * f() { + await import.defer('./empty_FIXTURE.js') +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..701ea46b679 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-block.template +/*--- +description: Calling import.defer('') (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +{ + import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-script-code-valid.js new file mode 100644 index 00000000000..bc55f05c0f0 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-script-code-valid.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-block.template +/*--- +description: import.defer() can be used in script code (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +{ + import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..a10a50825cb --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-block-labeled.template +/*--- +description: Calling import.defer('') (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +label: { + import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-script-code-valid.js new file mode 100644 index 00000000000..37fc1dea25d --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-script-code-valid.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-block-labeled.template +/*--- +description: import.defer() can be used in script code (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +label: { + import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..af6d8ba4645 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-do-while.template +/*--- +description: Calling import.defer('') (nested do while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +do { + import.defer('./empty_FIXTURE.js'); +} while (false); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-script-code-valid.js new file mode 100644 index 00000000000..122ef9335f9 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-script-code-valid.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-do-while.template +/*--- +description: import.defer() can be used in script code (nested do while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +do { + import.defer('./empty_FIXTURE.js'); +} while (false); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..3cf0651d35a --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-else-braceless.template +/*--- +description: Calling import.defer('') (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +if (false) { + +} else import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-script-code-valid.js new file mode 100644 index 00000000000..d5b539475b1 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-script-code-valid.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-else-braceless.template +/*--- +description: import.defer() can be used in script code (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +if (false) { + +} else import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..a957f7745dd --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-else.template +/*--- +description: Calling import.defer('') (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +if (false) { + +} else { + import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-script-code-valid.js new file mode 100644 index 00000000000..5ff80e561ca --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-script-code-valid.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-else.template +/*--- +description: import.defer() can be used in script code (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +if (false) { + +} else { + import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..954c37d18f2 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-function.template +/*--- +description: Calling import.defer('') (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +function fn() { + import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-script-code-valid.js new file mode 100644 index 00000000000..951e485bfd2 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-script-code-valid.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-function.template +/*--- +description: import.defer() can be used in script code (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +function fn() { + import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..2cd2bd54c44 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-function-return.template +/*--- +description: Calling import.defer('') (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +function fn() { + return import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-script-code-valid.js new file mode 100644 index 00000000000..db192bc1bcd --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-script-code-valid.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-function-return.template +/*--- +description: import.defer() can be used in script code (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +function fn() { + return import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..49d5de3ee46 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-if-braceless.template +/*--- +description: Calling import.defer('') (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +if (true) import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-script-code-valid.js new file mode 100644 index 00000000000..dbe63393f45 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-script-code-valid.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-if-braceless.template +/*--- +description: import.defer() can be used in script code (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +if (true) import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..60cf90bc6b3 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-if.template +/*--- +description: Calling import.defer('') (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +if (true) { + import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-script-code-valid.js new file mode 100644 index 00000000000..6fb92c6e4fd --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-script-code-valid.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-if.template +/*--- +description: import.defer() can be used in script code (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +if (true) { + import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..59a88257d91 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-while.template +/*--- +description: Calling import.defer('') (nested while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +let x = 0; +while (!x) { + x++; + import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-script-code-valid.js new file mode 100644 index 00000000000..684af5eede3 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-script-code-valid.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-while.template +/*--- +description: import.defer() can be used in script code (nested while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +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]]. + +---*/ + +let x = 0; +while (!x) { + x++; + import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..806279e0466 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-with-expression.template +/*--- +description: Calling import.defer('') (nested with syntax in the expression position) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, noStrict] +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]]. + +---*/ + +with (import.defer('./empty_FIXTURE.js')) { + assert.sameValue(then, Promise.prototype.then); + assert.sameValue(constructor, Promise); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-script-code-valid.js new file mode 100644 index 00000000000..94537e90795 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-script-code-valid.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-with-expression.template +/*--- +description: import.defer() can be used in script code (nested with syntax in the expression position) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, noStrict] +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]]. + +---*/ + +with (import.defer('./empty_FIXTURE.js')) { + assert.sameValue(then, Promise.prototype.then); + assert.sameValue(constructor, Promise); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..bc790bf6664 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-with.template +/*--- +description: Calling import.defer('') (nested with syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, noStrict] +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]]. + +---*/ + +with ({}) { + import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-script-code-valid.js new file mode 100644 index 00000000000..aea63922d29 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-script-code-valid.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-with.template +/*--- +description: import.defer() can be used in script code (nested with syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated, noStrict] +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]]. + +---*/ + +with ({}) { + import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..d852943805b --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,15 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/top-level.template +/*--- +description: Calling import.defer('') (top level syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +info: | + ImportCall : + import( AssignmentExpression ) + +---*/ + +import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-script-code-valid.js new file mode 100644 index 00000000000..34a56ca844a --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-script-code-valid.js @@ -0,0 +1,15 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/top-level.template +/*--- +description: import.defer() can be used in script code (top level syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +info: | + ImportCall : + import( AssignmentExpression ) + +---*/ + +import.defer('./empty_FIXTURE.js');