swc/crates/swc_ecma_parser/tests/tsc/emitStatementsBeforeSuperCall.json
2022-04-05 12:46:35 +00:00

518 lines
13 KiB
JSON

{
"type": "Script",
"span": {
"start": 55,
"end": 429,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 61,
"end": 65,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"declare": false,
"span": {
"start": 55,
"end": 69,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 76,
"end": 79,
"ctxt": 0
},
"value": "Sub",
"optional": false
},
"declare": false,
"span": {
"start": 70,
"end": 243,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 117,
"end": 226,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 117,
"end": 128,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 129,
"end": 145,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 136,
"end": 145,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 137,
"end": 145,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 139,
"end": 145,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 147,
"end": 226,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 157,
"end": 175,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 157,
"end": 174,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 157,
"end": 168,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 157,
"end": 164,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 165,
"end": 168,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 169,
"end": 173,
"ctxt": 0
},
"value": "hi",
"raw": "'hi'"
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 212,
"end": 220,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 212,
"end": 219,
"ctxt": 0
},
"callee": {
"type": "Super",
"span": {
"start": 212,
"end": 217,
"ctxt": 0
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassProperty",
"span": {
"start": 231,
"end": 241,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 231,
"end": 236,
"ctxt": 0
},
"value": "field",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 239,
"end": 240,
"ctxt": 0
},
"value": 0.0,
"raw": "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": 88,
"end": 92,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 251,
"end": 255,
"ctxt": 0
},
"value": "Test",
"optional": false
},
"declare": false,
"span": {
"start": 245,
"end": 429,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 275,
"end": 288,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 275,
"end": 279,
"ctxt": 0
},
"value": "prop",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 279,
"end": 287,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 281,
"end": 287,
"ctxt": 0
},
"kind": "number"
}
},
"isStatic": false,
"decorators": [],
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "Constructor",
"span": {
"start": 311,
"end": 427,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 311,
"end": 322,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 323,
"end": 339,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 330,
"end": 339,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 331,
"end": 339,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 333,
"end": 339,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 341,
"end": 427,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 351,
"end": 353,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 351,
"end": 352,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 390,
"end": 398,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 390,
"end": 397,
"ctxt": 0
},
"callee": {
"type": "Super",
"span": {
"start": 390,
"end": 395,
"ctxt": 0
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 407,
"end": 421,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 407,
"end": 420,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 407,
"end": 416,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 407,
"end": 411,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 412,
"end": 416,
"ctxt": 0
},
"value": "prop",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 419,
"end": 420,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 264,
"end": 268,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}