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

1581 lines
59 KiB
JSON

{
"type": "Module",
"span": {
"start": 96,
"end": 978,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 96,
"end": 145,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 109,
"end": 110,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 103,
"end": 145,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 117,
"end": 143,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 117,
"end": 122,
"ctxt": 0
},
"value": "print",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 117,
"end": 143,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 125,
"end": 143,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 127,
"end": 142,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 134,
"end": 142,
"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": 147,
"end": 185,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 163,
"end": 166,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 154,
"end": 185,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 169,
"end": 185,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 171,
"end": 183,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 178,
"end": 183,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 206,
"end": 251,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 222,
"end": 228,
"ctxt": 0
},
"value": "backup",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 213,
"end": 251,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 231,
"end": 251,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 233,
"end": 249,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 240,
"end": 248,
"ctxt": 0
},
"value": "backup",
"raw": "\"backup\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 272,
"end": 297,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 284,
"end": 296,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 284,
"end": 291,
"ctxt": 0
},
"value": "console",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 291,
"end": 296,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 293,
"end": 296,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 304,
"end": 305,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 298,
"end": 634,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 312,
"end": 345,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 320,
"end": 328,
"ctxt": 0
},
"value": "myModule",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 331,
"end": 344,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 331,
"end": 337,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 338,
"end": 343,
"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": 350,
"end": 632,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 350,
"end": 356,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 350,
"end": 632,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 359,
"end": 632,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 369,
"end": 402,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 375,
"end": 401,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 375,
"end": 384,
"ctxt": 0
},
"value": "loadAsync",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 387,
"end": 401,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 387,
"end": 393,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 395,
"end": 400,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 411,
"end": 626,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 411,
"end": 625,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 411,
"end": 429,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 411,
"end": 424,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 411,
"end": 415,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 416,
"end": 424,
"ctxt": 0
},
"value": "myModule",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 425,
"end": 429,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 430,
"end": 486,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 430,
"end": 434,
"ctxt": 0
},
"value": "Zero",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 438,
"end": 486,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 452,
"end": 476,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 452,
"end": 475,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 452,
"end": 463,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 452,
"end": 459,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 460,
"end": 463,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 464,
"end": 474,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 464,
"end": 472,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 464,
"end": 468,
"ctxt": 0
},
"value": "Zero",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 469,
"end": 472,
"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": 488,
"end": 624,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 494,
"end": 497,
"ctxt": 0
},
"value": "err",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 501,
"end": 624,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 515,
"end": 532,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 515,
"end": 531,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 515,
"end": 526,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 515,
"end": 522,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 523,
"end": 526,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 527,
"end": 530,
"ctxt": 0
},
"value": "err",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 545,
"end": 575,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 549,
"end": 574,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 549,
"end": 552,
"ctxt": 0
},
"value": "one",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 555,
"end": 574,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 561,
"end": 574,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 561,
"end": 567,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 568,
"end": 573,
"ctxt": 0
},
"value": "./1",
"raw": "\"./1\""
}
}
],
"typeArguments": null
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 588,
"end": 614,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 588,
"end": 613,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 588,
"end": 599,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 588,
"end": 595,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 596,
"end": 599,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 600,
"end": 612,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 600,
"end": 610,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 600,
"end": 603,
"ctxt": 0
},
"value": "one",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 604,
"end": 610,
"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": []
},
{
"type": "ExportDeclaration",
"span": {
"start": 636,
"end": 978,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 649,
"end": 650,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 643,
"end": 978,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 657,
"end": 690,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 665,
"end": 673,
"ctxt": 0
},
"value": "myModule",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 676,
"end": 689,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 676,
"end": 682,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 683,
"end": 688,
"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": 695,
"end": 976,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 695,
"end": 701,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 695,
"end": 976,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 704,
"end": 976,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 714,
"end": 746,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 720,
"end": 745,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 720,
"end": 729,
"ctxt": 0
},
"value": "loadAsync",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 732,
"end": 745,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 732,
"end": 738,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 739,
"end": 744,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 755,
"end": 970,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 755,
"end": 969,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 755,
"end": 773,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 755,
"end": 768,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 755,
"end": 759,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 760,
"end": 768,
"ctxt": 0
},
"value": "myModule",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 769,
"end": 773,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 774,
"end": 830,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 774,
"end": 778,
"ctxt": 0
},
"value": "Zero",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 782,
"end": 830,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 796,
"end": 820,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 796,
"end": 819,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 796,
"end": 807,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 796,
"end": 803,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 804,
"end": 807,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 808,
"end": 818,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 808,
"end": 816,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 808,
"end": 812,
"ctxt": 0
},
"value": "Zero",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 813,
"end": 816,
"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": 832,
"end": 968,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 838,
"end": 841,
"ctxt": 0
},
"value": "err",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 845,
"end": 968,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 859,
"end": 876,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 859,
"end": 875,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 859,
"end": 870,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 859,
"end": 866,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 867,
"end": 870,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 871,
"end": 874,
"ctxt": 0
},
"value": "err",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 889,
"end": 919,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 893,
"end": 918,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 893,
"end": 896,
"ctxt": 0
},
"value": "one",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 899,
"end": 918,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 905,
"end": 918,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 905,
"end": 911,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 912,
"end": 917,
"ctxt": 0
},
"value": "./1",
"raw": "\"./1\""
}
}
],
"typeArguments": null
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 932,
"end": 958,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 932,
"end": 957,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 932,
"end": 943,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 932,
"end": 939,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 940,
"end": 943,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 944,
"end": 956,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 944,
"end": 954,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 944,
"end": 947,
"ctxt": 0
},
"value": "one",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 948,
"end": 954,
"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
}