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

1081 lines
26 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 536,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 7,
"end": 11,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"span": {
"start": 1,
"end": 146,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 18,
"end": 35,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 25,
"end": 26,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 26,
"end": 34,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 28,
"end": 34,
"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": 40,
"end": 86,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 47,
"end": 49,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 40,
"end": 86,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 60,
"end": 86,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 70,
"end": 80,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 77,
"end": 79,
"ctxt": 0
},
"value": "",
"raw": "''"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 51,
"end": 59,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 53,
"end": 59,
"ctxt": 0
},
"kind": "string"
}
}
},
"kind": "method",
"isStatic": false,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 92,
"end": 120,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 103,
"end": 104,
"ctxt": 0
},
"value": "a",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 92,
"end": 120,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 107,
"end": 120,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 109,
"end": 118,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 116,
"end": 117,
"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": 125,
"end": 144,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 136,
"end": 137,
"ctxt": 0
},
"value": "a",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 138,
"end": 139,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 138,
"end": 139,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 125,
"end": 144,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 141,
"end": 144,
"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": 178,
"end": 185,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"span": {
"start": 172,
"end": 338,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 205,
"end": 223,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 213,
"end": 214,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 214,
"end": 222,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 216,
"end": 222,
"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": 229,
"end": 276,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 237,
"end": 239,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 229,
"end": 276,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 250,
"end": 276,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 260,
"end": 270,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 267,
"end": 269,
"ctxt": 0
},
"value": "",
"raw": "''"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 241,
"end": 249,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 243,
"end": 249,
"ctxt": 0
},
"kind": "string"
}
}
},
"kind": "method",
"isStatic": false,
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 282,
"end": 311,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 294,
"end": 295,
"ctxt": 0
},
"value": "a",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 282,
"end": 311,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 298,
"end": 311,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 300,
"end": 309,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 307,
"end": 308,
"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": 316,
"end": 336,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 328,
"end": 329,
"ctxt": 0
},
"value": "a",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 330,
"end": 331,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 330,
"end": 331,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 316,
"end": 336,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 333,
"end": 336,
"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": 194,
"end": 198,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 340,
"end": 355,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 344,
"end": 354,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"value": "r",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 348,
"end": 354,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 348,
"end": 352,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 353,
"end": 354,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 362,
"end": 381,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 366,
"end": 380,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 366,
"end": 368,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 371,
"end": 380,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 371,
"end": 378,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 379,
"end": 380,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 392,
"end": 411,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 396,
"end": 410,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 396,
"end": 398,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 401,
"end": 410,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 401,
"end": 408,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 401,
"end": 405,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 406,
"end": 408,
"ctxt": 0
},
"value": "fn",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 418,
"end": 440,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 422,
"end": 439,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 422,
"end": 424,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 427,
"end": 439,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 427,
"end": 437,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 427,
"end": 434,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 435,
"end": 437,
"ctxt": 0
},
"value": "fn",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 451,
"end": 467,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 455,
"end": 466,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 455,
"end": 457,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 460,
"end": 466,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 460,
"end": 464,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 465,
"end": 466,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 474,
"end": 485,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 474,
"end": 484,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 474,
"end": 480,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 474,
"end": 478,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 479,
"end": 480,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 483,
"end": 484,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 493,
"end": 512,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 497,
"end": 511,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 497,
"end": 499,
"ctxt": 0
},
"value": "r6",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 502,
"end": 511,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 502,
"end": 509,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 510,
"end": 511,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 522,
"end": 536,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 522,
"end": 535,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 522,
"end": 531,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 522,
"end": 529,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 530,
"end": 531,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 534,
"end": 535,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
}
],
"interpreter": null
}