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

763 lines
20 KiB
JSON

{
"type": "Module",
"span": {
"start": 56,
"end": 440,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 56,
"end": 95,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 72,
"end": 75,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 63,
"end": 95,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 78,
"end": 95,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 80,
"end": 93,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 87,
"end": 92,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 116,
"end": 130,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 116,
"end": 129,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 116,
"end": 122,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 123,
"end": 128,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 131,
"end": 154,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 135,
"end": 153,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 135,
"end": 137,
"ctxt": 0
},
"value": "p1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 140,
"end": 153,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 140,
"end": 146,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 147,
"end": 152,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 155,
"end": 199,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 155,
"end": 198,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 155,
"end": 162,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 155,
"end": 157,
"ctxt": 0
},
"value": "p1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 158,
"end": 162,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 163,
"end": 197,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 163,
"end": 167,
"ctxt": 0
},
"value": "zero",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 171,
"end": 197,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 177,
"end": 195,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 184,
"end": 194,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 184,
"end": 192,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 184,
"end": 188,
"ctxt": 0
},
"value": "zero",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 189,
"end": 192,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 201,
"end": 231,
"ctxt": 0
},
"declaration": {
"type": "VariableDeclaration",
"span": {
"start": 208,
"end": 231,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 212,
"end": 230,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 212,
"end": 214,
"ctxt": 0
},
"value": "p2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 217,
"end": 230,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 217,
"end": 223,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 224,
"end": 229,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 242,
"end": 245,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 233,
"end": 281,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 248,
"end": 281,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 254,
"end": 279,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 260,
"end": 278,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 260,
"end": 262,
"ctxt": 0
},
"value": "p2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 265,
"end": 278,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 265,
"end": 271,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 272,
"end": 277,
"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": 289,
"end": 290,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 283,
"end": 357,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 297,
"end": 355,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 297,
"end": 303,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 297,
"end": 355,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 306,
"end": 355,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 316,
"end": 349,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 322,
"end": 348,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 322,
"end": 331,
"ctxt": 0
},
"value": "loadAsync",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 334,
"end": 348,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 334,
"end": 340,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 342,
"end": 347,
"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": 359,
"end": 440,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 372,
"end": 373,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 366,
"end": 440,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 380,
"end": 438,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 380,
"end": 386,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 380,
"end": 438,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 389,
"end": 438,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 399,
"end": 432,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 405,
"end": 431,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 405,
"end": 414,
"ctxt": 0
},
"value": "loadAsync",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 417,
"end": 431,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 417,
"end": 423,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 425,
"end": 430,
"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
}