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

479 lines
12 KiB
JSON

{
"type": "Module",
"span": {
"start": 54,
"end": 279,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 54,
"end": 93,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 70,
"end": 73,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 61,
"end": 93,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 76,
"end": 93,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 78,
"end": 91,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 85,
"end": 90,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 114,
"end": 128,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 114,
"end": 127,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 114,
"end": 120,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 121,
"end": 126,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 129,
"end": 152,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 133,
"end": 151,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 133,
"end": 135,
"ctxt": 0
},
"value": "p1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 138,
"end": 151,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 138,
"end": 144,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 145,
"end": 150,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 153,
"end": 197,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 153,
"end": 196,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 153,
"end": 160,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 153,
"end": 155,
"ctxt": 0
},
"value": "p1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 156,
"end": 160,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 161,
"end": 195,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 161,
"end": 165,
"ctxt": 0
},
"value": "zero",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 169,
"end": 195,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 175,
"end": 193,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 182,
"end": 192,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 182,
"end": 190,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 182,
"end": 186,
"ctxt": 0
},
"value": "zero",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 187,
"end": 190,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 199,
"end": 229,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 206,
"end": 229,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 210,
"end": 228,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 210,
"end": 212,
"ctxt": 0
},
"value": "p2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 215,
"end": 228,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 215,
"end": 221,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 222,
"end": 227,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 240,
"end": 243,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 231,
"end": 279,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 246,
"end": 279,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 252,
"end": 277,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 258,
"end": 276,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 258,
"end": 260,
"ctxt": 0
},
"value": "p2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 263,
"end": 276,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 263,
"end": 269,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 270,
"end": 275,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}