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

1273 lines
28 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 439,
"ctxt": 0
},
"body": [
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 1,
"end": 47,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 11,
"end": 19,
"ctxt": 0
},
"value": "Runnable",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 20,
"end": 47,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 26,
"end": 45,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 26,
"end": 35,
"ctxt": 0
},
"value": "isRunning",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 35,
"end": 44,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 37,
"end": 44,
"ctxt": 0
},
"kind": "boolean"
}
},
"typeParams": null
}
]
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 49,
"end": 122,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 59,
"end": 71,
"ctxt": 0
},
"value": "Refrigerator",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 80,
"end": 88,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 80,
"end": 88,
"ctxt": 0
},
"value": "Runnable",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 89,
"end": 122,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 95,
"end": 120,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 95,
"end": 110,
"ctxt": 0
},
"value": "makesFoodGoBrrr",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 110,
"end": 119,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 112,
"end": 119,
"ctxt": 0
},
"kind": "boolean"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 124,
"end": 138,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 128,
"end": 137,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 129,
"end": 137,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 131,
"end": 137,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 139,
"end": 167,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 143,
"end": 166,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 143,
"end": 144,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 144,
"end": 166,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 146,
"end": 166,
"ctxt": 0
},
"types": [
{
"type": "TsLiteralType",
"span": {
"start": 146,
"end": 151,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 146,
"end": 151,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
}
},
{
"type": "TsTypeReference",
"span": {
"start": 154,
"end": 166,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 154,
"end": 166,
"ctxt": 0
},
"value": "Refrigerator",
"optional": false
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 169,
"end": 184,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 173,
"end": 183,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 173,
"end": 174,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 174,
"end": 183,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 176,
"end": 183,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 185,
"end": 196,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 185,
"end": 195,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 185,
"end": 186,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 189,
"end": 195,
"ctxt": 0
},
"operator": "==",
"left": {
"type": "Identifier",
"span": {
"start": 189,
"end": 190,
"ctxt": 0
},
"value": "x",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 194,
"end": 195,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 197,
"end": 211,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 197,
"end": 211,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 197,
"end": 198,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 201,
"end": 211,
"ctxt": 0
},
"operator": "==",
"left": {
"type": "StringLiteral",
"span": {
"start": 201,
"end": 206,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
},
"right": {
"type": "Identifier",
"span": {
"start": 210,
"end": 211,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 212,
"end": 227,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 212,
"end": 226,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 212,
"end": 213,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 216,
"end": 226,
"ctxt": 0
},
"operator": "==",
"left": {
"type": "Identifier",
"span": {
"start": 216,
"end": 217,
"ctxt": 0
},
"value": "y",
"optional": false
},
"right": {
"type": "StringLiteral",
"span": {
"start": 221,
"end": 226,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 228,
"end": 247,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 228,
"end": 246,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 228,
"end": 229,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 232,
"end": 246,
"ctxt": 0
},
"operator": "==",
"left": {
"type": "StringLiteral",
"span": {
"start": 232,
"end": 237,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
},
"right": {
"type": "StringLiteral",
"span": {
"start": 241,
"end": 246,
"ctxt": 0
},
"value": "bar",
"raw": "\"bar\""
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 248,
"end": 263,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 248,
"end": 262,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 248,
"end": 249,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 252,
"end": 262,
"ctxt": 0
},
"operator": "==",
"left": {
"type": "StringLiteral",
"span": {
"start": 252,
"end": 257,
"ctxt": 0
},
"value": "bar",
"raw": "\"bar\""
},
"right": {
"type": "Identifier",
"span": {
"start": 261,
"end": 262,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 264,
"end": 279,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 264,
"end": 278,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 264,
"end": 265,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 268,
"end": 278,
"ctxt": 0
},
"operator": "==",
"left": {
"type": "Identifier",
"span": {
"start": 268,
"end": 269,
"ctxt": 0
},
"value": "x",
"optional": false
},
"right": {
"type": "StringLiteral",
"span": {
"start": 273,
"end": 278,
"ctxt": 0
},
"value": "bar",
"raw": "\"bar\""
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 280,
"end": 295,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 280,
"end": 294,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 280,
"end": 281,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 284,
"end": 294,
"ctxt": 0
},
"operator": "==",
"left": {
"type": "Identifier",
"span": {
"start": 284,
"end": 285,
"ctxt": 0
},
"value": "y",
"optional": false
},
"right": {
"type": "StringLiteral",
"span": {
"start": 289,
"end": 294,
"ctxt": 0
},
"value": "bar",
"raw": "\"bar\""
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 296,
"end": 311,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 296,
"end": 310,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 296,
"end": 297,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 300,
"end": 310,
"ctxt": 0
},
"operator": "==",
"left": {
"type": "StringLiteral",
"span": {
"start": 300,
"end": 305,
"ctxt": 0
},
"value": "bar",
"raw": "\"bar\""
},
"right": {
"type": "Identifier",
"span": {
"start": 309,
"end": 310,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 313,
"end": 324,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 313,
"end": 323,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 313,
"end": 314,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 317,
"end": 323,
"ctxt": 0
},
"operator": "!=",
"left": {
"type": "Identifier",
"span": {
"start": 317,
"end": 318,
"ctxt": 0
},
"value": "x",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 322,
"end": 323,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 325,
"end": 339,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 325,
"end": 339,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 325,
"end": 326,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 329,
"end": 339,
"ctxt": 0
},
"operator": "!=",
"left": {
"type": "StringLiteral",
"span": {
"start": 329,
"end": 334,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
},
"right": {
"type": "Identifier",
"span": {
"start": 338,
"end": 339,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 340,
"end": 355,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 340,
"end": 354,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 340,
"end": 341,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 344,
"end": 354,
"ctxt": 0
},
"operator": "!=",
"left": {
"type": "Identifier",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"value": "y",
"optional": false
},
"right": {
"type": "StringLiteral",
"span": {
"start": 349,
"end": 354,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 356,
"end": 375,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 356,
"end": 374,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 356,
"end": 357,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 360,
"end": 374,
"ctxt": 0
},
"operator": "!=",
"left": {
"type": "StringLiteral",
"span": {
"start": 360,
"end": 365,
"ctxt": 0
},
"value": "foo",
"raw": "\"foo\""
},
"right": {
"type": "StringLiteral",
"span": {
"start": 369,
"end": 374,
"ctxt": 0
},
"value": "bar",
"raw": "\"bar\""
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 376,
"end": 391,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 376,
"end": 390,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 376,
"end": 377,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 380,
"end": 390,
"ctxt": 0
},
"operator": "!=",
"left": {
"type": "StringLiteral",
"span": {
"start": 380,
"end": 385,
"ctxt": 0
},
"value": "bar",
"raw": "\"bar\""
},
"right": {
"type": "Identifier",
"span": {
"start": 389,
"end": 390,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 392,
"end": 407,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 392,
"end": 406,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 392,
"end": 393,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 396,
"end": 406,
"ctxt": 0
},
"operator": "!=",
"left": {
"type": "Identifier",
"span": {
"start": 396,
"end": 397,
"ctxt": 0
},
"value": "x",
"optional": false
},
"right": {
"type": "StringLiteral",
"span": {
"start": 401,
"end": 406,
"ctxt": 0
},
"value": "bar",
"raw": "\"bar\""
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 408,
"end": 423,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 408,
"end": 422,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 408,
"end": 409,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 412,
"end": 422,
"ctxt": 0
},
"operator": "!=",
"left": {
"type": "Identifier",
"span": {
"start": 412,
"end": 413,
"ctxt": 0
},
"value": "y",
"optional": false
},
"right": {
"type": "StringLiteral",
"span": {
"start": 417,
"end": 422,
"ctxt": 0
},
"value": "bar",
"raw": "\"bar\""
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 424,
"end": 439,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 424,
"end": 438,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 424,
"end": 425,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 428,
"end": 438,
"ctxt": 0
},
"operator": "!=",
"left": {
"type": "StringLiteral",
"span": {
"start": 428,
"end": 433,
"ctxt": 0
},
"value": "bar",
"raw": "\"bar\""
},
"right": {
"type": "Identifier",
"span": {
"start": 437,
"end": 438,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
}
}
],
"interpreter": null
}