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

928 lines
32 KiB
JSON

{
"type": "Module",
"span": {
"start": 74,
"end": 612,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 74,
"end": 123,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 87,
"end": 88,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 81,
"end": 123,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 95,
"end": 121,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 95,
"end": 100,
"ctxt": 0
},
"value": "print",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 95,
"end": 121,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 103,
"end": 121,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 105,
"end": 120,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 112,
"end": 120,
"ctxt": 0
},
"value": "I am B",
"raw": "\"I am B\""
}
}
]
},
"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": 125,
"end": 163,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 141,
"end": 144,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 132,
"end": 163,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 147,
"end": 163,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 149,
"end": 161,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 156,
"end": 161,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 184,
"end": 229,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 200,
"end": 206,
"ctxt": 0
},
"value": "backup",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 191,
"end": 229,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 209,
"end": 229,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 211,
"end": 227,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 218,
"end": 226,
"ctxt": 0
},
"value": "backup",
"raw": "\"backup\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 250,
"end": 275,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 262,
"end": 274,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 262,
"end": 269,
"ctxt": 0
},
"value": "console",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 269,
"end": 274,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 271,
"end": 274,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 282,
"end": 283,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 276,
"end": 612,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 290,
"end": 323,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 298,
"end": 306,
"ctxt": 0
},
"value": "myModule",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 309,
"end": 322,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 309,
"end": 315,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 316,
"end": 321,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"typeAnnotation": null,
"isStatic": false,
"decorators": [],
"accessibility": "private",
"isAbstract": false,
"isOptional": false,
"isOverride": false,
"readonly": false,
"declare": false,
"definite": false
},
{
"type": "ClassMethod",
"span": {
"start": 328,
"end": 610,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 328,
"end": 334,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 328,
"end": 610,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 337,
"end": 610,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 347,
"end": 380,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 353,
"end": 379,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 353,
"end": 362,
"ctxt": 0
},
"value": "loadAsync",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 365,
"end": 379,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 365,
"end": 371,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 373,
"end": 378,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 389,
"end": 604,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 389,
"end": 603,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 389,
"end": 407,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 389,
"end": 402,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 389,
"end": 393,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 394,
"end": 402,
"ctxt": 0
},
"value": "myModule",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 403,
"end": 407,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 408,
"end": 464,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 408,
"end": 412,
"ctxt": 0
},
"value": "Zero",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 416,
"end": 464,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 430,
"end": 454,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 430,
"end": 453,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 430,
"end": 441,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 430,
"end": 437,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 438,
"end": 441,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 442,
"end": 452,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 442,
"end": 450,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 442,
"end": 446,
"ctxt": 0
},
"value": "Zero",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 447,
"end": 450,
"ctxt": 0
},
"value": "foo",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
],
"typeArguments": null
}
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
},
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 466,
"end": 602,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 472,
"end": 475,
"ctxt": 0
},
"value": "err",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 479,
"end": 602,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 493,
"end": 510,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 493,
"end": 509,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 493,
"end": 504,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 493,
"end": 500,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 501,
"end": 504,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 505,
"end": 508,
"ctxt": 0
},
"value": "err",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 523,
"end": 553,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 527,
"end": 552,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 527,
"end": 530,
"ctxt": 0
},
"value": "one",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 533,
"end": 552,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 539,
"end": 552,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 539,
"end": 545,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 546,
"end": 551,
"ctxt": 0
},
"value": "./1",
"raw": "\"./1\""
}
}
],
"typeArguments": null
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 566,
"end": 592,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 566,
"end": 591,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 566,
"end": 577,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 566,
"end": 573,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 574,
"end": 577,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 578,
"end": 590,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 578,
"end": 588,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 578,
"end": 581,
"ctxt": 0
},
"value": "one",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 582,
"end": 588,
"ctxt": 0
},
"value": "backup",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
],
"typeArguments": null
}
}
]
},
"async": true,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
}
]
},
"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
}