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

1081 lines
26 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 0,
"end": 535,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 6,
"end": 10,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"span": {
"start": 0,
"end": 145,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 17,
"end": 34,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 24,
"end": 25,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 25,
"end": 33,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 27,
"end": 33,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": false,
"decorators": [],
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 39,
"end": 85,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 46,
"end": 48,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 39,
"end": 85,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 59,
"end": 85,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 69,
"end": 79,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 76,
"end": 78,
"ctxt": 0
},
"value": "",
"raw": "''"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 50,
"end": 58,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 52,
"end": 58,
"ctxt": 0
},
"kind": "string"
}
}
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 91,
"end": 119,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 102,
"end": 103,
"ctxt": 0
},
"value": "a",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 91,
"end": 119,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 106,
"end": 119,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 108,
"end": 117,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 124,
"end": 143,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 135,
"end": 136,
"ctxt": 0
},
"value": "a",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 137,
"end": 138,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 137,
"end": 138,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 124,
"end": 143,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 140,
"end": 143,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 177,
"end": 184,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"span": {
"start": 171,
"end": 337,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 204,
"end": 222,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 212,
"end": 213,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 213,
"end": 221,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 215,
"end": 221,
"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": 228,
"end": 275,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 236,
"end": 238,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 228,
"end": 275,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 249,
"end": 275,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 259,
"end": 269,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 266,
"end": 268,
"ctxt": 0
},
"value": "",
"raw": "''"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 240,
"end": 248,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 242,
"end": 248,
"ctxt": 0
},
"kind": "string"
}
}
},
"kind": "method",
"isStatic": false,
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 281,
"end": 310,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 293,
"end": 294,
"ctxt": 0
},
"value": "a",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 281,
"end": 310,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 297,
"end": 310,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 299,
"end": 308,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 306,
"end": 307,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 315,
"end": 335,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 327,
"end": 328,
"ctxt": 0
},
"value": "a",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 329,
"end": 330,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 329,
"end": 330,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 315,
"end": 335,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 332,
"end": 335,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 193,
"end": 197,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 339,
"end": 354,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 343,
"end": 353,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 343,
"end": 344,
"ctxt": 0
},
"value": "r",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 347,
"end": 353,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 347,
"end": 351,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 352,
"end": 353,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 361,
"end": 380,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 365,
"end": 379,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 365,
"end": 367,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 370,
"end": 379,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 370,
"end": 377,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 378,
"end": 379,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 391,
"end": 410,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 395,
"end": 409,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 395,
"end": 397,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 400,
"end": 409,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 400,
"end": 407,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 400,
"end": 404,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 405,
"end": 407,
"ctxt": 0
},
"value": "fn",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 417,
"end": 439,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 421,
"end": 438,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 421,
"end": 423,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 426,
"end": 438,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 426,
"end": 436,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 426,
"end": 433,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 434,
"end": 436,
"ctxt": 0
},
"value": "fn",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 450,
"end": 466,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 454,
"end": 465,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 454,
"end": 456,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 459,
"end": 465,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 459,
"end": 463,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 464,
"end": 465,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 473,
"end": 484,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 473,
"end": 483,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 473,
"end": 479,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 473,
"end": 477,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 478,
"end": 479,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 482,
"end": 483,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 492,
"end": 511,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 496,
"end": 510,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 496,
"end": 498,
"ctxt": 0
},
"value": "r6",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 501,
"end": 510,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 501,
"end": 508,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 509,
"end": 510,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 521,
"end": 535,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 521,
"end": 534,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 521,
"end": 530,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 521,
"end": 528,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 529,
"end": 530,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 533,
"end": 534,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
}
],
"interpreter": null
}