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

62 lines
2.2 KiB
JSON

{
"type": "File",
"start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}},
"program": {
"type": "Program",
"start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "FunctionDeclaration",
"start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":39}},
"id": {
"type": "Identifier",
"start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"fn"},
"name": "fn"
},
"generator": false,
"async": false,
"params": [
{
"type": "AssignmentPattern",
"start":12,"end":35,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":35}},
"left": {
"type": "Identifier",
"start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"},
"name": "x"
},
"right": {
"type": "ArrowFunctionExpression",
"start":16,"end":35,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":35}},
"id": null,
"generator": false,
"async": true,
"params": [],
"body": {
"type": "AwaitExpression",
"start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35}},
"argument": {
"type": "NumericLiteral",
"start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35}},
"extra": {
"rawValue": 1,
"raw": "1"
},
"value": 1
}
}
}
}
],
"body": {
"type": "BlockStatement",
"start":37,"end":39,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":39}},
"body": [],
"directives": []
}
}
],
"directives": []
}
}