Skip to content

Commit

Permalink
chore: add test on await in computed class property
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Dec 31, 2019
1 parent 72211fa commit c026e2b
Show file tree
Hide file tree
Showing 2 changed files with 180 additions and 0 deletions.
@@ -0,0 +1,3 @@
async () => class {
[await 42]() { }
}
@@ -0,0 +1,177 @@
{
"type": "File",
"start": 0,
"end": 40,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 1
}
},
"program": {
"type": "Program",
"start": 0,
"end": 40,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 1
}
},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 40,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 1
}
},
"expression": {
"type": "ArrowFunctionExpression",
"start": 0,
"end": 40,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 3,
"column": 1
}
},
"id": null,
"generator": false,
"async": true,
"params": [],
"body": {
"type": "ClassExpression",
"start": 12,
"end": 40,
"loc": {
"start": {
"line": 1,
"column": 12
},
"end": {
"line": 3,
"column": 1
}
},
"id": null,
"superClass": null,
"body": {
"type": "ClassBody",
"start": 18,
"end": 40,
"loc": {
"start": {
"line": 1,
"column": 18
},
"end": {
"line": 3,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 22,
"end": 38,
"loc": {
"start": {
"line": 2,
"column": 2
},
"end": {
"line": 2,
"column": 18
}
},
"static": false,
"computed": true,
"key": {
"type": "AwaitExpression",
"start": 23,
"end": 31,
"loc": {
"start": {
"line": 2,
"column": 3
},
"end": {
"line": 2,
"column": 11
}
},
"argument": {
"type": "NumericLiteral",
"start": 29,
"end": 31,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 11
}
},
"extra": {
"rawValue": 42,
"raw": "42"
},
"value": 42
}
},
"kind": "method",
"id": null,
"generator": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 35,
"end": 38,
"loc": {
"start": {
"line": 2,
"column": 15
},
"end": {
"line": 2,
"column": 18
}
},
"body": [],
"directives": []
}
}
]
}
}
}
}
],
"directives": []
}
}

0 comments on commit c026e2b

Please sign in to comment.