diff --git a/test/language/module-code/dynamic-import/assign-expr/additive-expr.js b/test/language/module-code/dynamic-import/assign-expr/additive-expr.js new file mode 100644 index 0000000000000000000000000000000000000000..ec0f39fae3094342822b7ca64a044f4fb5566e94 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/additive-expr.js @@ -0,0 +1,40 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (Additive Expression) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +let x = './module-code'; +let y = './module-code'; + +const a = '_FIXTURE.js'; +const b = '-other_FIXTURE.js'; + +async function fn() { + const ns1 = await import(x + a); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + const ns2 = await import(y + b); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/array-literal.js b/test/language/module-code/dynamic-import/assign-expr/array-literal.js new file mode 100644 index 0000000000000000000000000000000000000000..0e0d697630d1735bfce333520505186326969c77 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/array-literal.js @@ -0,0 +1,38 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (Array Literal) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +const a = './module-code_FIXTURE.js'; +const b = './module-code-other_FIXTURE.js'; + +async function fn() { + const ns1 = await import([a]); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + Array.prototype.toString = () => b; + const ns2 = await import([]); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/arrow-function.js b/test/language/module-code/dynamic-import/assign-expr/arrow-function.js new file mode 100644 index 0000000000000000000000000000000000000000..91dad3ebec19010d560fcff1e6950d5c3eecc65e --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/arrow-function.js @@ -0,0 +1,31 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (ArrowFunction) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +Function.prototype.toString = () => './module-code_FIXTURE.js'; + +async function fn() { + const ns = await import(() => {}); + + assert.sameValue(ns.local1, 'Test262'); + assert.sameValue(ns.default, 42); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/await-expr.js b/test/language/module-code/dynamic-import/assign-expr/await-expr.js new file mode 100644 index 0000000000000000000000000000000000000000..c84f2e5e225ab766a7b5b7fdbb237f3f243bded3 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/await-expr.js @@ -0,0 +1,37 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (AwaitExpression) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +const a = './module-code_FIXTURE.js'; +const b = './module-code-other_FIXTURE.js'; + +async function fn() { + const ns1 = await import(await a); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + const ns2 = await import(await b); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/await-identifier.js b/test/language/module-code/dynamic-import/assign-expr/await-identifier.js new file mode 100644 index 0000000000000000000000000000000000000000..1715cd70ff6181b61a7ca5e299a1857661a266e6 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/await-identifier.js @@ -0,0 +1,33 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (IdentifierReference: await) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +const await = './module-code_FIXTURE.js'; + +const getpromise = () => import(await); + +async function fn() { + const ns1 = await getpromise(); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/call-expr-arguments.js b/test/language/module-code/dynamic-import/assign-expr/call-expr-arguments.js new file mode 100644 index 0000000000000000000000000000000000000000..e5da082d7389cc212c22b64af7a76ab36543a6d3 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/call-expr-arguments.js @@ -0,0 +1,45 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (CallExpression Arguments) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await, +Tagged] +flags: [async] +features: [dynamic-import] +---*/ + +const a = () => () => './module-code_FIXTURE.js'; +const b = () => () => './module-code-other_FIXTURE.js'; + +async function fn() { + const ns1 = await import(a()()); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + const ns2 = await import(b()()); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/call-expr-expr.js b/test/language/module-code/dynamic-import/assign-expr/call-expr-expr.js new file mode 100644 index 0000000000000000000000000000000000000000..a4ab9866e726fecb73f61a6e2cb5639f55b92540 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/call-expr-expr.js @@ -0,0 +1,44 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (CallExpression [ Expression ]) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await, +Tagged] +flags: [async] +features: [dynamic-import] +---*/ + +const a = () => ['./module-code_FIXTURE.js', './module-code-other_FIXTURE.js']; + +async function fn() { + const ns1 = await import(a()[0]); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + const ns2 = await import(a()[0, 1]); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/call-expr-identifier.js b/test/language/module-code/dynamic-import/assign-expr/call-expr-identifier.js new file mode 100644 index 0000000000000000000000000000000000000000..7e801d8a299209419a77c88e829779f65b50a4b8 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/call-expr-identifier.js @@ -0,0 +1,47 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (CallExpression . IdentifierName) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await, +Tagged] +flags: [async] +features: [dynamic-import] +---*/ + +const a = () => ({ + x: './module-code_FIXTURE.js', + y: './module-code-other_FIXTURE.js' +}); + +async function fn() { + const ns1 = await import(a().x); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + const ns2 = await import(a().y); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/cover-call-expr.js b/test/language/module-code/dynamic-import/assign-expr/cover-call-expr.js new file mode 100644 index 0000000000000000000000000000000000000000..baa8b576c49396246fff32eba57d9e714d33d7a6 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/cover-call-expr.js @@ -0,0 +1,45 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (CoverCallExpressionAndAsyncArrowHeadn) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] + + CallExpression[Yield, Await]: + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] + SuperCall[?Yield, ?Await] + CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await] + CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]] + CallExpression[?Yield, ?Await].IdentifierName + CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await, +Tagged] +flags: [async] +features: [dynamic-import] +---*/ + +const a = () => './module-code_FIXTURE.js'; +const b = () => './module-code-other_FIXTURE.js'; + +async function fn() { + const ns1 = await import(a()); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + const ns2 = await import(b()); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/cover-parenthesized-expr.js b/test/language/module-code/dynamic-import/assign-expr/cover-parenthesized-expr.js new file mode 100644 index 0000000000000000000000000000000000000000..8eefa4f3c464b90fe74b22c7f04088e45bac1a2e --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/cover-parenthesized-expr.js @@ -0,0 +1,37 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (CoverParenthesizedExpressionAndArrowParameterList) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] + + CoverParenthesizedExpressionAndArrowParameterList[Yield, Await]: + (Expression[+In, ?Yield, ?Await]) +flags: [async] +features: [dynamic-import] +---*/ + +async function fn() { + const ns1 = await import((((((('./module-code_FIXTURE.js'))))))); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + const ns2 = await import((1, 0, './module-code-other_FIXTURE.js')); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/identifier.js b/test/language/module-code/dynamic-import/assign-expr/identifier.js new file mode 100644 index 0000000000000000000000000000000000000000..08692b13e8df5cb56208141fc97833e3ec1ec1db --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/identifier.js @@ -0,0 +1,37 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (Identifier) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +const a = './module-code_FIXTURE.js'; +const b = './module-code-other_FIXTURE.js'; + +async function fn() { + const ns1 = await import(a); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + const ns2 = await import(b); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/lhs-assign-operator-assign-expr.js b/test/language/module-code/dynamic-import/assign-expr/lhs-assign-operator-assign-expr.js new file mode 100644 index 0000000000000000000000000000000000000000..3f8f1bcfb917a19402f63e96e84f221b91803cc1 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/lhs-assign-operator-assign-expr.js @@ -0,0 +1,40 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (LHS Expr AssignmentOperator AssignmentExpression) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +let x = './module-code'; +let y = './module-code'; + +const a = '_FIXTURE.js'; +const b = '-other_FIXTURE.js'; + +async function fn() { + const ns1 = await import(x += a); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + const ns2 = await import(y += b); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/lhs-eq-assign-expr.js b/test/language/module-code/dynamic-import/assign-expr/lhs-eq-assign-expr.js new file mode 100644 index 0000000000000000000000000000000000000000..e293252e4eebd3f5d0233d289d210e69020c0ba0 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/lhs-eq-assign-expr.js @@ -0,0 +1,42 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (LHS Expr = AssignmentExpression) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +let x = 'foo'; +const y = { + z: 0 +}; +Object.freeze(y); +const a = './module-code_FIXTURE.js'; +const b = './module-code-other_FIXTURE.js'; + +async function fn() { + const ns1 = await import(x = a); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + const ns2 = await import(y.z = b); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/logical-and-expr.js b/test/language/module-code/dynamic-import/assign-expr/logical-and-expr.js new file mode 100644 index 0000000000000000000000000000000000000000..3c2adcca92f36948a34dcb59cd9af814435abd4e --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/logical-and-expr.js @@ -0,0 +1,38 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (LogicalANDExpression) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +const a = './module-code_FIXTURE.js'; +const b = './module-code-other_FIXTURE.js'; + +async function fn() { + const ns1 = await import(b && a); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + // mix it in with Unary Expressions + const ns2 = await import(delete void typeof +-~! 0 && b); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/logical-or-expr.js b/test/language/module-code/dynamic-import/assign-expr/logical-or-expr.js new file mode 100644 index 0000000000000000000000000000000000000000..0c4dd3e784d309262f0b5580f062c1985aa91702 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/logical-or-expr.js @@ -0,0 +1,37 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (LogicalORExpression) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +const a = './module-code_FIXTURE.js'; +const b = './module-code-other_FIXTURE.js'; + +async function fn() { + const ns1 = await import(a || b); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + const ns2 = await import(false || b); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/member-expr.js b/test/language/module-code/dynamic-import/assign-expr/member-expr.js new file mode 100644 index 0000000000000000000000000000000000000000..55021c2d58e1771c2310bed55a6c7947f2843c2e --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/member-expr.js @@ -0,0 +1,41 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (Object properties from MemberExpressions) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +const obj = { + a: './module-code_FIXTURE.js', + b: './module-code-other_FIXTURE.js' +} + +async function fn() { + // MemberExpression [ Expression ] + const ns1 = await import(obj['a']); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + // MemberExpression . IdentifierName + const ns2 = await import(obj.b); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/module-code-other_FIXTURE.js b/test/language/module-code/dynamic-import/assign-expr/module-code-other_FIXTURE.js new file mode 100644 index 0000000000000000000000000000000000000000..284528dbb0e08cd9f32523238ed1cb2ac0ee3584 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/module-code-other_FIXTURE.js @@ -0,0 +1,10 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// exports: default === 1612, local1 === 'one six one two', renamed === 'star', indirect === 'one six one two' + +export var local1 = 'one six one two'; +var local2 = 'star'; +export { local2 as renamed }; +export { local1 as indirect } from './module-code_FIXTURE.js'; +export default 1612; diff --git a/test/language/module-code/dynamic-import/assign-expr/module-code_FIXTURE.js b/test/language/module-code/dynamic-import/assign-expr/module-code_FIXTURE.js new file mode 100644 index 0000000000000000000000000000000000000000..62cb5ae82193f19df0c8d2e70dfc7214437e8771 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/module-code_FIXTURE.js @@ -0,0 +1,10 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// exports: default === 42, local1 === 'Test262', renamed === 'TC39', indirect === 'Test262' + +export var local1 = 'Test262'; +var local2 = 'TC39'; +export { local2 as renamed }; +export { local1 as indirect } from './module-code_FIXTURE.js'; +export default 42; diff --git a/test/language/module-code/dynamic-import/assign-expr/new-target.js b/test/language/module-code/dynamic-import/assign-expr/new-target.js new file mode 100644 index 0000000000000000000000000000000000000000..b2c7dfc1be7d9bc0507e85a03e7d6c59fc1d9c3d --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/new-target.js @@ -0,0 +1,35 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (NewTarget) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +function ctor() { + return import(new.target); +} + +ctor.toString = () => './module-code_FIXTURE.js'; + +async function fn() { + const ns = await new ctor(); + + assert.sameValue(ns.local1, 'Test262'); + assert.sameValue(ns.default, 42); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/object-literal.js b/test/language/module-code/dynamic-import/assign-expr/object-literal.js new file mode 100644 index 0000000000000000000000000000000000000000..3d746cf94059e0e6d9a373d3bd3228c88193744c --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/object-literal.js @@ -0,0 +1,38 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (Object Literal) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +const a = './module-code_FIXTURE.js'; +const b = './module-code-other_FIXTURE.js'; + +async function fn() { + const ns1 = await import({ toString() { return a; } }); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + Object.prototype.toString = () => b; + const ns2 = await import({}); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/tagged-function-call.js b/test/language/module-code/dynamic-import/assign-expr/tagged-function-call.js new file mode 100644 index 0000000000000000000000000000000000000000..5e54a692c9fcd5b110cffcb29a3d7780f2e6490f --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/tagged-function-call.js @@ -0,0 +1,37 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (MemberExpression TemplateLiteral) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +const a = './module-code_FIXTURE.js'; +const b = './module-code-other_FIXTURE.js'; + +function tag(arg) { + return arg[0]; +} + +async function fn() { + // MemberExpression TemplateLiteral + const ns = await import(tag`./module-code-other_FIXTURE.js`); + + assert.sameValue(ns.local1, 'one six one two'); + assert.sameValue(ns.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/ternary.js b/test/language/module-code/dynamic-import/assign-expr/ternary.js new file mode 100644 index 0000000000000000000000000000000000000000..cbb7cd66cb911ed602f711f0ee25816a234a5149 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/ternary.js @@ -0,0 +1,37 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (Ternary) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +const a = './module-code_FIXTURE.js'; +const b = './module-code-other_FIXTURE.js'; + +async function fn() { + const ns1 = await import(true ? a : b); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + const ns2 = await import(false ? a : b); + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/this.js b/test/language/module-code/dynamic-import/assign-expr/this.js new file mode 100644 index 0000000000000000000000000000000000000000..c50cff64b8b0d799b9b3a6573b9a4f698c809d22 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/this.js @@ -0,0 +1,32 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (this) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] + + PrimaryExpression[Yield, Await]: + this +flags: [async] +features: [dynamic-import] +---*/ + +async function fn() { + const ns1 = await import(this); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); +} + +fn.call('./module-code_FIXTURE.js').then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/unary-expr.js b/test/language/module-code/dynamic-import/assign-expr/unary-expr.js new file mode 100644 index 0000000000000000000000000000000000000000..2121d3f764ed6c48e100a78a5036a0c603ae0213 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/unary-expr.js @@ -0,0 +1,32 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (UnaryExpressions) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +features: [dynamic-import] +---*/ + +const obj = { + prop: 42 +}; + +import(delete obj.prop); +import(void 0); +import(typeof {}); +import(+void 0); +import(-void 0); +import(!void 0); +import(~void 0); +import(delete void typeof +-~! 0); diff --git a/test/language/module-code/dynamic-import/assign-expr/yield-assign-expr.js b/test/language/module-code/dynamic-import/assign-expr/yield-assign-expr.js new file mode 100644 index 0000000000000000000000000000000000000000..08661ca3717005226546d97671001661c0143231 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/yield-assign-expr.js @@ -0,0 +1,47 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (yield [no LineTerminator here] AssignmentExpression) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +const a = './module-code_FIXTURE.js'; +const b = './module-code-other_FIXTURE.js'; + +function *g() { + return import(yield 42); +} + +async function *fn() { + let iter = g(); + assert.sameValue(iter.next().value, 42); + + const ns1 = await iter.next(a).value; + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + iter = g(); + assert.sameValue(iter.next().value, 42); + + const ns2 = await iter.next(b).value; + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().next(a).then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/yield-expr.js b/test/language/module-code/dynamic-import/assign-expr/yield-expr.js new file mode 100644 index 0000000000000000000000000000000000000000..4a621fee498400c5c94864b8ecdc71039adc53e1 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/yield-expr.js @@ -0,0 +1,47 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (YieldExpression) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async] +features: [dynamic-import] +---*/ + +const a = './module-code_FIXTURE.js'; +const b = './module-code-other_FIXTURE.js'; + +function *g() { + return import(yield); +} + +async function *fn() { + let iter = g(); + iter.next(); + + const ns1 = await iter.next(a).value; + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); + + iter = g(); + iter.next(); + + const ns2 = await iter.next(b).value; + + assert.sameValue(ns2.local1, 'one six one two'); + assert.sameValue(ns2.default, 1612); +} + +fn().next(a).then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/yield-identifier.js b/test/language/module-code/dynamic-import/assign-expr/yield-identifier.js new file mode 100644 index 0000000000000000000000000000000000000000..1cc9799e0a706dbb11cae06027570dce99eda9b3 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/yield-identifier.js @@ -0,0 +1,31 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (IdentifierReference: yield) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +flags: [async, noStrict] +features: [dynamic-import] +---*/ + +const yield = './module-code_FIXTURE.js'; + +async function fn() { + const ns1 = await import(yield); + + assert.sameValue(ns1.local1, 'Test262'); + assert.sameValue(ns1.default, 42); +} + +fn().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/assign-expr/yield-star.js b/test/language/module-code/dynamic-import/assign-expr/yield-star.js new file mode 100644 index 0000000000000000000000000000000000000000..cebc9c9689007bfb60a7159361af3e9172e514c3 --- /dev/null +++ b/test/language/module-code/dynamic-import/assign-expr/yield-star.js @@ -0,0 +1,24 @@ +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: > + Dynamic Import receives an AssignmentExpression (yield [no LineTerminator here] AssignmentExpression) +esid: prod-ImportCall +info: | + ImportCall [Yield]: + import ( AssignmentExpression[+In, ?Yield] ) + + AssignmentExpression[In, Yield, Await]: + ConditionalExpression[?In, ?Yield, ?Await] + [+Yield]YieldExpression[?In, ?Await] + ArrowFunction[?In, ?Yield, ?Await] + AsyncArrowFunction[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await] + LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await] +features: [dynamic-import] +---*/ + +// Asserts valid syntax, return is not asserted for the undefined value of yield * +function *g() { + import(yield * ['Roberta Flack', 'Donny Hathaway', 'Frank Sinatra']); +}