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

1077 lines
25 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 0,
"end": 600,
"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": 173,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 17,
"end": 41,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 31,
"end": 32,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 32,
"end": 40,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 34,
"end": 40,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": true,
"decorators": [],
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 46,
"end": 99,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 60,
"end": 62,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 46,
"end": 99,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 73,
"end": 99,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 83,
"end": 93,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 90,
"end": 92,
"ctxt": 0
},
"value": "",
"raw": "''"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 64,
"end": 72,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 66,
"end": 72,
"ctxt": 0
},
"kind": "string"
}
}
},
"kind": "method",
"isStatic": true,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 105,
"end": 140,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 123,
"end": 124,
"ctxt": 0
},
"value": "a",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 105,
"end": 140,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 127,
"end": 140,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 129,
"end": 138,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 136,
"end": 137,
"ctxt": 0
},
"value": 1.0
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": true,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 145,
"end": 171,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 163,
"end": 164,
"ctxt": 0
},
"value": "a",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 145,
"end": 171,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 168,
"end": 171,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": true,
"accessibility": "public",
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 214,
"end": 221,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"span": {
"start": 208,
"end": 402,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 241,
"end": 266,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 256,
"end": 257,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 257,
"end": 265,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 259,
"end": 265,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": true,
"decorators": [],
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 272,
"end": 326,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 287,
"end": 289,
"ctxt": 0
},
"value": "fn",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 272,
"end": 326,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 300,
"end": 326,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 310,
"end": 320,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 317,
"end": 319,
"ctxt": 0
},
"value": "",
"raw": "''"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 291,
"end": 299,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 293,
"end": 299,
"ctxt": 0
},
"kind": "string"
}
}
},
"kind": "method",
"isStatic": true,
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 332,
"end": 368,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 351,
"end": 352,
"ctxt": 0
},
"value": "a",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 332,
"end": 368,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 355,
"end": 368,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 357,
"end": 366,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 364,
"end": 365,
"ctxt": 0
},
"value": 1.0
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": true,
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 373,
"end": 400,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 392,
"end": 393,
"ctxt": 0
},
"value": "a",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 394,
"end": 395,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 394,
"end": 395,
"ctxt": 0
},
"value": "v",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 373,
"end": 400,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 397,
"end": 400,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": true,
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 230,
"end": 234,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 404,
"end": 419,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 408,
"end": 418,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 408,
"end": 409,
"ctxt": 0
},
"value": "r",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 412,
"end": 418,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 412,
"end": 416,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 417,
"end": 418,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 426,
"end": 445,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 430,
"end": 444,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 430,
"end": 432,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 435,
"end": 444,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 435,
"end": 442,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 443,
"end": 444,
"ctxt": 0
},
"value": "x",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 456,
"end": 475,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 460,
"end": 474,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 460,
"end": 462,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 465,
"end": 474,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 465,
"end": 472,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 465,
"end": 469,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 470,
"end": 472,
"ctxt": 0
},
"value": "fn",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 482,
"end": 504,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 486,
"end": 503,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 486,
"end": 488,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 491,
"end": 503,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 491,
"end": 501,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 491,
"end": 498,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 499,
"end": 501,
"ctxt": 0
},
"value": "fn",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 515,
"end": 531,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 519,
"end": 530,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 519,
"end": 521,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 524,
"end": 530,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 524,
"end": 528,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 529,
"end": 530,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 538,
"end": 549,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 538,
"end": 548,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 538,
"end": 544,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 538,
"end": 542,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 543,
"end": 544,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 547,
"end": 548,
"ctxt": 0
},
"value": 2.0
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 557,
"end": 576,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 561,
"end": 575,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 561,
"end": 563,
"ctxt": 0
},
"value": "r6",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 566,
"end": 575,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 566,
"end": 573,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 574,
"end": 575,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 586,
"end": 600,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 586,
"end": 599,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 586,
"end": 595,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 586,
"end": 593,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 594,
"end": 595,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 598,
"end": 599,
"ctxt": 0
},
"value": 2.0
}
}
}
],
"interpreter": null
}