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

945 lines
26 KiB
JSON

{
"type": "Script",
"span": {
"start": 30,
"end": 477,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 36,
"end": 37,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 30,
"end": 98,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 44,
"end": 64,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 54,
"end": 55,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 55,
"end": 63,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 57,
"end": 63,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": false,
"decorators": [],
"accessibility": "protected",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassProperty",
"span": {
"start": 69,
"end": 96,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 87,
"end": 95,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 89,
"end": 95,
"ctxt": 0
},
"kind": "string"
}
},
"isStatic": true,
"decorators": [],
"accessibility": "protected",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 106,
"end": 107,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 100,
"end": 477,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 124,
"end": 160,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 138,
"end": 139,
"ctxt": 0
},
"value": "y",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 124,
"end": 160,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 142,
"end": 160,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 144,
"end": 158,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 151,
"end": 157,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 151,
"end": 155,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 156,
"end": 157,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": "protected",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 165,
"end": 204,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 179,
"end": 180,
"ctxt": 0
},
"value": "y",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 181,
"end": 182,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 181,
"end": 182,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 165,
"end": 204,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 184,
"end": 204,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 186,
"end": 202,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 186,
"end": 201,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 186,
"end": 192,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 186,
"end": 190,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 191,
"end": 192,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"right": {
"type": "MemberExpression",
"span": {
"start": 195,
"end": 201,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 195,
"end": 199,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 200,
"end": 201,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": "protected",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 209,
"end": 243,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 219,
"end": 222,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 209,
"end": 243,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 225,
"end": 243,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 227,
"end": 241,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 234,
"end": 240,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 234,
"end": 238,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 239,
"end": 240,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "protected",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 248,
"end": 286,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 258,
"end": 261,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 248,
"end": 286,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 264,
"end": 286,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 266,
"end": 284,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 273,
"end": 283,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 273,
"end": 281,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 273,
"end": 277,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 278,
"end": 281,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "protected",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 292,
"end": 335,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 313,
"end": 314,
"ctxt": 0
},
"value": "y",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 292,
"end": 335,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 317,
"end": 335,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 319,
"end": 333,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 326,
"end": 332,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 326,
"end": 330,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 331,
"end": 332,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": true,
"accessibility": "protected",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 340,
"end": 386,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 361,
"end": 362,
"ctxt": 0
},
"value": "y",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 363,
"end": 364,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 363,
"end": 364,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 340,
"end": 386,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 366,
"end": 386,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 368,
"end": 384,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 368,
"end": 383,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 368,
"end": 374,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 368,
"end": 372,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 373,
"end": 374,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"right": {
"type": "MemberExpression",
"span": {
"start": 377,
"end": 383,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 377,
"end": 381,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 382,
"end": 383,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": true,
"accessibility": "protected",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 391,
"end": 432,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 408,
"end": 411,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 391,
"end": 432,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 414,
"end": 432,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 416,
"end": 430,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 423,
"end": 429,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 423,
"end": 427,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 428,
"end": 429,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": "protected",
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 437,
"end": 475,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 454,
"end": 457,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 437,
"end": 475,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 460,
"end": 475,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 462,
"end": 473,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 462,
"end": 472,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 462,
"end": 470,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 462,
"end": 466,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 467,
"end": 470,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": true,
"accessibility": "protected",
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"value": "B",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}