Skip to content

Commit

Permalink
add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Dec 2, 2020
1 parent fa7866a commit d1cf0c6
Show file tree
Hide file tree
Showing 18 changed files with 480 additions and 62 deletions.
@@ -0,0 +1 @@
async () => (await 5) ** 6;
@@ -0,0 +1,56 @@
{
"type": "File",
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}},
"program": {
"type": "Program",
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}},
"expression": {
"type": "ArrowFunctionExpression",
"start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}},
"id": null,
"generator": false,
"async": true,
"params": [],
"body": {
"type": "BinaryExpression",
"start":12,"end":26,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}},
"left": {
"type": "ParenthesizedExpression",
"start":12,"end":21,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":21}},
"expression": {
"type": "AwaitExpression",
"start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}},
"argument": {
"type": "NumericLiteral",
"start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}},
"extra": {
"rawValue": 5,
"raw": "5"
},
"value": 5
}
}
},
"operator": "**",
"right": {
"type": "NumericLiteral",
"start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}},
"extra": {
"rawValue": 6,
"raw": "6"
},
"value": 6
}
}
}
}
],
"directives": []
}
}
@@ -0,0 +1 @@
async () => await 5 ** 6;
@@ -0,0 +1,55 @@
{
"type": "File",
"start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}},
"errors": [
"SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:18)"
],
"program": {
"type": "Program",
"start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}},
"expression": {
"type": "ArrowFunctionExpression",
"start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}},
"id": null,
"generator": false,
"async": true,
"params": [],
"body": {
"type": "BinaryExpression",
"start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}},
"left": {
"type": "AwaitExpression",
"start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19}},
"argument": {
"type": "NumericLiteral",
"start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}},
"extra": {
"rawValue": 5,
"raw": "5"
},
"value": 5
}
},
"operator": "**",
"right": {
"type": "NumericLiteral",
"start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}},
"extra": {
"rawValue": 6,
"raw": "6"
},
"value": 6
}
}
}
}
],
"directives": []
}
}
@@ -0,0 +1 @@
async () => await -5 ** 6;
@@ -0,0 +1,61 @@
{
"type": "File",
"start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}},
"errors": [
"SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:18)"
],
"program": {
"type": "Program",
"start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}},
"expression": {
"type": "ArrowFunctionExpression",
"start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}},
"id": null,
"generator": false,
"async": true,
"params": [],
"body": {
"type": "BinaryExpression",
"start":12,"end":25,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":25}},
"left": {
"type": "AwaitExpression",
"start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}},
"argument": {
"type": "UnaryExpression",
"start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}},
"operator": "-",
"prefix": true,
"argument": {
"type": "NumericLiteral",
"start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}},
"extra": {
"rawValue": 5,
"raw": "5"
},
"value": 5
}
}
},
"operator": "**",
"right": {
"type": "NumericLiteral",
"start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}},
"extra": {
"rawValue": 6,
"raw": "6"
},
"value": 6
}
}
}
}
],
"directives": []
}
}
@@ -0,0 +1,59 @@
{
"type": "File",
"start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}},
"errors": [
"SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)"
],
"program": {
"type": "Program",
"start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}},
"expression": {
"type": "BinaryExpression",
"start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}},
"extra": {
"parenthesized": true,
"parenStart": 0
},
"left": {
"type": "UnaryExpression",
"start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}},
"operator": "-",
"prefix": true,
"argument": {
"type": "UnaryExpression",
"start":2,"end":4,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":4}},
"operator": "+",
"prefix": true,
"argument": {
"type": "NumericLiteral",
"start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4}},
"extra": {
"rawValue": 5,
"raw": "5"
},
"value": 5
}
}
},
"operator": "**",
"right": {
"type": "NumericLiteral",
"start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9}},
"extra": {
"rawValue": 6,
"raw": "6"
},
"value": 6
}
}
}
],
"directives": []
}
}

This file was deleted.

This file was deleted.

@@ -0,0 +1 @@
async () => (await 5) ** 6;
@@ -0,0 +1,56 @@
{
"type": "File",
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}},
"program": {
"type": "Program",
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}},
"expression": {
"type": "ArrowFunctionExpression",
"start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}},
"id": null,
"generator": false,
"async": true,
"params": [],
"body": {
"type": "BinaryExpression",
"start":12,"end":26,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}},
"left": {
"type": "AwaitExpression",
"start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}},
"extra": {
"parenthesized": true,
"parenStart": 12
},
"argument": {
"type": "NumericLiteral",
"start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}},
"extra": {
"rawValue": 5,
"raw": "5"
},
"value": 5
}
},
"operator": "**",
"right": {
"type": "NumericLiteral",
"start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}},
"extra": {
"rawValue": 6,
"raw": "6"
},
"value": 6
}
}
}
}
],
"directives": []
}
}
@@ -0,0 +1 @@
async (a) => await a! ** 6;

0 comments on commit d1cf0c6

Please sign in to comment.