Skip to content

Commit

Permalink
add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jan 29, 2021
1 parent 5be2092 commit 4ddaabb
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 16 deletions.
Expand Up @@ -59,7 +59,6 @@
},
"generator": false,
"async": false,
"expression": false,
"params": [],
"body": {
"type": "BlockStatement",
Expand All @@ -74,7 +73,8 @@
"name": "await"
}
}
]
],
"directives": []
}
}
]
Expand Down Expand Up @@ -119,7 +119,6 @@
},
"generator": false,
"async": false,
"expression": false,
"params": [
{
"type": "Identifier",
Expand All @@ -130,7 +129,8 @@
"body": {
"type": "BlockStatement",
"start":97,"end":99,"loc":{"start":{"line":5,"column":39},"end":{"line":5,"column":41}},
"body": []
"body": [],
"directives": []
}
}
]
Expand Down Expand Up @@ -175,7 +175,6 @@
},
"generator": false,
"async": false,
"expression": false,
"params": [
{
"type": "AssignmentPattern",
Expand All @@ -195,7 +194,8 @@
"body": {
"type": "BlockStatement",
"start":149,"end":151,"loc":{"start":{"line":7,"column":43},"end":{"line":7,"column":45}},
"body": []
"body": [],
"directives": []
}
}
]
Expand Down Expand Up @@ -240,14 +240,13 @@
},
"generator": false,
"async": false,
"expression": false,
"params": [
{
"type": "ObjectPattern",
"start":190,"end":204,"loc":{"start":{"line":9,"column":32},"end":{"line":9,"column":46}},
"properties": [
{
"type": "Property",
"type": "ObjectProperty",
"start":192,"end":202,"loc":{"start":{"line":9,"column":34},"end":{"line":9,"column":44}},
"method": false,
"computed": true,
Expand All @@ -261,16 +260,16 @@
"type": "Identifier",
"start":201,"end":202,"loc":{"start":{"line":9,"column":43},"end":{"line":9,"column":44},"identifierName":"x"},
"name": "x"
},
"kind": "init"
}
}
]
}
],
"body": {
"type": "BlockStatement",
"start":206,"end":208,"loc":{"start":{"line":9,"column":48},"end":{"line":9,"column":50}},
"body": []
"body": [],
"directives": []
}
}
]
Expand All @@ -280,6 +279,7 @@
}
}
}
]
],
"directives": []
}
}
Expand Up @@ -21,3 +21,7 @@ C = class { static { async ({ [await]: x}) => {} } };
C = class { static { async ({ [await]: x}) } };

async (x = class { static { await } }) => {};

C = class { static { function await() {} } };

C = class { static { await: 0 } };
@@ -1,6 +1,6 @@
{
"type": "File",
"start":0,"end":485,"loc":{"start":{"line":1,"column":0},"end":{"line":23,"column":45}},
"start":0,"end":568,"loc":{"start":{"line":1,"column":0},"end":{"line":27,"column":34}},
"errors": [
"SyntaxError: Can not use 'await' as identifier inside a static block (3:21)",
"SyntaxError: Can not use 'await' as identifier inside a static block (5:27)",
Expand All @@ -12,11 +12,13 @@
"SyntaxError: Can not use 'await' as identifier inside a static block (17:25)",
"SyntaxError: Can not use 'await' as identifier inside a static block (19:31)",
"SyntaxError: Can not use 'await' as identifier inside a static block (21:31)",
"SyntaxError: Can not use 'await' as identifier inside a static block (23:28)"
"SyntaxError: Can not use 'await' as identifier inside a static block (23:28)",
"SyntaxError: Can not use 'await' as identifier inside a static block (25:30)",
"SyntaxError: Can not use 'await' as identifier inside a static block (27:21)"
],
"program": {
"type": "Program",
"start":0,"end":485,"loc":{"start":{"line":1,"column":0},"end":{"line":23,"column":45}},
"start":0,"end":568,"loc":{"start":{"line":1,"column":0},"end":{"line":27,"column":34}},
"sourceType": "script",
"interpreter": null,
"body": [
Expand Down Expand Up @@ -671,8 +673,112 @@
"directives": []
}
}
},
{
"type": "ExpressionStatement",
"start":487,"end":532,"loc":{"start":{"line":25,"column":0},"end":{"line":25,"column":45}},
"expression": {
"type": "AssignmentExpression",
"start":487,"end":531,"loc":{"start":{"line":25,"column":0},"end":{"line":25,"column":44}},
"operator": "=",
"left": {
"type": "Identifier",
"start":487,"end":488,"loc":{"start":{"line":25,"column":0},"end":{"line":25,"column":1},"identifierName":"C"},
"name": "C"
},
"right": {
"type": "ClassExpression",
"start":491,"end":531,"loc":{"start":{"line":25,"column":4},"end":{"line":25,"column":44}},
"id": null,
"superClass": null,
"body": {
"type": "ClassBody",
"start":497,"end":531,"loc":{"start":{"line":25,"column":10},"end":{"line":25,"column":44}},
"body": [
{
"type": "StaticBlock",
"start":499,"end":529,"loc":{"start":{"line":25,"column":12},"end":{"line":25,"column":42}},
"body": [
{
"type": "FunctionDeclaration",
"start":508,"end":527,"loc":{"start":{"line":25,"column":21},"end":{"line":25,"column":40}},
"id": {
"type": "Identifier",
"start":517,"end":522,"loc":{"start":{"line":25,"column":30},"end":{"line":25,"column":35},"identifierName":"await"},
"name": "await"
},
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start":525,"end":527,"loc":{"start":{"line":25,"column":38},"end":{"line":25,"column":40}},
"body": [],
"directives": []
}
}
]
}
]
}
}
}
},
{
"type": "ExpressionStatement",
"start":534,"end":568,"loc":{"start":{"line":27,"column":0},"end":{"line":27,"column":34}},
"expression": {
"type": "AssignmentExpression",
"start":534,"end":567,"loc":{"start":{"line":27,"column":0},"end":{"line":27,"column":33}},
"operator": "=",
"left": {
"type": "Identifier",
"start":534,"end":535,"loc":{"start":{"line":27,"column":0},"end":{"line":27,"column":1},"identifierName":"C"},
"name": "C"
},
"right": {
"type": "ClassExpression",
"start":538,"end":567,"loc":{"start":{"line":27,"column":4},"end":{"line":27,"column":33}},
"id": null,
"superClass": null,
"body": {
"type": "ClassBody",
"start":544,"end":567,"loc":{"start":{"line":27,"column":10},"end":{"line":27,"column":33}},
"body": [
{
"type": "StaticBlock",
"start":546,"end":565,"loc":{"start":{"line":27,"column":12},"end":{"line":27,"column":31}},
"body": [
{
"type": "LabeledStatement",
"start":555,"end":563,"loc":{"start":{"line":27,"column":21},"end":{"line":27,"column":29}},
"body": {
"type": "ExpressionStatement",
"start":562,"end":563,"loc":{"start":{"line":27,"column":28},"end":{"line":27,"column":29}},
"expression": {
"type": "NumericLiteral",
"start":562,"end":563,"loc":{"start":{"line":27,"column":28},"end":{"line":27,"column":29}},
"extra": {
"rawValue": 0,
"raw": "0"
},
"value": 0
}
},
"label": {
"type": "Identifier",
"start":555,"end":560,"loc":{"start":{"line":27,"column":21},"end":{"line":27,"column":26},"identifierName":"await"},
"name": "await"
}
}
]
}
]
}
}
}
}
],
"directives": []
}
}
}

0 comments on commit 4ddaabb

Please sign in to comment.