* refactor: inline parseMaybePrivateName * correct test case * perf: fast exit in checkExpressionErrors * refactor: add parseBindingProperty * fix: private property with variance * Update packages/babel-parser/src/parser/expression.js Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com> * chore: update testcase * refactor: remove refExpressionErrors for record/tuple They are always non-ambiguous. Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
69 lines
2.6 KiB
JSON
69 lines
2.6 KiB
JSON
{
|
|
"type": "File",
|
|
"start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}},
|
|
"program": {
|
|
"type": "Program",
|
|
"start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}},
|
|
"sourceType": "module",
|
|
"interpreter": null,
|
|
"body": [
|
|
{
|
|
"type": "ClassDeclaration",
|
|
"start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"A"},
|
|
"name": "A"
|
|
},
|
|
"superClass": null,
|
|
"body": {
|
|
"type": "ClassBody",
|
|
"start":8,"end":29,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}},
|
|
"body": [
|
|
{
|
|
"type": "ClassPrivateProperty",
|
|
"start":12,"end":18,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8}},
|
|
"static": false,
|
|
"variance": {
|
|
"type": "Variance",
|
|
"start":12,"end":13,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3}},
|
|
"kind": "plus"
|
|
},
|
|
"key": {
|
|
"type": "PrivateName",
|
|
"start":13,"end":17,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":7}},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start":14,"end":17,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"foo"},
|
|
"name": "foo"
|
|
}
|
|
},
|
|
"value": null
|
|
},
|
|
{
|
|
"type": "ClassPrivateProperty",
|
|
"start":21,"end":27,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8}},
|
|
"static": false,
|
|
"variance": {
|
|
"type": "Variance",
|
|
"start":21,"end":22,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3}},
|
|
"kind": "minus"
|
|
},
|
|
"key": {
|
|
"type": "PrivateName",
|
|
"start":22,"end":26,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":7}},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start":23,"end":26,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"bar"},
|
|
"name": "bar"
|
|
}
|
|
},
|
|
"value": null
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"directives": []
|
|
}
|
|
} |