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

352 lines
10 KiB
JSON

{
"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": " ",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 25,
"end": 28,
"ctxt": 0
},
"tail": false,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 25,
"end": 28,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 25,
"end": 28,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
},
{
"type": "TemplateElement",
"span": {
"start": 36,
"end": 39,
"ctxt": 0
},
"tail": true,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 36,
"end": 39,
"ctxt": 0
},
"value": "def",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 36,
"end": 39,
"ctxt": 0
},
"value": "def",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
}
]
},
"consequent": {
"type": "TemplateLiteral",
"span": {
"start": 43,
"end": 59,
"ctxt": 0
},
"expressions": [
{
"type": "StringLiteral",
"span": {
"start": 50,
"end": 53,
"ctxt": 0
},
"value": " ",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 44,
"end": 47,
"ctxt": 0
},
"tail": false,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 44,
"end": 47,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 44,
"end": 47,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
},
{
"type": "TemplateElement",
"span": {
"start": 55,
"end": 58,
"ctxt": 0
},
"tail": true,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 55,
"end": 58,
"ctxt": 0
},
"value": "def",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 55,
"end": 58,
"ctxt": 0
},
"value": "def",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
}
]
},
"alternate": {
"type": "TemplateLiteral",
"span": {
"start": 62,
"end": 78,
"ctxt": 0
},
"expressions": [
{
"type": "StringLiteral",
"span": {
"start": 69,
"end": 72,
"ctxt": 0
},
"value": " ",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 63,
"end": 66,
"ctxt": 0
},
"tail": false,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 63,
"end": 66,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 63,
"end": 66,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
},
{
"type": "TemplateElement",
"span": {
"start": 74,
"end": 77,
"ctxt": 0
},
"tail": true,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 74,
"end": 77,
"ctxt": 0
},
"value": "def",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 74,
"end": 77,
"ctxt": 0
},
"value": "def",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
}
]
}
},
"definite": false
}
]
}
],
"interpreter": null
}