swc/crates/swc_ecma_parser/tests/tsc/importCallExpressionInCJS4.json
2022-03-22 07:54:08 +00:00

364 lines
9.2 KiB
JSON

{
"type": "Module",
"span": {
"start": 59,
"end": 243,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 59,
"end": 108,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 72,
"end": 73,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 66,
"end": 108,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 80,
"end": 106,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 80,
"end": 85,
"ctxt": 0
},
"value": "print",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 80,
"end": 106,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 88,
"end": 106,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 90,
"end": 105,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 97,
"end": 105,
"ctxt": 0
},
"value": "I am B",
"raw": "\"I am B\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"kind": "method",
"isStatic": false,
"accessibility": null,
"isAbstract": false,
"isOptional": false,
"isOverride": false
}
],
"superClass": null,
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 144,
"end": 147,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 129,
"end": 236,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 150,
"end": 236,
"ctxt": 0
},
"stmts": [
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 162,
"end": 163,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 156,
"end": 198,
"ctxt": 0
},
"decorators": [],
"body": [],
"superClass": {
"type": "MemberExpression",
"span": {
"start": 172,
"end": 195,
"ctxt": 0
},
"object": {
"type": "ParenthesisExpression",
"span": {
"start": 172,
"end": 193,
"ctxt": 0
},
"expression": {
"type": "AwaitExpression",
"span": {
"start": 173,
"end": 192,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 179,
"end": 192,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 179,
"end": 185,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 186,
"end": 191,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
}
}
},
"property": {
"type": "Identifier",
"span": {
"start": 194,
"end": 195,
"ctxt": 0
},
"value": "B",
"optional": false
}
},
"isAbstract": false,
"typeParams": null,
"superTypeParams": null,
"implements": []
},
{
"type": "VariableDeclaration",
"span": {
"start": 203,
"end": 219,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 207,
"end": 218,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 207,
"end": 208,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "NewExpression",
"span": {
"start": 211,
"end": 218,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 215,
"end": 216,
"ctxt": 0
},
"value": "C",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 224,
"end": 234,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 224,
"end": 233,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 224,
"end": 231,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 224,
"end": 225,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 226,
"end": 231,
"ctxt": 0
},
"value": "print",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"generator": false,
"async": true,
"typeParameters": null,
"returnType": null
},
{
"type": "ExpressionStatement",
"span": {
"start": 237,
"end": 243,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 237,
"end": 242,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 237,
"end": 240,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [],
"typeArguments": null
}
}
],
"interpreter": null
}