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

642 lines
18 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 35,
"end": 326,
"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": 326,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "PrivateMethod",
"span": {
"start": 50,
"end": 83,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 61,
"end": 66,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 62,
"end": 66,
"ctxt": 0
},
"value": "prop",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 50,
"end": 83,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 69,
"end": 83,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 71,
"end": 81,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 78,
"end": 80,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "PrivateMethod",
"span": {
"start": 88,
"end": 123,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 99,
"end": 104,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 100,
"end": 104,
"ctxt": 0
},
"value": "prop",
"optional": false
}
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 105,
"end": 118,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 105,
"end": 118,
"ctxt": 0
},
"value": "param",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 110,
"end": 118,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 112,
"end": 118,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 88,
"end": 123,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 120,
"end": 123,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "PrivateMethod",
"span": {
"start": 129,
"end": 164,
"ctxt": 0
},
"key": {
"type": "PrivateName",
"span": {
"start": 140,
"end": 147,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 141,
"end": 147,
"ctxt": 0
},
"value": "roProp",
"optional": false
}
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 129,
"end": 164,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 150,
"end": 164,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 152,
"end": 162,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 159,
"end": 161,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "Constructor",
"span": {
"start": 170,
"end": 324,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 170,
"end": 181,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "Parameter",
"span": {
"start": 182,
"end": 194,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 182,
"end": 194,
"ctxt": 0
},
"value": "name",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 186,
"end": 194,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 188,
"end": 194,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 196,
"end": 324,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 206,
"end": 220,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 206,
"end": 219,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 206,
"end": 214,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 206,
"end": 208,
"ctxt": 0
},
"value": "A1",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 209,
"end": 214,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 210,
"end": 214,
"ctxt": 0
},
"value": "prop",
"optional": false
}
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 217,
"end": 219,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 229,
"end": 245,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 229,
"end": 244,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 229,
"end": 239,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 229,
"end": 231,
"ctxt": 0
},
"value": "A1",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 232,
"end": 239,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 233,
"end": 239,
"ctxt": 0
},
"value": "roProp",
"optional": false
}
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 242,
"end": 244,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 263,
"end": 285,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 263,
"end": 284,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 263,
"end": 274,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 263,
"end": 270,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 271,
"end": 274,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 275,
"end": 283,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 275,
"end": 277,
"ctxt": 0
},
"value": "A1",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 278,
"end": 283,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 279,
"end": 283,
"ctxt": 0
},
"value": "prop",
"optional": false
}
}
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 294,
"end": 318,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 294,
"end": 317,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 294,
"end": 305,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 294,
"end": 301,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 302,
"end": 305,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 306,
"end": 316,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 306,
"end": 308,
"ctxt": 0
},
"value": "A1",
"optional": false
},
"property": {
"type": "PrivateName",
"span": {
"start": 309,
"end": 316,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 310,
"end": 316,
"ctxt": 0
},
"value": "roProp",
"optional": false
}
}
}
}
],
"typeArguments": null
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}