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

153 lines
4.0 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 51,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 51,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 5,
"end": 50,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 6,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "TemplateLiteral",
"span": {
"start": 9,
"end": 50,
"ctxt": 0
},
"expressions": [
{
"type": "BinaryExpression",
"span": {
"start": 16,
"end": 44,
"ctxt": 0
},
"operator": "in",
"left": {
"type": "StringLiteral",
"span": {
"start": 16,
"end": 20,
"ctxt": 0
},
"value": "hi",
"raw": "\"hi\""
},
"right": {
"type": "ObjectExpression",
"span": {
"start": 24,
"end": 44,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 26,
"end": 28,
"ctxt": 0
},
"value": "hi",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 30,
"end": 32,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
}
},
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
"start": 34,
"end": 39,
"ctxt": 0
},
"value": "hello",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
"start": 41,
"end": 43,
"ctxt": 0
},
"value": 20.0,
"raw": "20"
}
}
]
}
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 10,
"end": 13,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 46,
"end": 49,
"ctxt": 0
},
"tail": true,
"cooked": "def",
"raw": "def"
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}