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

1121 lines
27 KiB
JSON

{
"type": "Script",
"span": {
"start": 57,
"end": 481,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 63,
"end": 64,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 57,
"end": 279,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 71,
"end": 81,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 79,
"end": 80,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 86,
"end": 101,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 94,
"end": 95,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 98,
"end": 100,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 106,
"end": 129,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"value": "b",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 126,
"end": 128,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 115,
"end": 123,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 117,
"end": 123,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": false,
"decorators": [],
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 134,
"end": 159,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 142,
"end": 143,
"ctxt": 0
},
"value": "c",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 134,
"end": 159,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 146,
"end": 159,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 148,
"end": 157,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 155,
"end": 157,
"ctxt": 0
},
"value": "",
"raw": "''"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassProperty",
"span": {
"start": 164,
"end": 185,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 172,
"end": 173,
"ctxt": 0
},
"value": "d",
"optional": false
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 176,
"end": 184,
"ctxt": 0
},
"params": [],
"body": {
"type": "StringLiteral",
"span": {
"start": 182,
"end": 184,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 190,
"end": 207,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 205,
"end": 206,
"ctxt": 0
},
"value": "e",
"optional": false
},
"value": null,
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 212,
"end": 244,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 227,
"end": 228,
"ctxt": 0
},
"value": "f",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 212,
"end": 244,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 231,
"end": 244,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 233,
"end": 242,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 240,
"end": 242,
"ctxt": 0
},
"value": "",
"raw": "''"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassProperty",
"span": {
"start": 249,
"end": 277,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 264,
"end": 265,
"ctxt": 0
},
"value": "g",
"optional": false
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 268,
"end": 276,
"ctxt": 0
},
"params": [],
"body": {
"type": "StringLiteral",
"span": {
"start": 274,
"end": 276,
"ctxt": 0
},
"value": "",
"raw": "''"
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
},
"typeAnnotation": null,
"isStatic": true,
"decorators": [],
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 281,
"end": 297,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 285,
"end": 296,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 289,
"end": 296,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 293,
"end": 294,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 298,
"end": 319,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 302,
"end": 318,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 302,
"end": 304,
"ctxt": 0
},
"value": "r1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 304,
"end": 312,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 306,
"end": 312,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "MemberExpression",
"span": {
"start": 315,
"end": 318,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 315,
"end": 316,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 317,
"end": 318,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 320,
"end": 341,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 324,
"end": 340,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 324,
"end": 326,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 326,
"end": 334,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 328,
"end": 334,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "MemberExpression",
"span": {
"start": 337,
"end": 340,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 337,
"end": 338,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 339,
"end": 340,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 342,
"end": 363,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 346,
"end": 362,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 346,
"end": 348,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 348,
"end": 356,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 350,
"end": 356,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "MemberExpression",
"span": {
"start": 359,
"end": 362,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 359,
"end": 360,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 361,
"end": 362,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 364,
"end": 387,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 368,
"end": 386,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 368,
"end": 370,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 370,
"end": 378,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 372,
"end": 378,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 381,
"end": 386,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 381,
"end": 384,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 381,
"end": 382,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 383,
"end": 384,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 388,
"end": 411,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 392,
"end": 410,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 392,
"end": 394,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 394,
"end": 402,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 396,
"end": 402,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 405,
"end": 410,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 405,
"end": 408,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 405,
"end": 406,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 407,
"end": 408,
"ctxt": 0
},
"value": "d",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 412,
"end": 433,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 416,
"end": 432,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 416,
"end": 418,
"ctxt": 0
},
"value": "r6",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 418,
"end": 426,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 420,
"end": 426,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "MemberExpression",
"span": {
"start": 429,
"end": 432,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 429,
"end": 430,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 431,
"end": 432,
"ctxt": 0
},
"value": "e",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 434,
"end": 457,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 438,
"end": 456,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 438,
"end": 440,
"ctxt": 0
},
"value": "r7",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 440,
"end": 448,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 442,
"end": 448,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 451,
"end": 456,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 451,
"end": 454,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 451,
"end": 452,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 453,
"end": 454,
"ctxt": 0
},
"value": "f",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 458,
"end": 481,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 462,
"end": 480,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 462,
"end": 464,
"ctxt": 0
},
"value": "r8",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 464,
"end": 472,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 466,
"end": 472,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 475,
"end": 480,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 475,
"end": 478,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 475,
"end": 476,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 477,
"end": 478,
"ctxt": 0
},
"value": "g",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}