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

180 lines
4.9 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 71,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 71,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 4,
"end": 70,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 4,
"end": 5,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "FunctionExpression",
"identifier": {
"type": "Identifier",
"span": {
"start": 17,
"end": 18,
"ctxt": 0
},
"value": "y",
"optional": false
},
"params": [],
"decorators": [],
"span": {
"start": 8,
"end": 70,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 21,
"end": 70,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 27,
"end": 41,
"ctxt": 0
},
"expression": {
"type": "TemplateLiteral",
"span": {
"start": 27,
"end": 41,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 34,
"end": 35,
"ctxt": 0
},
"value": 0.0
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 28,
"end": 31,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 37,
"end": 40,
"ctxt": 0
},
"tail": true,
"cooked": "def",
"raw": "def"
}
]
}
},
{
"type": "ReturnStatement",
"span": {
"start": 46,
"end": 68,
"ctxt": 0
},
"argument": {
"type": "TemplateLiteral",
"span": {
"start": 53,
"end": 67,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 60,
"end": 61,
"ctxt": 0
},
"value": 0.0
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 54,
"end": 57,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 63,
"end": 66,
"ctxt": 0
},
"tail": true,
"cooked": "def",
"raw": "def"
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
}
],
"interpreter": null
}