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

470 lines
12 KiB
JSON

{
"type": "Script",
"span": {
"start": 54,
"end": 279,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 60,
"end": 64,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"span": {
"start": 54,
"end": 77,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 69,
"end": 75,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 69,
"end": 70,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 73,
"end": 74,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"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": 85,
"end": 92,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"span": {
"start": 79,
"end": 212,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 110,
"end": 131,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"value": "x",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 110,
"end": 131,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 118,
"end": 131,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 120,
"end": 129,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 127,
"end": 128,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
]
},
"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": 210,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"value": "x",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 162,
"end": 167,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 162,
"end": 167,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 156,
"end": 210,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 169,
"end": 210,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 171,
"end": 208,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 171,
"end": 207,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 171,
"end": 182,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 171,
"end": 178,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 179,
"end": 182,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "TemplateLiteral",
"span": {
"start": 183,
"end": 206,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 199,
"end": 204,
"ctxt": 0
},
"value": "value",
"optional": false
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 184,
"end": 197,
"ctxt": 0
},
"tail": false,
"cooked": "x was set to ",
"raw": "x was set to "
},
{
"type": "TemplateElement",
"span": {
"start": 205,
"end": 205,
"ctxt": 0
},
"tail": true,
"cooked": "",
"raw": ""
}
]
}
}
],
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "setter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 101,
"end": 105,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 214,
"end": 240,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 220,
"end": 239,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 220,
"end": 223,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 226,
"end": 239,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 230,
"end": 237,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 260,
"end": 279,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 260,
"end": 278,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 260,
"end": 271,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 260,
"end": 267,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 268,
"end": 271,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 272,
"end": 277,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 272,
"end": 275,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 276,
"end": 277,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}