* 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>
93 lines
3.8 KiB
JSON
93 lines
3.8 KiB
JSON
{
|
|
"type": "File",
|
|
"start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}},
|
|
"program": {
|
|
"type": "Program",
|
|
"start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}},
|
|
"sourceType": "script",
|
|
"interpreter": null,
|
|
"body": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}},
|
|
"expression": {
|
|
"type": "ArrowFunctionExpression",
|
|
"start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}},
|
|
"id": null,
|
|
"generator": false,
|
|
"async": true,
|
|
"params": [
|
|
{
|
|
"type": "AssignmentPattern",
|
|
"start":7,"end":46,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":46}},
|
|
"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":46,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":46}},
|
|
"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":43,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":43}},
|
|
"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":43,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":43}},
|
|
"id": null,
|
|
"superClass": null,
|
|
"body": {
|
|
"type": "ClassBody",
|
|
"start":32,"end":43,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":43}},
|
|
"body": [
|
|
{
|
|
"type": "ClassProperty",
|
|
"start":34,"end":41,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":41}},
|
|
"static": false,
|
|
"computed": true,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"start":35,"end":40,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":40},"identifierName":"await"},
|
|
"name": "await"
|
|
},
|
|
"value": null
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"start":44,"end":46,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":46}},
|
|
"body": [],
|
|
"directives": []
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"start":51,"end":53,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":53}},
|
|
"body": [],
|
|
"directives": []
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"directives": []
|
|
}
|
|
} |