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

286 lines
6.9 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 0,
2022-02-04 14:17:42 +03:00
"end": 102,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 34,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 4,
"end": 33,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 4,
"end": 5,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 8,
"end": 33,
"ctxt": 0
},
"operator": "===",
"left": {
"type": "StringLiteral",
"span": {
"start": 8,
"end": 13,
"ctxt": 0
},
"value": "foo",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"right": {
"type": "TsAsExpression",
"span": {
"start": 18,
"end": 33,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
"start": 18,
"end": 23,
"ctxt": 0
},
"value": "bar",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 27,
"end": 33,
"ctxt": 0
},
"kind": "string"
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 35,
"end": 71,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 39,
"end": 70,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 39,
"end": 40,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 43,
"end": 70,
"ctxt": 0
},
"operator": "!==",
"left": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 43,
"end": 48,
"ctxt": 0
},
"value": "foo",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"right": {
"type": "ParenthesisExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 53,
"end": 70,
"ctxt": 0
},
"expression": {
"type": "TsAsExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 54,
"end": 69,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 54,
"end": 59,
"ctxt": 0
},
"value": "bar",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 63,
"end": 69,
"ctxt": 0
},
"kind": "string"
}
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 72,
"end": 102,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 76,
"end": 101,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 76,
"end": 77,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 80,
"end": 101,
"ctxt": 0
},
"operator": "==",
"left": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 80,
"end": 85,
"ctxt": 0
},
"value": "foo",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"right": {
"type": "ParenthesisExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 89,
"end": 101,
"ctxt": 0
},
"expression": {
"type": "TsTypeAssertion",
"span": {
2022-02-04 14:17:42 +03:00
"start": 90,
"end": 100,
"ctxt": 0
},
"expression": {
"type": "StringLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 95,
"end": 100,
"ctxt": 0
},
"value": "bar",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 91,
"end": 94,
"ctxt": 0
},
"kind": "any"
}
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}