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

182 lines
5.0 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 72,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 72,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 5,
"end": 71,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 6,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "FunctionExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 18,
"end": 19,
"ctxt": 0
},
"value": "y",
"optional": false
},
"params": [],
"decorators": [],
"span": {
"start": 9,
"end": 71,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 22,
"end": 71,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 28,
"end": 42,
"ctxt": 0
},
"expression": {
"type": "TemplateLiteral",
"span": {
"start": 28,
"end": 42,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 35,
"end": 36,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 29,
"end": 32,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 38,
"end": 41,
"ctxt": 0
},
"tail": true,
"cooked": "def",
"raw": "def"
}
]
}
},
{
"type": "ReturnStatement",
"span": {
"start": 47,
"end": 69,
"ctxt": 0
},
"argument": {
"type": "TemplateLiteral",
"span": {
"start": 54,
"end": 68,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 61,
"end": 62,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 55,
"end": 58,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 64,
"end": 67,
"ctxt": 0
},
"tail": true,
"cooked": "def",
"raw": "def"
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
}
],
"interpreter": null
}