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

518 lines
13 KiB
JSON

{
"type": "Script",
"span": {
"start": 55,
"end": 373,
"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": 215,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "Constructor",
"span": {
"start": 117,
"end": 198,
"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": 198,
"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": 184,
"end": 192,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 184,
"end": 191,
"ctxt": 0
},
"callee": {
"type": "Super",
"span": {
"start": 184,
"end": 189,
"ctxt": 0
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"accessibility": null,
"isOptional": false
},
{
"type": "ClassProperty",
"span": {
"start": 203,
"end": 213,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 203,
"end": 208,
"ctxt": 0
},
"value": "field",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 211,
"end": 212,
"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": 223,
"end": 227,
"ctxt": 0
},
"value": "Test",
"optional": false
},
"declare": false,
"span": {
"start": 217,
"end": 373,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 247,
"end": 260,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 247,
"end": 251,
"ctxt": 0
},
"value": "prop",
"optional": false
},
"value": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 251,
"end": 259,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 253,
"end": 259,
"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": 283,
"end": 371,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 283,
"end": 294,
"ctxt": 0
},
"value": "constructor",
"optional": false
},
"params": [
{
"type": "TsParameterProperty",
"span": {
"start": 295,
"end": 311,
"ctxt": 0
},
"decorators": [],
"accessibility": "public",
"override": false,
"readonly": false,
"param": {
"type": "Identifier",
"span": {
"start": 302,
"end": 311,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 303,
"end": 311,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 305,
"end": 311,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 313,
"end": 371,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 323,
"end": 325,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 323,
"end": 324,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 334,
"end": 342,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 334,
"end": 341,
"ctxt": 0
},
"callee": {
"type": "Super",
"span": {
"start": 334,
"end": 339,
"ctxt": 0
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 351,
"end": 365,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 351,
"end": 364,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
"start": 351,
"end": 360,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 351,
"end": 355,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 356,
"end": 360,
"ctxt": 0
},
"value": "prop",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 363,
"end": 364,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
}
]
},
"accessibility": null,
"isOptional": false
}
],
"superClass": {
"type": "Identifier",
"span": {
"start": 236,
"end": 240,
"ctxt": 0
},
"value": "Base",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
],
"interpreter": null
}