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

184 lines
4.6 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 16,
"end": 79,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 16,
"end": 79,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 20,
"end": 78,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 20,
"end": 21,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ConditionalExpression",
"span": {
"start": 24,
"end": 78,
"ctxt": 0
},
"test": {
"type": "TemplateLiteral",
"span": {
"start": 24,
"end": 40,
"ctxt": 0
},
"expressions": [
{
"type": "StringLiteral",
"span": {
"start": 31,
"end": 34,
"ctxt": 0
},
"value": " ",
"raw": "\" \""
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 25,
"end": 28,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 36,
"end": 39,
"ctxt": 0
},
"tail": true,
"cooked": "def",
"raw": "def"
}
]
},
"consequent": {
"type": "TemplateLiteral",
"span": {
"start": 43,
"end": 59,
"ctxt": 0
},
"expressions": [
{
"type": "StringLiteral",
"span": {
"start": 50,
"end": 53,
"ctxt": 0
},
"value": " ",
"raw": "\" \""
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 44,
"end": 47,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 55,
"end": 58,
"ctxt": 0
},
"tail": true,
"cooked": "def",
"raw": "def"
}
]
},
"alternate": {
"type": "TemplateLiteral",
"span": {
"start": 62,
"end": 78,
"ctxt": 0
},
"expressions": [
{
"type": "StringLiteral",
"span": {
"start": 69,
"end": 72,
"ctxt": 0
},
"value": " ",
"raw": "\" \""
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 63,
"end": 66,
"ctxt": 0
},
"tail": false,
"cooked": "abc",
"raw": "abc"
},
{
"type": "TemplateElement",
"span": {
"start": 74,
"end": 77,
"ctxt": 0
},
"tail": true,
"cooked": "def",
"raw": "def"
}
]
}
},
"definite": false
}
]
}
],
"interpreter": null
}