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

1581 lines
59 KiB
JSON

{
"type": "Module",
"span": {
"start": 90,
"end": 971,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 90,
"end": 139,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 103,
"end": 104,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 97,
"end": 139,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 111,
"end": 137,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 111,
"end": 116,
"ctxt": 0
},
"value": "print",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 111,
"end": 137,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 119,
"end": 137,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 121,
"end": 136,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 128,
"end": 136,
"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": 141,
"end": 179,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 157,
"end": 160,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 148,
"end": 179,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 163,
"end": 179,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 165,
"end": 177,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 172,
"end": 177,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 200,
"end": 245,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 216,
"end": 222,
"ctxt": 0
},
"value": "backup",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 207,
"end": 245,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 225,
"end": 245,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 227,
"end": 243,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 234,
"end": 242,
"ctxt": 0
},
"value": "backup",
"raw": "\"backup\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 266,
"end": 291,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 278,
"end": 290,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 278,
"end": 285,
"ctxt": 0
},
"value": "console",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 285,
"end": 290,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 287,
"end": 290,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 298,
"end": 299,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 292,
"end": 627,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 306,
"end": 339,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 314,
"end": 322,
"ctxt": 0
},
"value": "myModule",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 325,
"end": 338,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 325,
"end": 331,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 332,
"end": 337,
"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": 344,
"end": 625,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 344,
"end": 350,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 344,
"end": 625,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 353,
"end": 625,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 363,
"end": 395,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 369,
"end": 394,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 369,
"end": 378,
"ctxt": 0
},
"value": "loadAsync",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 381,
"end": 394,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 381,
"end": 387,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 388,
"end": 393,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 404,
"end": 619,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 404,
"end": 618,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 404,
"end": 422,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 404,
"end": 417,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 404,
"end": 408,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 409,
"end": 417,
"ctxt": 0
},
"value": "myModule",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 418,
"end": 422,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 423,
"end": 479,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 423,
"end": 427,
"ctxt": 0
},
"value": "Zero",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 431,
"end": 479,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 445,
"end": 469,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 445,
"end": 468,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 445,
"end": 456,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 445,
"end": 452,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 453,
"end": 456,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 457,
"end": 467,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 457,
"end": 465,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 457,
"end": 461,
"ctxt": 0
},
"value": "Zero",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 462,
"end": 465,
"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": 481,
"end": 617,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 487,
"end": 490,
"ctxt": 0
},
"value": "err",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 494,
"end": 617,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 508,
"end": 525,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 508,
"end": 524,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 508,
"end": 519,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 508,
"end": 515,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 516,
"end": 519,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 520,
"end": 523,
"ctxt": 0
},
"value": "err",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 538,
"end": 568,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 542,
"end": 567,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 542,
"end": 545,
"ctxt": 0
},
"value": "one",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 548,
"end": 567,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 554,
"end": 567,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 554,
"end": 560,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 561,
"end": 566,
"ctxt": 0
},
"value": "./1",
"raw": "\"./1\""
}
}
],
"typeArguments": null
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 581,
"end": 607,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 581,
"end": 606,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 581,
"end": 592,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 581,
"end": 588,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 589,
"end": 592,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 593,
"end": 605,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 593,
"end": 603,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 593,
"end": 596,
"ctxt": 0
},
"value": "one",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 597,
"end": 603,
"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": 629,
"end": 971,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 642,
"end": 643,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 636,
"end": 971,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 650,
"end": 683,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 658,
"end": 666,
"ctxt": 0
},
"value": "myModule",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 669,
"end": 682,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 669,
"end": 675,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 676,
"end": 681,
"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": 688,
"end": 969,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 688,
"end": 694,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 688,
"end": 969,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 697,
"end": 969,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 707,
"end": 739,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 713,
"end": 738,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 713,
"end": 722,
"ctxt": 0
},
"value": "loadAsync",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 725,
"end": 738,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 725,
"end": 731,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 732,
"end": 737,
"ctxt": 0
},
"value": "./0",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 748,
"end": 963,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 748,
"end": 962,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 748,
"end": 766,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 748,
"end": 761,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 748,
"end": 752,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 753,
"end": 761,
"ctxt": 0
},
"value": "myModule",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 762,
"end": 766,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 767,
"end": 823,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 767,
"end": 771,
"ctxt": 0
},
"value": "Zero",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 775,
"end": 823,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 789,
"end": 813,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 789,
"end": 812,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 789,
"end": 800,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 789,
"end": 796,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 797,
"end": 800,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 801,
"end": 811,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 801,
"end": 809,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 801,
"end": 805,
"ctxt": 0
},
"value": "Zero",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 806,
"end": 809,
"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": 825,
"end": 961,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 831,
"end": 834,
"ctxt": 0
},
"value": "err",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 838,
"end": 961,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 852,
"end": 869,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 852,
"end": 868,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 852,
"end": 863,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 852,
"end": 859,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 860,
"end": 863,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 864,
"end": 867,
"ctxt": 0
},
"value": "err",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 882,
"end": 912,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 886,
"end": 911,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 886,
"end": 889,
"ctxt": 0
},
"value": "one",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 892,
"end": 911,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 898,
"end": 911,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 898,
"end": 904,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 905,
"end": 910,
"ctxt": 0
},
"value": "./1",
"raw": "\"./1\""
}
}
],
"typeArguments": null
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 925,
"end": 951,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 925,
"end": 950,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 925,
"end": 936,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 925,
"end": 932,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 933,
"end": 936,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 937,
"end": 949,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 937,
"end": 947,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 937,
"end": 940,
"ctxt": 0
},
"value": "one",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 941,
"end": 947,
"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
}