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

555 lines
12 KiB
JSON

{
"type": "Script",
"span": {
"start": 52,
"end": 249,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 67,
"end": 68,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 52,
"end": 71,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": true,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 79,
"end": 80,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 73,
"end": 93,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "Identifier",
"span": {
"start": 89,
"end": 90,
"ctxt": 0
},
"value": "A",
"optional": false
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 110,
"end": 111,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 95,
"end": 124,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "Identifier",
"span": {
"start": 120,
"end": 121,
"ctxt": 0
},
"value": "B",
"optional": false
},
"isAbstract": true,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ExpressionStatement",
"span": {
"start": 126,
"end": 132,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 126,
"end": 131,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 130,
"end": 131,
"ctxt": 0
},
"value": "A",
"optional": false
},
"arguments": null,
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 133,
"end": 142,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 133,
"end": 141,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 137,
"end": 138,
"ctxt": 0
},
"value": "A",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 139,
"end": 140,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 168,
"end": 174,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 168,
"end": 173,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 172,
"end": 173,
"ctxt": 0
},
"value": "B",
"optional": false
},
"arguments": null,
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 175,
"end": 181,
"ctxt": 0
},
"expression": {
"type": "NewExpression",
"span": {
"start": 175,
"end": 180,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 179,
"end": 180,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": null,
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 183,
"end": 193,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 187,
"end": 192,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 187,
"end": 188,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 189,
"end": 192,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 191,
"end": 192,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 191,
"end": 192,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 194,
"end": 204,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 198,
"end": 203,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 198,
"end": 199,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 200,
"end": 203,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 202,
"end": 203,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 202,
"end": 203,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 205,
"end": 215,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 209,
"end": 214,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 209,
"end": 210,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 211,
"end": 214,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 213,
"end": 214,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 213,
"end": 214,
"ctxt": 0
},
"value": "C",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 217,
"end": 227,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 217,
"end": 226,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 217,
"end": 218,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NewExpression",
"span": {
"start": 221,
"end": 226,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 225,
"end": 226,
"ctxt": 0
},
"value": "B",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 228,
"end": 238,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 228,
"end": 237,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 228,
"end": 229,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NewExpression",
"span": {
"start": 232,
"end": 237,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 236,
"end": 237,
"ctxt": 0
},
"value": "B",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 239,
"end": 249,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 239,
"end": 248,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 239,
"end": 240,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "NewExpression",
"span": {
"start": 243,
"end": 248,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 247,
"end": 248,
"ctxt": 0
},
"value": "B",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
}
],
"interpreter": null
}