swc/crates/swc_ecma_parser/tests/tsc/privateNameAccessors.json

634 lines
18 KiB
JSON

{
"type": "Script",
"span": {
"start": 35,
"end": 313,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 41,
"end": 43,
"ctxt": 0
},
"value": "A1",
"optional": false
},
"declare": false,
"span": {
"start": 35,
"end": 313,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateMethod",
"span": {
"start": 50,
"end": 76,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 54,
"end": 59,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 55,
"end": 59,
"ctxt": 0
},
"value": "prop",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 50,
"end": 76,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 62,
"end": 76,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 64,
"end": 74,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 71,
"end": 73,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "PrivateMethod",
"span": {
"start": 81,
"end": 109,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 85,
"end": 90,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 86,
"end": 90,
"ctxt": 0
},
"value": "prop",
"optional": false
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 91,
"end": 104,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 91,
"end": 104,
"ctxt": 0
},
"value": "param",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 96,
"end": 104,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 98,
"end": 104,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 81,
"end": 109,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 106,
"end": 109,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "PrivateMethod",
"span": {
"start": 115,
"end": 143,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 119,
"end": 126,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 120,
"end": 126,
"ctxt": 0
},
"value": "roProp",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 115,
"end": 143,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 129,
"end": 143,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 131,
"end": 141,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 138,
"end": 140,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "Constructor",
"span": {
"start": 149,
"end": 311,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 149,
"end": 160,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 161,
"end": 173,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 161,
"end": 173,
"ctxt": 0
},
"value": "name",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 165,
"end": 173,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 167,
"end": 173,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 175,
"end": 311,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 185,
"end": 201,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 185,
"end": 200,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 185,
"end": 195,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 185,
"end": 189,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 190,
"end": 195,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 191,
"end": 195,
"ctxt": 0
},
"value": "prop",
"optional": false
}
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 198,
"end": 200,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 210,
"end": 228,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 210,
"end": 227,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 210,
"end": 222,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 210,
"end": 214,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 215,
"end": 222,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 216,
"end": 222,
"ctxt": 0
},
"value": "roProp",
"optional": false
}
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 225,
"end": 227,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 246,
"end": 270,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 246,
"end": 269,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 246,
"end": 257,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 246,
"end": 253,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 254,
"end": 257,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 258,
"end": 268,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 258,
"end": 262,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 263,
"end": 268,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 264,
"end": 268,
"ctxt": 0
},
"value": "prop",
"optional": false
}
}
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 279,
"end": 305,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 279,
"end": 304,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 279,
"end": 290,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 279,
"end": 286,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 287,
"end": 290,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 291,
"end": 303,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 291,
"end": 295,
"ctxt": 0
}
},
"property": {
"type": "PrivateName",
"span": {
"start": 296,
"end": 303,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 297,
"end": 303,
"ctxt": 0
},
"value": "roProp",
"optional": false
}
}
}
}
],
"typeArguments": null
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}