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

680 lines
17 KiB
JSON

{
"type": "Script",
"span": {
"start": 53,
"end": 511,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 59,
"end": 65,
"ctxt": 0
},
"value": "Animal",
"optional": false
},
"declare": false,
"span": {
"start": 53,
"end": 336,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 72,
"end": 111,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 72,
"end": 78,
"ctxt": 0
},
"value": "_sound",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 81,
"end": 111,
"ctxt": 0
},
"value": "rustling noise in the bushes",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 117,
"end": 151,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 121,
"end": 126,
"ctxt": 0
},
"value": "sound",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 117,
"end": 151,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 129,
"end": 151,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 131,
"end": 149,
"ctxt": 0
},
"argument": {
"type": "MemberExpression",
"span": {
"start": 138,
"end": 149,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 138,
"end": 142,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 143,
"end": 149,
"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": 156,
"end": 276,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 160,
"end": 165,
"ctxt": 0
},
"value": "sound",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 166,
"end": 169,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 166,
"end": 169,
"ctxt": 0
},
"value": "val",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 156,
"end": 276,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 171,
"end": 276,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 179,
"end": 197,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 179,
"end": 196,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 179,
"end": 190,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 179,
"end": 183,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 184,
"end": 190,
"ctxt": 0
},
"value": "_sound",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 193,
"end": 196,
"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": 282,
"end": 334,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 282,
"end": 291,
"ctxt": 0
},
"value": "makeSound",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 282,
"end": 334,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 294,
"end": 334,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 304,
"end": 328,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 304,
"end": 328,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 304,
"end": 315,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 304,
"end": 311,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 312,
"end": 315,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 316,
"end": 327,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 316,
"end": 320,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 321,
"end": 327,
"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": 338,
"end": 358,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 344,
"end": 358,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 348,
"end": 358,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 352,
"end": 358,
"ctxt": 0
},
"value": "Animal",
"optional": false
},
"arguments": null,
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 359,
"end": 372,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 359,
"end": 372,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 359,
"end": 370,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 359,
"end": 360,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 361,
"end": 370,
"ctxt": 0
},
"value": "makeSound",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 414,
"end": 418,
"ctxt": 0
},
"value": "Lion",
"optional": false
},
"declare": false,
"span": {
"start": 408,
"end": 471,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 440,
"end": 455,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 440,
"end": 445,
"ctxt": 0
},
"value": "sound",
"optional": false
},
"value": {
"type": "StringLiteral",
"span": {
"start": 448,
"end": 455,
"ctxt": 0
},
"value": "RAWR!",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 427,
"end": 433,
"ctxt": 0
},
"value": "Animal",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 473,
"end": 494,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 479,
"end": 494,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 479,
"end": 483,
"ctxt": 0
},
"value": "lion",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 486,
"end": 494,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 490,
"end": 494,
"ctxt": 0
},
"value": "Lion",
"optional": false
},
"arguments": null,
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 495,
"end": 511,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 495,
"end": 511,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 495,
"end": 509,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 495,
"end": 499,
"ctxt": 0
},
"value": "lion",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 500,
"end": 509,
"ctxt": 0
},
"value": "makeSound",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
],
"interpreter": null
}