swc/crates/swc_ecma_parser/tests/tsc/propertyOverridesAccessors2.json
2022-03-22 07:54:08 +00:00

468 lines
12 KiB
JSON

{
"type": "Script",
"span": {
"start": 53,
"end": 264,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 59,
"end": 63,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"span": {
"start": 53,
"end": 148,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 68,
"end": 89,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 72,
"end": 73,
"ctxt": 0
},
"value": "x",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 68,
"end": 89,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 76,
"end": 89,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 78,
"end": 87,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 85,
"end": 86,
"ctxt": 0
},
"value": 2.0
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 92,
"end": 146,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 96,
"end": 97,
"ctxt": 0
},
"value": "x",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 98,
"end": 103,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 98,
"end": 103,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 92,
"end": 146,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 105,
"end": 146,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 107,
"end": 144,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 107,
"end": 143,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 107,
"end": 118,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 107,
"end": 114,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 115,
"end": 118,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "TemplateLiteral",
"span": {
"start": 119,
"end": 142,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 135,
"end": 140,
"ctxt": 0
},
"value": "value",
"optional": false
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 120,
"end": 133,
"ctxt": 0
},
"tail": false,
"cooked": "x was set to ",
"raw": "x was set to "
},
{
"type": "TemplateElement",
"span": {
"start": 141,
"end": 141,
"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": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 156,
"end": 163,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"span": {
"start": 150,
"end": 189,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 181,
"end": 187,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 181,
"end": 182,
"ctxt": 0
},
"value": "x",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 185,
"end": 186,
"ctxt": 0
},
"value": 1.0
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 172,
"end": 176,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 191,
"end": 217,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 197,
"end": 216,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 197,
"end": 200,
"ctxt": 0
},
"value": "obj",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 203,
"end": 216,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 207,
"end": 214,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 245,
"end": 264,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 245,
"end": 263,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 245,
"end": 256,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 245,
"end": 252,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 253,
"end": 256,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "MemberExpression",
"span": {
"start": 257,
"end": 262,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 257,
"end": 260,
"ctxt": 0
},
"value": "obj",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 261,
"end": 262,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}