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

461 lines
10 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 191,
"ctxt": 0
},
"body": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 7,
"end": 8,
"ctxt": 0
},
"value": "A",
"optional": false
},
"declare": false,
"span": {
"start": 1,
"end": 11,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 27,
"end": 28,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 12,
"end": 41,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "Identifier",
"span": {
"start": 37,
"end": 38,
"ctxt": 0
},
"value": "A",
"optional": false
},
"isAbstract": true,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 52,
"end": 56,
"ctxt": 0
},
"value": "NewA",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 57,
"end": 74,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 57,
"end": 74,
"ctxt": 0
},
"value": "Factory",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 64,
"end": 74,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 66,
"end": 74,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 73,
"end": 74,
"ctxt": 0
},
"value": "A",
"optional": false
},
"typeArguments": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 43,
"end": 97,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 76,
"end": 97,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 82,
"end": 95,
"ctxt": 0
},
"argument": {
"type": "NewExpression",
"span": {
"start": 89,
"end": 94,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 93,
"end": 94,
"ctxt": 0
},
"value": "A",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 108,
"end": 112,
"ctxt": 0
},
"value": "NewB",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 113,
"end": 130,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 113,
"end": 130,
"ctxt": 0
},
"value": "Factory",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 120,
"end": 130,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeQuery",
"span": {
"start": 122,
"end": 130,
"ctxt": 0
},
"exprName": {
"type": "Identifier",
"span": {
"start": 129,
"end": 130,
"ctxt": 0
},
"value": "B",
"optional": false
},
"typeArguments": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 99,
"end": 153,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 132,
"end": 153,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 138,
"end": 151,
"ctxt": 0
},
"argument": {
"type": "NewExpression",
"span": {
"start": 145,
"end": 150,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 149,
"end": 150,
"ctxt": 0
},
"value": "B",
"optional": false
},
"arguments": null,
"typeArguments": null
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 155,
"end": 163,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 155,
"end": 162,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 155,
"end": 159,
"ctxt": 0
},
"value": "NewA",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 160,
"end": 161,
"ctxt": 0
},
"value": "A",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 164,
"end": 172,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 164,
"end": 171,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 164,
"end": 168,
"ctxt": 0
},
"value": "NewA",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 169,
"end": 170,
"ctxt": 0
},
"value": "B",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 174,
"end": 182,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 174,
"end": 181,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 174,
"end": 178,
"ctxt": 0
},
"value": "NewB",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 179,
"end": 180,
"ctxt": 0
},
"value": "A",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 183,
"end": 191,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 183,
"end": 190,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 183,
"end": 187,
"ctxt": 0
},
"value": "NewB",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 188,
"end": 189,
"ctxt": 0
},
"value": "B",
"optional": false
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}