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

611 lines
20 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 140,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 140,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 4,
"end": 139,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 4,
"end": 5,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 8,
"end": 139,
"ctxt": 0
},
"operator": "||",
"left": {
"type": "BinaryExpression",
"span": {
"start": 8,
"end": 30,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 8,
"end": 20,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 14,
"end": 15,
"ctxt": 0
},
"value": 0.0
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 9,
"end": 12,
"ctxt": 0
},
"tail": false,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 9,
"end": 12,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 9,
"end": 12,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
},
{
"type": "TemplateElement",
"span": {
"start": 16,
"end": 19,
"ctxt": 0
},
"tail": true,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 16,
"end": 19,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 16,
"end": 19,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
}
]
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 25,
"end": 30,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 26,
"end": 29,
"ctxt": 0
},
"tail": true,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 26,
"end": 29,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 26,
"end": 29,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
}
]
}
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 42,
"end": 139,
"ctxt": 0
},
"operator": "&&",
"left": {
"type": "BinaryExpression",
"span": {
"start": 42,
"end": 101,
"ctxt": 0
},
"operator": "&&",
"left": {
"type": "BinaryExpression",
"span": {
"start": 42,
"end": 64,
"ctxt": 0
},
"operator": "!==",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 42,
"end": 47,
"ctxt": 0
},
"expressions": [],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 43,
"end": 46,
"ctxt": 0
},
"tail": true,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 43,
"end": 46,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 43,
"end": 46,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
}
]
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 52,
"end": 64,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 58,
"end": 59,
"ctxt": 0
},
"value": 0.0
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 53,
"end": 56,
"ctxt": 0
},
"tail": false,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 53,
"end": 56,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 53,
"end": 56,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
},
{
"type": "TemplateElement",
"span": {
"start": 60,
"end": 63,
"ctxt": 0
},
"tail": true,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 60,
"end": 63,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 60,
"end": 63,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
}
]
}
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 76,
"end": 101,
"ctxt": 0
},
"operator": "==",
"left": {
"type": "TemplateLiteral",
"span": {
"start": 76,
"end": 88,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 82,
"end": 83,
"ctxt": 0
},
"value": 0.0
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 77,
"end": 80,
"ctxt": 0
},
"tail": false,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 77,
"end": 80,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 77,
"end": 80,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
},
{
"type": "TemplateElement",
"span": {
"start": 84,
"end": 87,
"ctxt": 0
},
"tail": true,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 84,
"end": 87,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 84,
"end": 87,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
}
]
},
"right": {
"type": "StringLiteral",
"span": {
"start": 92,
"end": 101,
"ctxt": 0
},
"value": "abc0abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 113,
"end": 139,
"ctxt": 0
},
"operator": "!==",
"left": {
"type": "StringLiteral",
"span": {
"start": 113,
"end": 122,
"ctxt": 0
},
"value": "abc0abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"right": {
"type": "TemplateLiteral",
"span": {
"start": 127,
"end": 139,
"ctxt": 0
},
"expressions": [
{
"type": "NumericLiteral",
"span": {
"start": 133,
"end": 134,
"ctxt": 0
},
"value": 0.0
}
],
"quasis": [
{
"type": "TemplateElement",
"span": {
"start": 128,
"end": 131,
"ctxt": 0
},
"tail": false,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 128,
"end": 131,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 128,
"end": 131,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
},
{
"type": "TemplateElement",
"span": {
"start": 135,
"end": 138,
"ctxt": 0
},
"tail": true,
"cooked": {
"type": "StringLiteral",
"span": {
"start": 135,
"end": 138,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
},
"raw": {
"type": "StringLiteral",
"span": {
"start": 135,
"end": 138,
"ctxt": 0
},
"value": "abc",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": false
}
}
}
]
}
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}