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

1145 lines
28 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 58,
"end": 501,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 64,
"end": 65,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 58,
"end": 289,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 73,
"end": 83,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 81,
"end": 82,
"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": 89,
"end": 104,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 101,
"end": 103,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 110,
"end": 133,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 118,
"end": 119,
"ctxt": 0
},
"value": "b",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 130,
"end": 132,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 119,
"end": 127,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 121,
"end": 127,
"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": 139,
"end": 164,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 147,
"end": 148,
"ctxt": 0
},
"value": "c",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 139,
"end": 164,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 151,
"end": 164,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 153,
"end": 162,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 160,
"end": 162,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassProperty",
"span": {
"start": 170,
"end": 191,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 178,
"end": 179,
"ctxt": 0
},
"value": "d",
"optional": false
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 182,
"end": 190,
"ctxt": 0
},
"params": [],
"body": {
"type": "StringLiteral",
"span": {
"start": 188,
"end": 190,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"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": 197,
"end": 214,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 212,
"end": 213,
"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": 220,
"end": 252,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 235,
"end": 236,
"ctxt": 0
},
"value": "f",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 220,
"end": 252,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 239,
"end": 252,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 241,
"end": 250,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 248,
"end": 250,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassProperty",
"span": {
"start": 258,
"end": 286,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 273,
"end": 274,
"ctxt": 0
},
"value": "g",
"optional": false
},
"value": {
"type": "ArrowFunctionExpression",
"span": {
"start": 277,
"end": 285,
"ctxt": 0
},
"params": [],
"body": {
"type": "StringLiteral",
"span": {
"start": 283,
"end": 285,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"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": 293,
"end": 309,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 297,
"end": 308,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 297,
"end": 298,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 301,
"end": 308,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 305,
"end": 306,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 311,
"end": 332,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 315,
"end": 331,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 315,
"end": 317,
"ctxt": 0
},
"value": "r1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 317,
"end": 325,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 319,
"end": 325,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "MemberExpression",
"span": {
"start": 328,
"end": 331,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 328,
"end": 329,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 330,
"end": 331,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 334,
"end": 355,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 338,
"end": 354,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 338,
"end": 340,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 340,
"end": 348,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 342,
"end": 348,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "MemberExpression",
"span": {
"start": 351,
"end": 354,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 351,
"end": 352,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 353,
"end": 354,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 357,
"end": 378,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 361,
"end": 377,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 361,
"end": 363,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 363,
"end": 371,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 365,
"end": 371,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "MemberExpression",
"span": {
"start": 374,
"end": 377,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 374,
"end": 375,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 376,
"end": 377,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 380,
"end": 403,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 384,
"end": 402,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 384,
"end": 386,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 386,
"end": 394,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 388,
"end": 394,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 397,
"end": 402,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 397,
"end": 400,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 397,
"end": 398,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 399,
"end": 400,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 405,
"end": 428,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 409,
"end": 427,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 409,
"end": 411,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 411,
"end": 419,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 413,
"end": 419,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 422,
"end": 427,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 422,
"end": 425,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 422,
"end": 423,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 424,
"end": 425,
"ctxt": 0
},
"value": "d",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 430,
"end": 451,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 434,
"end": 450,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 434,
"end": 436,
"ctxt": 0
},
"value": "r6",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 436,
"end": 444,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 438,
"end": 444,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "MemberExpression",
"span": {
"start": 447,
"end": 450,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 447,
"end": 448,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 449,
"end": 450,
"ctxt": 0
},
"value": "e",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 453,
"end": 476,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 457,
"end": 475,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 457,
"end": 459,
"ctxt": 0
},
"value": "r7",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 459,
"end": 467,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 461,
"end": 467,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 470,
"end": 475,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 470,
"end": 473,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 470,
"end": 471,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 472,
"end": 473,
"ctxt": 0
},
"value": "f",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 478,
"end": 501,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 482,
"end": 500,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 482,
"end": 484,
"ctxt": 0
},
"value": "r8",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 484,
"end": 492,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 486,
"end": 492,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": {
"type": "CallExpression",
"span": {
"start": 495,
"end": 500,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 495,
"end": 498,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 495,
"end": 496,
"ctxt": 0
},
"value": "C",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 497,
"end": 498,
"ctxt": 0
},
"value": "g",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}