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

153 lines
4.0 KiB
JSON

{
"type": "Script",
"span": {
"start": 17,
"end": 67,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 17,
"end": 67,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 21,
"end": 66,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 21,
"end": 22,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "TemplateLiteral",
"span": {
"start": 25,
"end": 66,
"ctxt": 0
},
"expressions": [
{
"type": "BinaryExpression",
"span": {
"start": 32,
"end": 60,
"ctxt": 0
},
"operator": "in",
"left": {
"type": "StringLiteral",
"span": {
"start": 32,
"end": 36,
"ctxt": 0
},
"value": "hi",
"raw": "\"hi\""
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 40,
"end": 60,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 42,
"end": 44,
"ctxt": 0
},
"value": "hi",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 46,
"end": 48,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 50,
"end": 55,
"ctxt": 0
},
"value": "hello",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 57,
"end": 59,
"ctxt": 0
},
"value": 20.0,
"raw": "20"
}
}
]
}
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 26,
"end": 29,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 62,
"end": 65,
"ctxt": 0
},
"tail": true,
"cooked": "def",
"raw": "def"
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}