https://github.com/tc39/proposal-private-fields-in-in Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com> Co-Authored-By: Huáng Jùnliàng <jlhwung@gmail.com>
105 lines
4.1 KiB
JSON
105 lines
4.1 KiB
JSON
{
|
|
"type": "File",
|
|
"start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}},
|
|
"errors": [
|
|
"SyntaxError: Private names are only allowed in property accesses (`obj.#x`) or in `in` expressions (`#x in obj`) (4:7)"
|
|
],
|
|
"program": {
|
|
"type": "Program",
|
|
"start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}},
|
|
"sourceType": "script",
|
|
"interpreter": null,
|
|
"body": [
|
|
{
|
|
"type": "ClassDeclaration",
|
|
"start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"Foo"},
|
|
"name": "Foo"
|
|
},
|
|
"superClass": null,
|
|
"body": {
|
|
"type": "ClassBody",
|
|
"start":10,"end":50,"loc":{"start":{"line":1,"column":10},"end":{"line":6,"column":1}},
|
|
"body": [
|
|
{
|
|
"type": "ClassPrivateProperty",
|
|
"start":14,"end":21,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}},
|
|
"static": false,
|
|
"key": {
|
|
"type": "PrivateName",
|
|
"start":14,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start":15,"end":16,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"},
|
|
"name": "x"
|
|
}
|
|
},
|
|
"value": {
|
|
"type": "NumericLiteral",
|
|
"start":19,"end":20,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}},
|
|
"extra": {
|
|
"rawValue": 1,
|
|
"raw": "1"
|
|
},
|
|
"value": 1
|
|
}
|
|
},
|
|
{
|
|
"type": "ClassMethod",
|
|
"start":24,"end":48,"loc":{"start":{"line":3,"column":2},"end":{"line":5,"column":3}},
|
|
"static": false,
|
|
"key": {
|
|
"type": "Identifier",
|
|
"start":24,"end":28,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":6},"identifierName":"test"},
|
|
"name": "test"
|
|
},
|
|
"computed": false,
|
|
"kind": "method",
|
|
"id": null,
|
|
"generator": false,
|
|
"async": false,
|
|
"params": [],
|
|
"body": {
|
|
"type": "BlockStatement",
|
|
"start":31,"end":48,"loc":{"start":{"line":3,"column":9},"end":{"line":5,"column":3}},
|
|
"body": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"start":37,"end":44,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":11}},
|
|
"expression": {
|
|
"type": "BinaryExpression",
|
|
"start":37,"end":43,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":10}},
|
|
"left": {
|
|
"type": "PrivateName",
|
|
"start":37,"end":39,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":6}},
|
|
"id": {
|
|
"type": "Identifier",
|
|
"start":38,"end":39,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":6},"identifierName":"x"},
|
|
"name": "x"
|
|
}
|
|
},
|
|
"operator": "+",
|
|
"right": {
|
|
"type": "NumericLiteral",
|
|
"start":42,"end":43,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10}},
|
|
"extra": {
|
|
"rawValue": 1,
|
|
"raw": "1"
|
|
},
|
|
"value": 1
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"directives": []
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"directives": []
|
|
}
|
|
} |