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

1145 lines
31 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 2134,
"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": 415,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 17,
"end": 44,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 34,
"end": 35,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 35,
"end": 43,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 37,
"end": 43,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": true,
"decorators": [],
"accessibility": "protected",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 49,
"end": 413,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 56,
"end": 68,
"ctxt": 0
},
"value": "staticMethod",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 49,
"end": 413,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 71,
"end": 413,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 81,
"end": 88,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 81,
"end": 87,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 81,
"end": 85,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 150,
"end": 161,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 150,
"end": 160,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 150,
"end": 158,
"ctxt": 0
},
"value": "Derived1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 159,
"end": 160,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 219,
"end": 230,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 219,
"end": 229,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 219,
"end": 227,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 228,
"end": 229,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 288,
"end": 299,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 288,
"end": 298,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 288,
"end": 296,
"ctxt": 0
},
"value": "Derived3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 297,
"end": 298,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 423,
"end": 431,
"ctxt": 0
},
"value": "Derived1",
"optional": false
},
"declare": false,
"span": {
"start": 417,
"end": 881,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 451,
"end": 879,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 458,
"end": 471,
"ctxt": 0
},
"value": "staticMethod1",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 451,
"end": 879,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 474,
"end": 879,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 484,
"end": 491,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 484,
"end": 490,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 484,
"end": 488,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 489,
"end": 490,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 574,
"end": 585,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 574,
"end": 584,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 574,
"end": 582,
"ctxt": 0
},
"value": "Derived1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 583,
"end": 584,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 664,
"end": 675,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 664,
"end": 674,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 664,
"end": 672,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 673,
"end": 674,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 754,
"end": 765,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 754,
"end": 764,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 754,
"end": 762,
"ctxt": 0
},
"value": "Derived3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 763,
"end": 764,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 440,
"end": 444,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 889,
"end": 897,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"declare": false,
"span": {
"start": 883,
"end": 1347,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 917,
"end": 1345,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 924,
"end": 937,
"ctxt": 0
},
"value": "staticMethod2",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 917,
"end": 1345,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 940,
"end": 1345,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 950,
"end": 957,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 950,
"end": 956,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 950,
"end": 954,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 955,
"end": 956,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1040,
"end": 1051,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1040,
"end": 1050,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1040,
"end": 1048,
"ctxt": 0
},
"value": "Derived1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1049,
"end": 1050,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1130,
"end": 1141,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1130,
"end": 1140,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1130,
"end": 1138,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1139,
"end": 1140,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1220,
"end": 1231,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1220,
"end": 1230,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1220,
"end": 1228,
"ctxt": 0
},
"value": "Derived3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1229,
"end": 1230,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 906,
"end": 910,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1355,
"end": 1363,
"ctxt": 0
},
"value": "Derived3",
"optional": false
},
"declare": false,
"span": {
"start": 1349,
"end": 1790,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 1387,
"end": 1414,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 1404,
"end": 1405,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1405,
"end": 1413,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1407,
"end": 1413,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": true,
"decorators": [],
"accessibility": "protected",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 1419,
"end": 1788,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 1426,
"end": 1439,
"ctxt": 0
},
"value": "staticMethod3",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 1419,
"end": 1788,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1442,
"end": 1788,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1452,
"end": 1459,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1452,
"end": 1458,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1452,
"end": 1456,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1457,
"end": 1458,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1542,
"end": 1553,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1542,
"end": 1552,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1542,
"end": 1550,
"ctxt": 0
},
"value": "Derived1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1551,
"end": 1552,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1632,
"end": 1643,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1632,
"end": 1642,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1632,
"end": 1640,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1641,
"end": 1642,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1722,
"end": 1733,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1722,
"end": 1732,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1722,
"end": 1730,
"ctxt": 0
},
"value": "Derived3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1731,
"end": 1732,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 1372,
"end": 1380,
"ctxt": 0
},
"value": "Derived1",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ExpressionStatement",
"span": {
"start": 1793,
"end": 1800,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1793,
"end": 1799,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1793,
"end": 1797,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1798,
"end": 1799,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1903,
"end": 1914,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1903,
"end": 1913,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1903,
"end": 1911,
"ctxt": 0
},
"value": "Derived1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1912,
"end": 1913,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 2013,
"end": 2024,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 2013,
"end": 2023,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 2013,
"end": 2021,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 2022,
"end": 2023,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 2123,
"end": 2134,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 2123,
"end": 2133,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 2123,
"end": 2131,
"ctxt": 0
},
"value": "Derived3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 2132,
"end": 2133,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
],
"interpreter": null
}