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

84 lines
3.4 KiB
JSON

{
"type": "File",
"start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}},
"program": {
"type": "Program",
"start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ExpressionStatement",
"start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}},
"expression": {
"type": "ArrowFunctionExpression",
"start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}},
"id": null,
"generator": false,
"async": true,
"params": [
{
"type": "AssignmentPattern",
"start":7,"end":43,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":43}},
"left": {
"type": "Identifier",
"start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"x"},
"name": "x"
},
"right": {
"type": "FunctionExpression",
"start":11,"end":43,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":43}},
"id": {
"type": "Identifier",
"start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"f"},
"name": "f"
},
"generator": false,
"async": false,
"params": [
{
"type": "AssignmentPattern",
"start":22,"end":40,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":40}},
"left": {
"type": "Identifier",
"start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"x"},
"name": "x"
},
"right": {
"type": "ClassExpression",
"start":26,"end":40,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":40}},
"id": {
"type": "Identifier",
"start":32,"end":37,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":37},"identifierName":"await"},
"name": "await"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start":38,"end":40,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":40}},
"body": []
}
}
}
],
"body": {
"type": "BlockStatement",
"start":41,"end":43,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":43}},
"body": [],
"directives": []
}
}
}
],
"body": {
"type": "BlockStatement",
"start":48,"end":50,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":50}},
"body": [],
"directives": []
}
}
}
],
"directives": []
}
}