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

337 lines
8.9 KiB
JSON

{
"type": "Script",
"span": {
"start": 78,
"end": 225,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 84,
"end": 88,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"span": {
"start": 78,
"end": 105,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 91,
"end": 103,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 91,
"end": 97,
"ctxt": 0
},
"value": "method",
"optional": true
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 91,
"end": 103,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 101,
"end": 103,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": true,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 112,
"end": 119,
"ctxt": 0
},
"value": "Derived",
"optional": false
},
"declare": false,
"span": {
"start": 106,
"end": 225,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 139,
"end": 177,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 139,
"end": 146,
"ctxt": 0
},
"value": "method1",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 139,
"end": 177,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 149,
"end": 177,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 151,
"end": 175,
"ctxt": 0
},
"argument": {
"type": "OptionalChainingExpression",
"span": {
"start": 158,
"end": 174,
"ctxt": 0
},
"questionDotToken": {
"start": 170,
"end": 171,
"ctxt": 0
},
"base": {
"type": "CallExpression",
"span": {
"start": 158,
"end": 174,
"ctxt": 0
},
"callee": {
"type": "SuperPropExpression",
"span": {
"start": 158,
"end": 170,
"ctxt": 0
},
"obj": {
"type": "Super",
"span": {
"start": 158,
"end": 163,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 164,
"end": 170,
"ctxt": 0
},
"value": "method",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
},
{
"type": "ClassMethod",
"span": {
"start": 182,
"end": 223,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 182,
"end": 189,
"ctxt": 0
},
"value": "method2",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 182,
"end": 223,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 192,
"end": 223,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 194,
"end": 221,
"ctxt": 0
},
"argument": {
"type": "OptionalChainingExpression",
"span": {
"start": 201,
"end": 220,
"ctxt": 0
},
"questionDotToken": {
"start": 216,
"end": 217,
"ctxt": 0
},
"base": {
"type": "CallExpression",
"span": {
"start": 201,
"end": 220,
"ctxt": 0
},
"callee": {
"type": "SuperPropExpression",
"span": {
"start": 201,
"end": 216,
"ctxt": 0
},
"obj": {
"type": "Super",
"span": {
"start": 201,
"end": 206,
"ctxt": 0
}
},
"property": {
"type": "Computed",
"span": {
"start": 206,
"end": 216,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 207,
"end": 215,
"ctxt": 0
},
"value": "method",
"raw": "\"method\""
}
}
},
"arguments": [],
"typeArguments": null
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 128,
"end": 132,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}