swc/crates/swc_ecma_parser/tests/tsc/importCallExpression5ES2020.json
2022-02-04 17:08:38 +09:00

666 lines
16 KiB
JSON

{
"type": "Module",
"span": {
"start": 84,
"end": 478,
"ctxt": 0
},
"body": [
{
"type": "ExportDeclaration",
"span": {
"start": 84,
"end": 133,
"ctxt": 0
},
"declaration": {
"type": "ClassDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "B",
"optional": false
},
"declare": false,
"span": {
"start": 91,
"end": 133,
"ctxt": 0
},
"decorators": [],
"body": [
{
"type": "ClassMethod",
"span": {
"start": 105,
"end": 131,
"ctxt": 0
},
"key": {
"type": "Identifier",
"span": {
"start": 105,
"end": 110,
"ctxt": 0
},
"value": "print",
"optional": false
},
"function": {
"params": [],
"decorators": [],
"span": {
"start": 105,
"end": 131,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 113,
"end": 131,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 115,
"end": 130,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 122,
"end": 130,
"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": 135,
"end": 173,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 151,
"end": 154,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 142,
"end": 173,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 157,
"end": 173,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 159,
"end": 171,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 166,
"end": 171,
"ctxt": 0
},
"value": "foo",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "ExportDeclaration",
"span": {
"start": 194,
"end": 239,
"ctxt": 0
},
"declaration": {
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 210,
"end": 216,
"ctxt": 0
},
"value": "backup",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 201,
"end": 239,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 219,
"end": 239,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 221,
"end": 237,
"ctxt": 0
},
"argument": {
"type": "StringLiteral",
"span": {
"start": 228,
"end": 236,
"ctxt": 0
},
"value": "backup",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 277,
"end": 280,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"declare": true,
"params": [],
"decorators": [],
"span": {
"start": 260,
"end": 292,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 282,
"end": 291,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 284,
"end": 291,
"ctxt": 0
},
"kind": "boolean"
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 293,
"end": 335,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 299,
"end": 334,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 299,
"end": 306,
"ctxt": 0
},
"value": "specify",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ConditionalExpression",
"span": {
"start": 309,
"end": 334,
"ctxt": 0
},
"test": {
"type": "CallExpression",
"span": {
"start": 309,
"end": 314,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 309,
"end": 312,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"consequent": {
"type": "StringLiteral",
"span": {
"start": 317,
"end": 322,
"ctxt": 0
},
"value": "./0",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"alternate": {
"type": "Identifier",
"span": {
"start": 325,
"end": 334,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 336,
"end": 367,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 340,
"end": 366,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 340,
"end": 348,
"ctxt": 0
},
"value": "myModule",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 351,
"end": 366,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 351,
"end": 357,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 358,
"end": 365,
"ctxt": 0
},
"value": "specify",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 368,
"end": 402,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 372,
"end": 401,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 372,
"end": 381,
"ctxt": 0
},
"value": "myModule1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 384,
"end": 401,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 384,
"end": 390,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 391,
"end": 400,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 403,
"end": 448,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 407,
"end": 447,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 407,
"end": 416,
"ctxt": 0
},
"value": "myModule2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 419,
"end": 447,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 419,
"end": 425,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ConditionalExpression",
"span": {
"start": 426,
"end": 446,
"ctxt": 0
},
"test": {
"type": "CallExpression",
"span": {
"start": 426,
"end": 431,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 426,
"end": 429,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"consequent": {
"type": "StringLiteral",
"span": {
"start": 434,
"end": 439,
"ctxt": 0
},
"value": "./1",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"alternate": {
"type": "NullLiteral",
"span": {
"start": 442,
"end": 446,
"ctxt": 0
}
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 449,
"end": 478,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 453,
"end": 477,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 453,
"end": 462,
"ctxt": 0
},
"value": "myModule3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 465,
"end": 477,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 465,
"end": 471,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NullLiteral",
"span": {
"start": 472,
"end": 476,
"ctxt": 0
}
}
}
],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}