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

184 lines
4.6 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 64,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 64,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 5,
"end": 63,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 6,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ConditionalExpression",
"span": {
"start": 9,
"end": 63,
"ctxt": 0
},
"test": {
"type": "TemplateLiteral",
"span": {
"start": 9,
"end": 25,
"ctxt": 0
},
"expressions": [
{
"type": "StringLiteral",
"span": {
"start": 16,
"end": 19,
"ctxt": 0
},
"value": " ",
"raw": "\" \""
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 10,
"end": 13,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 21,
"end": 24,
"ctxt": 0
},
"tail": true,
"cooked": "def",
"raw": "def"
}
]
},
"consequent": {
"type": "TemplateLiteral",
"span": {
"start": 28,
"end": 44,
"ctxt": 0
},
"expressions": [
{
"type": "StringLiteral",
"span": {
"start": 35,
"end": 38,
"ctxt": 0
},
"value": " ",
"raw": "\" \""
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 29,
"end": 32,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 40,
"end": 43,
"ctxt": 0
},
"tail": true,
"cooked": "def",
"raw": "def"
}
]
},
"alternate": {
"type": "TemplateLiteral",
"span": {
"start": 47,
"end": 63,
"ctxt": 0
},
"expressions": [
{
"type": "StringLiteral",
"span": {
"start": 54,
"end": 57,
"ctxt": 0
},
"value": " ",
"raw": "\" \""
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 48,
"end": 51,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 59,
"end": 62,
"ctxt": 0
},
"tail": true,
"cooked": "def",
"raw": "def"
}
]
}
},
"definite": false
}
]
}
],
"interpreter": null
}