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

499 lines
12 KiB
JSON
Raw Normal View History

{
"type": "Module",
"span": {
"start": 59,
"end": 284,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 59,
"end": 98,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 75,
"end": 78,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 66,
"end": 98,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 81,
"end": 98,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 83,
"end": 96,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 90,
"end": 95,
"ctxt": 0
},
"value": "foo",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 119,
"end": 133,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 119,
"end": 132,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 119,
"end": 125,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 126,
"end": 131,
"ctxt": 0
},
"value": "./0",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 134,
"end": 157,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 138,
"end": 156,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 138,
"end": 140,
"ctxt": 0
},
"value": "p1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 143,
"end": 156,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 143,
"end": 149,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 150,
"end": 155,
"ctxt": 0
},
"value": "./0",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 158,
"end": 202,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 158,
"end": 201,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 158,
"end": 165,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 158,
"end": 160,
"ctxt": 0
},
"value": "p1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 161,
"end": 165,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 166,
"end": 200,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 166,
"end": 170,
"ctxt": 0
},
"value": "zero",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 174,
"end": 200,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 180,
"end": 198,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 187,
"end": 197,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 187,
"end": 195,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 187,
"end": 191,
"ctxt": 0
},
"value": "zero",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 192,
"end": 195,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 204,
"end": 234,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 211,
"end": 234,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 215,
"end": 233,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 215,
"end": 217,
"ctxt": 0
},
"value": "p2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 220,
"end": 233,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 220,
"end": 226,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 227,
"end": 232,
"ctxt": 0
},
"value": "./0",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 245,
"end": 248,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 236,
"end": 284,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 251,
"end": 284,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 257,
"end": 282,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 263,
"end": 281,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 263,
"end": 265,
"ctxt": 0
},
"value": "p2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 268,
"end": 281,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 268,
"end": 274,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 275,
"end": 280,
"ctxt": 0
},
"value": "./0",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}