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

316 lines
8.8 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 158,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 1,
"end": 60,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 15,
"end": 58,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 23,
"end": 26,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 15,
"end": 58,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 29,
"end": 58,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 39,
"end": 52,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 39,
"end": 52,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "SuperPropExpression",
"span": {
"start": 39,
"end": 48,
"ctxt": 0
},
"obj": {
"type": "Super",
"span": {
"start": 39,
"end": 44,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 45,
"end": 48,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 51,
"end": 52,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "TsModuleDeclaration",
"span": {
"start": 62,
"end": 158,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 69,
"end": 71,
"ctxt": 0
},
"value": "M1",
"optional": false
},
"body": {
"type": "TsNamespaceDeclaration",
"span": {
"start": 72,
"end": 158,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 72,
"end": 74,
"ctxt": 0
},
"value": "M2",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 75,
"end": 158,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 87,
"end": 88,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 81,
"end": 156,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 99,
"end": 150,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 107,
"end": 110,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 99,
"end": 150,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 113,
"end": 150,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 127,
"end": 140,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 127,
"end": 140,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "SuperPropExpression",
"span": {
"start": 127,
"end": 136,
"ctxt": 0
},
"obj": {
"type": "Super",
"span": {
"start": 127,
"end": 132,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 133,
"end": 136,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 139,
"end": 140,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
]
}
}
}
],
"interpreter": null
}