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

763 lines
20 KiB
JSON

{
"type": "Module",
"span": {
"start": 70,
"end": 454,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 70,
"end": 109,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 86,
"end": 89,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 77,
"end": 109,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 92,
"end": 109,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 94,
"end": 107,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 101,
"end": 106,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 130,
"end": 144,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 130,
"end": 143,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 130,
"end": 136,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 137,
"end": 142,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 145,
"end": 168,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 149,
"end": 167,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 149,
"end": 151,
"ctxt": 0
},
"value": "p1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 154,
"end": 167,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 154,
"end": 160,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 161,
"end": 166,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 169,
"end": 213,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 169,
"end": 212,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 169,
"end": 176,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 169,
"end": 171,
"ctxt": 0
},
"value": "p1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 172,
"end": 176,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 177,
"end": 211,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 177,
"end": 181,
"ctxt": 0
},
"value": "zero",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 185,
"end": 211,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 191,
"end": 209,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 198,
"end": 208,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 198,
"end": 206,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 198,
"end": 202,
"ctxt": 0
},
"value": "zero",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 203,
"end": 206,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 215,
"end": 245,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 222,
"end": 245,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 226,
"end": 244,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 226,
"end": 228,
"ctxt": 0
},
"value": "p2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 231,
"end": 244,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 231,
"end": 237,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 238,
"end": 243,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 256,
"end": 259,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 247,
"end": 295,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 262,
"end": 295,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 268,
"end": 293,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 274,
"end": 292,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 274,
"end": 276,
"ctxt": 0
},
"value": "p2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 279,
"end": 292,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 279,
"end": 285,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 286,
"end": 291,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 303,
"end": 304,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 297,
"end": 371,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 311,
"end": 369,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 311,
"end": 317,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 311,
"end": 369,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 320,
"end": 369,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 330,
"end": 363,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 336,
"end": 362,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 336,
"end": 345,
"ctxt": 0
},
"value": "loadAsync",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 348,
"end": 362,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 348,
"end": 354,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 356,
"end": 361,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
]
},
"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": "ExportDeclaration",
"span": {
"start": 373,
"end": 454,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 386,
"end": 387,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 380,
"end": 454,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 394,
"end": 452,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 394,
"end": 400,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 394,
"end": 452,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 403,
"end": 452,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 413,
"end": 446,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 419,
"end": 445,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 419,
"end": 428,
"ctxt": 0
},
"value": "loadAsync",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 431,
"end": 445,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 431,
"end": 437,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 439,
"end": 444,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
]
},
"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": []
}
}
],
"interpreter": null
}