swc/crates/swc_ecma_parser/tests/tsc/importCallExpressionShouldNotGetParen.json
2022-03-22 07:54:08 +00:00

424 lines
12 KiB
JSON

{
"type": "Script",
"span": {
"start": 59,
"end": 236,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 59,
"end": 86,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 65,
"end": 85,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 65,
"end": 75,
"ctxt": 0
},
"value": "localeName",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "StringLiteral",
"span": {
"start": 78,
"end": 85,
"ctxt": 0
},
"value": "zh-CN",
"raw": "\"zh-CN\""
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 87,
"end": 158,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 87,
"end": 157,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 87,
"end": 128,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 87,
"end": 123,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 87,
"end": 93,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "TemplateLiteral",
"span": {
"start": 94,
"end": 122,
"ctxt": 0
},
"expressions": [
{
"type": "Identifier",
"span": {
"start": 107,
"end": 117,
"ctxt": 0
},
"value": "localeName",
"optional": false
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 95,
"end": 105,
"ctxt": 0
},
"tail": false,
"cooked": "./locales/",
"raw": "./locales/"
},
{
"type": "TemplateElement",
"span": {
"start": 118,
"end": 121,
"ctxt": 0
},
"tail": true,
"cooked": ".js",
"raw": ".js"
}
]
}
}
],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 124,
"end": 128,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 129,
"end": 156,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 129,
"end": 132,
"ctxt": 0
},
"value": "bar",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 136,
"end": 156,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 142,
"end": 154,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 146,
"end": 153,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 150,
"end": 153,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"definite": false
}
]
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 160,
"end": 236,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 160,
"end": 235,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 160,
"end": 206,
"ctxt": 0
},
"object": {
"type": "CallExpression",
"span": {
"start": 160,
"end": 201,
"ctxt": 0
},
"callee": {
"type": "Import",
"span": {
"start": 160,
"end": 166,
"ctxt": 0
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "BinaryExpression",
"span": {
"start": 167,
"end": 200,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "BinaryExpression",
"span": {
"start": 167,
"end": 192,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "StringLiteral",
"span": {
"start": 167,
"end": 179,
"ctxt": 0
},
"value": "./locales/",
"raw": "\"./locales/\""
},
"right": {
"type": "Identifier",
"span": {
"start": 182,
"end": 192,
"ctxt": 0
},
"value": "localeName",
"optional": false
}
},
"right": {
"type": "StringLiteral",
"span": {
"start": 195,
"end": 200,
"ctxt": 0
},
"value": ".js",
"raw": "\".js\""
}
}
}
],
"typeArguments": null
},
"property": {
"type": "Identifier",
"span": {
"start": 202,
"end": 206,
"ctxt": 0
},
"value": "then",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 207,
"end": 234,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 207,
"end": 210,
"ctxt": 0
},
"value": "bar",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 214,
"end": 234,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 220,
"end": 232,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 224,
"end": 231,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 224,
"end": 225,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "Identifier",
"span": {
"start": 228,
"end": 231,
"ctxt": 0
},
"value": "bar",
"optional": false
},
"definite": false
}
]
}
]
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}