Huáng Jùnliàng 2782a549e9
Refactor yield await classification (#12230)
* fix: incomplete ParamKind declaration

* refactor: add expression scope handler

* test: update test262 allowlist

* chore: cleanup

* fix: push expression scope for function body

* fix: push new expression scope for initializer and static block

* test: add more test cases

* fix flow error

* refactor: remove unecessary expression scope

* fix: parameter initializer error should not cross expression scope boundary

* chore: cleanup outdated comments

* fix: do not record async arrow error on ParameterDeclaration

* Update packages/babel-parser/src/util/expression-scope.js

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>

* polish: clear ancestry declaration error on validate

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-10-26 11:42:02 -04:00

66 lines
2.6 KiB
JSON

{
"type": "File",
"start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},
"program": {
"type": "Program",
"start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},
"expression": {
"type": "CallExpression",
"start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}},
"callee": {
"type": "Identifier",
"start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"async"},
"name": "async"
},
"arguments": [
{
"type": "AssignmentExpression",
"start":7,"end":32,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":32}},
"operator": "=",
"left": {
"type": "Identifier",
"start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"x"},
"name": "x"
},
"right": {
"type": "ClassExpression",
"start":11,"end":32,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":32}},
"id": null,
"superClass": null,
"body": {
"type": "ClassBody",
"start":17,"end":32,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":32}},
"body": [
{
"type": "ClassProperty",
"start":19,"end":30,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":30}},
"static": false,
"computed": true,
"key": {
"type": "Identifier",
"start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"await"},
"name": "await"
},
"value": {
"type": "Identifier",
"start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"x"},
"name": "x"
}
}
]
}
}
}
]
}
}
],
"directives": []
}
}