Debian Codegraph @

js/src/tests/test262/language/module-code/top-level-await/await-expr-regexp.js

raw
1 // |reftest| module async
2 // Copyright (C) 2019 Leo Balter. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 description: >
7 Verify a RegularExpressionLiteral following an AwaitExpression is
8 not ambiguous to an Division
9 info: |
10 ModuleItem:
11 StatementListItem[~Yield, +Await, ~Return]
12
13 ...
14
15 UnaryExpression[Yield, Await]
16 [+Await]AwaitExpression[?Yield]
17
18 AwaitExpression[Yield]:
19 await UnaryExpression[?Yield, +Await]
20
21 ...
22
23 PrimaryExpression[Yield, Await]:
24 this
25 IdentifierReference[?Yield, ?Await]
26 Literal
27 ArrayLiteral[?Yield, ?Await]
28 ObjectLiteral[?Yield, ?Await]
29 FunctionExpression
30 ClassExpression[?Yield, ?Await]
31 GeneratorExpression
32 AsyncFunctionExpression
33 AsyncGeneratorExpression
34 RegularExpressionLiteral
35 TemplateLiteral[?Yield, ?Await, ~Tagged]
36 CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await]
37 esid: prod-AwaitExpression
38 flags: [module, async]
39 features: [top-level-await]
40 ---*/
41
42 var lol = false;
43 var x = {
44 get y() {
45 lol = true;
46 }
47 };
48
49 var g = 42;
50
51 await /x.y/g;
52
53 if (lol) {
54 $DONE('It should be a RegExp');
55 } else {
56 $DONE();
57 }