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

928 lines
32 KiB
JSON

{
"type": "Module",
"span": {
"start": 33,
"end": 570,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 33,
"end": 82,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 46,
"end": 47,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 40,
"end": 82,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 54,
"end": 80,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 54,
"end": 59,
"ctxt": 0
},
"value": "print",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 54,
"end": 80,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 62,
"end": 80,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 64,
"end": 79,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 71,
"end": 79,
"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": 84,
"end": 122,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 100,
"end": 103,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 91,
"end": 122,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 106,
"end": 122,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 108,
"end": 120,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 115,
"end": 120,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 143,
"end": 188,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 159,
"end": 165,
"ctxt": 0
},
"value": "backup",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 150,
"end": 188,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 168,
"end": 188,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 170,
"end": 186,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 177,
"end": 185,
"ctxt": 0
},
"value": "backup",
"raw": "\"backup\""
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 209,
"end": 234,
"ctxt": 0
},
"kind": "var",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 221,
"end": 233,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 221,
"end": 228,
"ctxt": 0
},
"value": "console",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 228,
"end": 233,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 230,
"end": 233,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": "C",
"optional": false
},
"declare": false,
"span": {
"start": 235,
"end": 570,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassProperty",
"span": {
"start": 249,
"end": 282,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 257,
"end": 265,
"ctxt": 0
},
"value": "myModule",
"optional": false
},
"value": {
"type": "CallExpression",
"span": {
"start": 268,
"end": 281,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 268,
"end": 274,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 275,
"end": 280,
"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": 287,
"end": 568,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 287,
"end": 293,
"ctxt": 0
},
"value": "method",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 287,
"end": 568,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 296,
"end": 568,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 306,
"end": 338,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 312,
"end": 337,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 312,
"end": 321,
"ctxt": 0
},
"value": "loadAsync",
"optional": false,
"typeAnnotation": null
},
"init": {
"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",
"raw": "\"./0\""
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 347,
"end": 562,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 347,
"end": 561,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 347,
"end": 365,
"ctxt": 0
},
"object": {
"type": "MemberExpression",
"span": {
"start": 347,
"end": 360,
"ctxt": 0
},
"object": {
"type": "ThisExpression",
"span": {
"start": 347,
"end": 351,
"ctxt": 0
}
},
"property": {
"type": "Identifier",
"span": {
"start": 352,
"end": 360,
"ctxt": 0
},
"value": "myModule",
"optional": false
}
},
"property": {
"type": "Identifier",
"span": {
"start": 361,
"end": 365,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 366,
"end": 422,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 366,
"end": 370,
"ctxt": 0
},
"value": "Zero",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 374,
"end": 422,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 388,
"end": 412,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 388,
"end": 411,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 388,
"end": 399,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 388,
"end": 395,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 396,
"end": 399,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 400,
"end": 410,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 400,
"end": 408,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 400,
"end": 404,
"ctxt": 0
},
"value": "Zero",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 405,
"end": 408,
"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": 424,
"end": 560,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 430,
"end": 433,
"ctxt": 0
},
"value": "err",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 437,
"end": 560,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 451,
"end": 468,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 451,
"end": 467,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 451,
"end": 462,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 451,
"end": 458,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 459,
"end": 462,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 463,
"end": 466,
"ctxt": 0
},
"value": "err",
"optional": false
}
}
],
"typeArguments": null
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 481,
"end": 511,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 485,
"end": 510,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 485,
"end": 488,
"ctxt": 0
},
"value": "one",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "AwaitExpression",
"span": {
"start": 491,
"end": 510,
"ctxt": 0
},
"argument": {
"type": "CallExpression",
"span": {
"start": 497,
"end": 510,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 497,
"end": 503,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 504,
"end": 509,
"ctxt": 0
},
"value": "./1",
"raw": "\"./1\""
}
}
],
"typeArguments": null
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 524,
"end": 550,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 524,
"end": 549,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 524,
"end": 535,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 524,
"end": 531,
"ctxt": 0
},
"value": "console",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 532,
"end": 535,
"ctxt": 0
},
"value": "log",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
"start": 536,
"end": 548,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 536,
"end": 546,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 536,
"end": 539,
"ctxt": 0
},
"value": "one",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 540,
"end": 546,
"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
}