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

317 lines
7.8 KiB
JSON

{
"type": "Script",
"span": {
"start": 94,
"end": 262,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 100,
"end": 103,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"declare": false,
"span": {
"start": 94,
"end": 153,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 110,
"end": 130,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"value": "p",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 110,
"end": 130,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 118,
"end": 130,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 120,
"end": 128,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 127,
"end": 128,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "getter",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 135,
"end": 151,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 139,
"end": 140,
"ctxt": 0
},
"value": "p",
"optional": false
},
"function": {
"params": [
{
"type": "Parameter",
"span": {
"start": 141,
"end": 146,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 141,
"end": 146,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 135,
"end": 151,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 148,
"end": 151,
"ctxt": 0
},
"stmts": []
},
"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": 182,
"end": 185,
"ctxt": 0
},
"value": "Bar",
"optional": false
},
"declare": false,
"span": {
"start": 176,
"end": 262,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 204,
"end": 260,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 204,
"end": 215,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [],
"body": {
"type": "BlockStatement",
"span": {
"start": 218,
"end": 260,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 228,
"end": 235,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 228,
"end": 235,
"ctxt": 0
},
"callee": {
"type": "Super",
"span": {
"start": 228,
"end": 233,
"ctxt": 0
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 244,
"end": 254,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 244,
"end": 254,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 244,
"end": 250,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 244,
"end": 248,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 249,
"end": 250,
"ctxt": 0
},
"value": "p",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 253,
"end": 254,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 194,
"end": 197,
"ctxt": 0
},
"value": "Foo",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}