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

284 lines
8.9 KiB
JSON
Raw Normal View History

{
"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": {
"type": "StringLiteral",
"span": {
"start": 28,
"end": 31,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 28,
"end": 31,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
},
{
"type": "TemplateElement",
"span": {
"start": 37,
"end": 40,
"ctxt": 0
},
"tail": true,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 37,
"end": 40,
"ctxt": 0
},
"value": "def",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 37,
"end": 40,
"ctxt": 0
},
"value": "def",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
}
]
}
},
{
"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": {
"type": "StringLiteral",
"span": {
"start": 54,
"end": 57,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 54,
"end": 57,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
},
{
"type": "TemplateElement",
"span": {
"start": 63,
"end": 66,
"ctxt": 0
},
"tail": true,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 63,
"end": 66,
"ctxt": 0
},
"value": "def",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 63,
"end": 66,
"ctxt": 0
},
"value": "def",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
}
]
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
"definite": false
}
]
}
],
"interpreter": null
}