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

1617 lines
60 KiB
JSON
Raw Normal View History

{
"type": "Module",
"span": {
"start": 89,
"end": 970,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 89,
"end": 138,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 102,
"end": 103,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 96,
"end": 138,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 110,
"end": 136,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 110,
"end": 115,
"ctxt": 0
},
"value": "print",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 110,
"end": 136,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 118,
"end": 136,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 120,
"end": 135,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 127,
"end": 135,
"ctxt": 0
},
"value": "I am B",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"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": 140,
"end": 178,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 156,
"end": 159,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 147,
"end": 178,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 162,
"end": 178,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 164,
"end": 176,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 171,
"end": 176,
"ctxt": 0
},
"value": "foo",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 199,
"end": 244,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 215,
"end": 221,
"ctxt": 0
},
"value": "backup",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 206,
"end": 244,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 224,
"end": 244,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 226,
"end": 242,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 233,
"end": 241,
"ctxt": 0
},
"value": "backup",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 265,
"end": 290,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 277,
"end": 289,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 277,
"end": 284,
"ctxt": 0
},
"value": "console",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 284,
"end": 289,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 286,
"end": 289,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 297,
"end": 298,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 291,
"end": 626,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 305,
"end": 338,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 313,
"end": 321,
"ctxt": 0
},
"value": "myModule",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 324,
"end": 337,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 324,
"end": 330,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 331,
"end": 336,
"ctxt": 0
},
"value": "./0",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"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": 343,
"end": 624,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 343,
"end": 349,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 343,
"end": 624,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 352,
"end": 624,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 362,
"end": 394,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 368,
"end": 393,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 368,
"end": 377,
"ctxt": 0
},
"value": "loadAsync",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 380,
"end": 393,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 380,
"end": 386,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 387,
"end": 392,
"ctxt": 0
},
"value": "./0",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 403,
"end": 618,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 403,
"end": 617,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 403,
"end": 421,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 403,
"end": 416,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 403,
"end": 407,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 408,
"end": 416,
"ctxt": 0
},
"value": "myModule",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 417,
"end": 421,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 422,
"end": 478,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 422,
"end": 426,
"ctxt": 0
},
"value": "Zero",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 430,
"end": 478,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 444,
"end": 468,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 444,
"end": 467,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 444,
"end": 455,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 444,
"end": 451,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 452,
"end": 455,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 456,
"end": 466,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 456,
"end": 464,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 456,
"end": 460,
"ctxt": 0
},
"value": "Zero",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 461,
"end": 464,
"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": 480,
"end": 616,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 486,
"end": 489,
"ctxt": 0
},
"value": "err",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 493,
"end": 616,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 507,
"end": 524,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 507,
"end": 523,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 507,
"end": 518,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 507,
"end": 514,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 515,
"end": 518,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 519,
"end": 522,
"ctxt": 0
},
"value": "err",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 537,
"end": 567,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 541,
"end": 566,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 541,
"end": 544,
"ctxt": 0
},
"value": "one",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 547,
"end": 566,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 553,
"end": 566,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 553,
"end": 559,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 560,
"end": 565,
"ctxt": 0
},
"value": "./1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 580,
"end": 606,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 580,
"end": 605,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 580,
"end": 591,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 580,
"end": 587,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 588,
"end": 591,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 592,
"end": 604,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 592,
"end": 602,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 592,
"end": 595,
"ctxt": 0
},
"value": "one",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 596,
"end": 602,
"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": 628,
"end": 970,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 641,
"end": 642,
"ctxt": 0
},
"value": "D",
"optional": false
},
"declare": false,
"span": {
"start": 635,
"end": 970,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 649,
"end": 682,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 657,
"end": 665,
"ctxt": 0
},
"value": "myModule",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 668,
"end": 681,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 668,
"end": 674,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 675,
"end": 680,
"ctxt": 0
},
"value": "./0",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"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": 687,
"end": 968,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 687,
"end": 693,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 687,
"end": 968,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 696,
"end": 968,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 706,
"end": 738,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 712,
"end": 737,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 712,
"end": 721,
"ctxt": 0
},
"value": "loadAsync",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 724,
"end": 737,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 724,
"end": 730,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 731,
"end": 736,
"ctxt": 0
},
"value": "./0",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 747,
"end": 962,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 747,
"end": 961,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 747,
"end": 765,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 747,
"end": 760,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 747,
"end": 751,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 752,
"end": 760,
"ctxt": 0
},
"value": "myModule",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 761,
"end": 765,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 766,
"end": 822,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 766,
"end": 770,
"ctxt": 0
},
"value": "Zero",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 774,
"end": 822,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 788,
"end": 812,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 788,
"end": 811,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 788,
"end": 799,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 788,
"end": 795,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 796,
"end": 799,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 800,
"end": 810,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 800,
"end": 808,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 800,
"end": 804,
"ctxt": 0
},
"value": "Zero",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 805,
"end": 808,
"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": 824,
"end": 960,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 830,
"end": 833,
"ctxt": 0
},
"value": "err",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 837,
"end": 960,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 851,
"end": 868,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 851,
"end": 867,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 851,
"end": 862,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 851,
"end": 858,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 859,
"end": 862,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 863,
"end": 866,
"ctxt": 0
},
"value": "err",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 881,
"end": 911,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 885,
"end": 910,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 885,
"end": 888,
"ctxt": 0
},
"value": "one",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 891,
"end": 910,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 897,
"end": 910,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 897,
"end": 903,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 904,
"end": 909,
"ctxt": 0
},
"value": "./1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 924,
"end": 950,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 924,
"end": 949,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 924,
"end": 935,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 924,
"end": 931,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 932,
"end": 935,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 936,
"end": 948,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 936,
"end": 946,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 936,
"end": 939,
"ctxt": 0
},
"value": "one",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 940,
"end": 946,
"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
}