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

763 lines
20 KiB
JSON

{
"type": "Module",
"span": {
"start": 57,
"end": 441,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 57,
"end": 96,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 73,
"end": 76,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 64,
"end": 96,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 79,
"end": 96,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 81,
"end": 94,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 88,
"end": 93,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 117,
"end": 131,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 117,
"end": 130,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 117,
"end": 123,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 124,
"end": 129,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 132,
"end": 155,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 136,
"end": 154,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 136,
"end": 138,
"ctxt": 0
},
"value": "p1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 141,
"end": 154,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 141,
"end": 147,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 148,
"end": 153,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 156,
"end": 200,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 156,
"end": 199,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 156,
"end": 163,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 156,
"end": 158,
"ctxt": 0
},
"value": "p1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 159,
"end": 163,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 164,
"end": 198,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 164,
"end": 168,
"ctxt": 0
},
"value": "zero",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 172,
"end": 198,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 178,
"end": 196,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 185,
"end": 195,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 185,
"end": 193,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 185,
"end": 189,
"ctxt": 0
},
"value": "zero",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 190,
"end": 193,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 202,
"end": 232,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 209,
"end": 232,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 213,
"end": 231,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 213,
"end": 215,
"ctxt": 0
},
"value": "p2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 218,
"end": 231,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 218,
"end": 224,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 225,
"end": 230,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 243,
"end": 246,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 234,
"end": 282,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 249,
"end": 282,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 255,
"end": 280,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 261,
"end": 279,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 261,
"end": 263,
"ctxt": 0
},
"value": "p2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 266,
"end": 279,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 266,
"end": 272,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 273,
"end": 278,
"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": 290,
"end": 291,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 284,
"end": 358,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 298,
"end": 356,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 298,
"end": 304,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 298,
"end": 356,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 307,
"end": 356,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 317,
"end": 350,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 323,
"end": 349,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 323,
"end": 332,
"ctxt": 0
},
"value": "loadAsync",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 335,
"end": 349,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 335,
"end": 341,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 343,
"end": 348,
"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": 360,
"end": 441,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 373,
"end": 374,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 367,
"end": 441,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 381,
"end": 439,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 381,
"end": 387,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 381,
"end": 439,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 390,
"end": 439,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 400,
"end": 433,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 406,
"end": 432,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 406,
"end": 415,
"ctxt": 0
},
"value": "loadAsync",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 418,
"end": 432,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 418,
"end": 424,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 426,
"end": 431,
"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
}