Files
Huáng JùnliàngandGitHub 1a26111ab8 Support ESTree AccessorProperty (#17082)
* feat: create AccessorProperty for ESTree

* add new test cases

* add private key test case

* update Babel 8 test fixtures

* support AccessorProperty in eslint-*

* guard accessor property rename by classFeatures

* update parser options schema

* address review comments
2025-03-21 10:53:15 +01:00

70 lines
2.5 KiB
JSON

{
"type": "File",
"start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}},
"program": {
"type": "Program",
"start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}},
"sourceType": "script",
"interpreter": null,
"body": [
{
"type": "ClassDeclaration",
"start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"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":64,"loc":{"start":{"line":1,"column":8},"end":{"line":5,"column":1}},
"body": [
{
"type": "AccessorProperty",
"start":12,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}},
"static": false,
"key": {
"type": "Identifier",
"start":21,"end":24,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"foo"},
"name": "foo"
},
"computed": false,
"value": null
},
{
"type": "AccessorProperty",
"start":28,"end":45,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":19}},
"static": false,
"key": {
"type": "Identifier",
"start":37,"end":40,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":14},"identifierName":"bar"},
"name": "bar"
},
"computed": false,
"value": {
"type": "Literal",
"start":43,"end":44,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":18}},
"value": 0,
"raw": "0"
}
},
{
"type": "AccessorProperty",
"start":48,"end":62,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":16}},
"static": false,
"key": {
"type": "PrivateIdentifier",
"start":57,"end":61,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":15}},
"name": "qux"
},
"computed": false,
"value": null
}
]
}
}
]
}
}