Debian Codegraph @

js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/cover-parenthesized-expr.js

raw
1 // |reftest| async
2 // Copyright (C) 2018 Leo Balter. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 description: >
6 Dynamic Import receives an AssignmentExpression (CoverParenthesizedExpressionAndArrowParameterList)
7 esid: prod-ImportCall
8 info: |
9 ImportCall [Yield]:
10 import ( AssignmentExpression[+In, ?Yield] )
11
12 AssignmentExpression[In, Yield, Await]:
13 ConditionalExpression[?In, ?Yield, ?Await]
14 [+Yield]YieldExpression[?In, ?Await]
15 ArrowFunction[?In, ?Yield, ?Await]
16 AsyncArrowFunction[?In, ?Yield, ?Await]
17 LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
18 LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
19
20 CoverParenthesizedExpressionAndArrowParameterList[Yield, Await]:
21 (Expression[+In, ?Yield, ?Await])
22 flags: [async]
23 features: [dynamic-import]
24 includes: [asyncHelpers.js]
25 ---*/
26
27 async function fn() {
28 const ns1 = await import((((((('./module-code_FIXTURE.js'))))))); // import('./module-code_FIXTURE.js')
29
30 assert.sameValue(ns1.local1, 'Test262');
31 assert.sameValue(ns1.default, 42);
32
33 const ns2 = await import((1, 0, './module-code-other_FIXTURE.js')); // import('./module-code-other_FIXTURE.js')
34
35 assert.sameValue(ns2.local1, 'one six one two');
36 assert.sameValue(ns2.default, 1612);
37 }
38
39 asyncTest(fn);