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

1145 lines
31 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 2135,
"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": 416,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 18,
"end": 45,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 35,
"end": 36,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 36,
"end": 44,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 38,
"end": 44,
"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": 50,
"end": 414,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 57,
"end": 69,
"ctxt": 0
},
"value": "staticMethod",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 50,
"end": 414,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 72,
"end": 414,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 82,
"end": 89,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 82,
"end": 88,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 82,
"end": 86,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 87,
"end": 88,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 151,
"end": 162,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 151,
"end": 161,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 151,
"end": 159,
"ctxt": 0
},
"value": "Derived1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 220,
"end": 231,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 220,
"end": 230,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 220,
"end": 228,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 229,
"end": 230,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 289,
"end": 300,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 289,
"end": 299,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 289,
"end": 297,
"ctxt": 0
},
"value": "Derived3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 298,
"end": 299,
"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": 424,
"end": 432,
"ctxt": 0
},
"value": "Derived1",
"optional": false
},
"declare": false,
"span": {
"start": 418,
"end": 882,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 452,
"end": 880,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 459,
"end": 472,
"ctxt": 0
},
"value": "staticMethod1",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 452,
"end": 880,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 475,
"end": 880,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 485,
"end": 492,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 485,
"end": 491,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 485,
"end": 489,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 490,
"end": 491,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 575,
"end": 586,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 575,
"end": 585,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 575,
"end": 583,
"ctxt": 0
},
"value": "Derived1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 584,
"end": 585,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 665,
"end": 676,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 665,
"end": 675,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 665,
"end": 673,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 674,
"end": 675,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 755,
"end": 766,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 755,
"end": 765,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 755,
"end": 763,
"ctxt": 0
},
"value": "Derived3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 764,
"end": 765,
"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": 441,
"end": 445,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 890,
"end": 898,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"declare": false,
"span": {
"start": 884,
"end": 1348,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 918,
"end": 1346,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 925,
"end": 938,
"ctxt": 0
},
"value": "staticMethod2",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 918,
"end": 1346,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 941,
"end": 1346,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 951,
"end": 958,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 951,
"end": 957,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 951,
"end": 955,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 956,
"end": 957,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1041,
"end": 1052,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1041,
"end": 1051,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1041,
"end": 1049,
"ctxt": 0
},
"value": "Derived1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1050,
"end": 1051,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1131,
"end": 1142,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1131,
"end": 1141,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1131,
"end": 1139,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1140,
"end": 1141,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1221,
"end": 1232,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1221,
"end": 1231,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1221,
"end": 1229,
"ctxt": 0
},
"value": "Derived3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1230,
"end": 1231,
"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": 907,
"end": 911,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 1356,
"end": 1364,
"ctxt": 0
},
"value": "Derived3",
"optional": false
},
"declare": false,
"span": {
"start": 1350,
"end": 1791,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 1388,
"end": 1415,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 1405,
"end": 1406,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 1406,
"end": 1414,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 1408,
"end": 1414,
"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": 1420,
"end": 1789,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 1427,
"end": 1440,
"ctxt": 0
},
"value": "staticMethod3",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 1420,
"end": 1789,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 1443,
"end": 1789,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 1453,
"end": 1460,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1453,
"end": 1459,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1453,
"end": 1457,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1458,
"end": 1459,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1543,
"end": 1554,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1543,
"end": 1553,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1543,
"end": 1551,
"ctxt": 0
},
"value": "Derived1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1552,
"end": 1553,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1633,
"end": 1644,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1633,
"end": 1643,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1633,
"end": 1641,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1642,
"end": 1643,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1723,
"end": 1734,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1723,
"end": 1733,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1723,
"end": 1731,
"ctxt": 0
},
"value": "Derived3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1732,
"end": 1733,
"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": 1373,
"end": 1381,
"ctxt": 0
},
"value": "Derived1",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ExpressionStatement",
"span": {
"start": 1794,
"end": 1801,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1794,
"end": 1800,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1794,
"end": 1798,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1799,
"end": 1800,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 1904,
"end": 1915,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 1904,
"end": 1914,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 1904,
"end": 1912,
"ctxt": 0
},
"value": "Derived1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 1913,
"end": 1914,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 2014,
"end": 2025,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 2014,
"end": 2024,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 2014,
"end": 2022,
"ctxt": 0
},
"value": "Derived2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 2023,
"end": 2024,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 2124,
"end": 2135,
"ctxt": 0
},
"expression": {
"type": "MemberExpression",
"span": {
"start": 2124,
"end": 2134,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 2124,
"end": 2132,
"ctxt": 0
},
"value": "Derived3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 2133,
"end": 2134,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
],
"interpreter": null
}