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

672 lines
17 KiB
JSON

{
"type": "Script",
"span": {
"start": 54,
"end": 512,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 60,
"end": 66,
"ctxt": 0
},
"value": "Animal",
"optional": false
},
"declare": false,
"span": {
"start": 54,
"end": 337,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 73,
"end": 112,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 73,
"end": 79,
"ctxt": 0
},
"value": "_sound",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 82,
"end": 112,
"ctxt": 0
},
"value": "rustling noise in the bushes",
"raw": "'rustling noise in the bushes'"
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 118,
"end": 152,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 122,
"end": 127,
"ctxt": 0
},
"value": "sound",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 118,
"end": 152,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 130,
"end": 152,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 132,
"end": 150,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 139,
"end": 150,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 139,
"end": 143,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 144,
"end": 150,
"ctxt": 0
},
"value": "_sound",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 157,
"end": 277,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 161,
"end": 166,
"ctxt": 0
},
"value": "sound",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 167,
"end": 170,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 167,
"end": 170,
"ctxt": 0
},
"value": "val",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 157,
"end": 277,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 172,
"end": 277,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 180,
"end": 198,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 180,
"end": 197,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 180,
"end": 191,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 180,
"end": 184,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 185,
"end": 191,
"ctxt": 0
},
"value": "_sound",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 194,
"end": 197,
"ctxt": 0
},
"value": "val",
"optional": false
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 283,
"end": 335,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 283,
"end": 292,
"ctxt": 0
},
"value": "makeSound",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 283,
"end": 335,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 295,
"end": 335,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 305,
"end": 329,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 305,
"end": 329,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 305,
"end": 316,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 305,
"end": 312,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 313,
"end": 316,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 317,
"end": 328,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 317,
"end": 321,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 322,
"end": 328,
"ctxt": 0
},
"value": "_sound",
"optional": false
}
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 339,
"end": 359,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 345,
"end": 359,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 345,
"end": 346,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 349,
"end": 359,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 353,
"end": 359,
"ctxt": 0
},
"value": "Animal",
"optional": false
},
"arguments": null,
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 360,
"end": 373,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 360,
"end": 373,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 360,
"end": 371,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 360,
"end": 361,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 362,
"end": 371,
"ctxt": 0
},
"value": "makeSound",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 415,
"end": 419,
"ctxt": 0
},
"value": "Lion",
"optional": false
},
"declare": false,
"span": {
"start": 409,
"end": 472,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 441,
"end": 456,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 441,
"end": 446,
"ctxt": 0
},
"value": "sound",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 449,
"end": 456,
"ctxt": 0
},
"value": "RAWR!",
"raw": "'RAWR!'"
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 428,
"end": 434,
"ctxt": 0
},
"value": "Animal",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 474,
"end": 495,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 480,
"end": 495,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 480,
"end": 484,
"ctxt": 0
},
"value": "lion",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 487,
"end": 495,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 491,
"end": 495,
"ctxt": 0
},
"value": "Lion",
"optional": false
},
"arguments": null,
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 496,
"end": 512,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 496,
"end": 512,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 496,
"end": 510,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 496,
"end": 500,
"ctxt": 0
},
"value": "lion",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 501,
"end": 510,
"ctxt": 0
},
"value": "makeSound",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
],
"interpreter": null
}