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

1192 lines
28 KiB
JSON

{
"type": "Script",
"span": {
"start": 78,
"end": 406,
"ctxt": 0
},
"body": [
{
"type": "TsEnumDeclaration",
"span": {
"start": 78,
"end": 101,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 83,
"end": 84,
"ctxt": 0
},
"value": "E",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 91,
"end": 92,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 91,
"end": 92,
"ctxt": 0
},
"value": "a",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"value": "b",
"optional": false
},
"init": null
}
]
},
{
"type": "TsEnumDeclaration",
"span": {
"start": 102,
"end": 125,
"ctxt": 0
},
"declare": false,
"isConst": false,
"id": {
"type": "Identifier",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"value": "F",
"optional": false
},
"members": [
{
"type": "TsEnumMember",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"value": "c",
"optional": false
},
"init": null
},
{
"type": "TsEnumMember",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"value": "d",
"optional": false
},
"init": null
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 127,
"end": 138,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 131,
"end": 137,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 131,
"end": 132,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 132,
"end": 137,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 134,
"end": 137,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 139,
"end": 153,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 143,
"end": 152,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 143,
"end": 144,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 144,
"end": 152,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 146,
"end": 152,
"ctxt": 0
},
"kind": "number"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 154,
"end": 167,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 158,
"end": 166,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 158,
"end": 159,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 159,
"end": 166,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 161,
"end": 166,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"value": "E",
"optional": false
},
"typeParams": null
},
{
"type": "TsTypeReference",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"value": "F",
"optional": false
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 184,
"end": 200,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 188,
"end": 199,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 188,
"end": 190,
"ctxt": 0
},
"value": "r1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 193,
"end": 199,
"ctxt": 0
},
"operator": "**",
"left": {
"type": "Identifier",
"span": {
"start": 193,
"end": 194,
"ctxt": 0
},
"value": "c",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 198,
"end": 199,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 201,
"end": 217,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 205,
"end": 216,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 205,
"end": 207,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 210,
"end": 216,
"ctxt": 0
},
"operator": "**",
"left": {
"type": "Identifier",
"span": {
"start": 210,
"end": 211,
"ctxt": 0
},
"value": "c",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 215,
"end": 216,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 218,
"end": 234,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 222,
"end": 233,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 222,
"end": 224,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 227,
"end": 233,
"ctxt": 0
},
"operator": "**",
"left": {
"type": "Identifier",
"span": {
"start": 227,
"end": 228,
"ctxt": 0
},
"value": "c",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 232,
"end": 233,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 235,
"end": 251,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 239,
"end": 250,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 239,
"end": 241,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 244,
"end": 250,
"ctxt": 0
},
"operator": "**",
"left": {
"type": "Identifier",
"span": {
"start": 244,
"end": 245,
"ctxt": 0
},
"value": "a",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 249,
"end": 250,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 252,
"end": 268,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 256,
"end": 267,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 256,
"end": 258,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 261,
"end": 267,
"ctxt": 0
},
"operator": "**",
"left": {
"type": "Identifier",
"span": {
"start": 261,
"end": 262,
"ctxt": 0
},
"value": "b",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 266,
"end": 267,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 269,
"end": 287,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 273,
"end": 286,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 273,
"end": 275,
"ctxt": 0
},
"value": "r6",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 278,
"end": 286,
"ctxt": 0
},
"operator": "**",
"left": {
"type": "MemberExpression",
"span": {
"start": 278,
"end": 281,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 278,
"end": 279,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 280,
"end": 281,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 285,
"end": 286,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 288,
"end": 306,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 292,
"end": 305,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 292,
"end": 294,
"ctxt": 0
},
"value": "r7",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 297,
"end": 305,
"ctxt": 0
},
"operator": "**",
"left": {
"type": "MemberExpression",
"span": {
"start": 297,
"end": 300,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 297,
"end": 298,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 299,
"end": 300,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "Identifier",
"span": {
"start": 304,
"end": 305,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 307,
"end": 327,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 311,
"end": 326,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 311,
"end": 313,
"ctxt": 0
},
"value": "r8",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 316,
"end": 326,
"ctxt": 0
},
"operator": "**",
"left": {
"type": "MemberExpression",
"span": {
"start": 316,
"end": 319,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 316,
"end": 317,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 318,
"end": 319,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "MemberExpression",
"span": {
"start": 323,
"end": 326,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 323,
"end": 324,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 325,
"end": 326,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 328,
"end": 346,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 332,
"end": 345,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 332,
"end": 334,
"ctxt": 0
},
"value": "r9",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 337,
"end": 345,
"ctxt": 0
},
"operator": "**",
"left": {
"type": "MemberExpression",
"span": {
"start": 337,
"end": 340,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 337,
"end": 338,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 339,
"end": 340,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 344,
"end": 345,
"ctxt": 0
},
"value": 1.0
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 347,
"end": 366,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 351,
"end": 365,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 351,
"end": 354,
"ctxt": 0
},
"value": "r10",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 357,
"end": 365,
"ctxt": 0
},
"operator": "**",
"left": {
"type": "Identifier",
"span": {
"start": 357,
"end": 358,
"ctxt": 0
},
"value": "a",
"optional": false
},
"right": {
"type": "MemberExpression",
"span": {
"start": 362,
"end": 365,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 362,
"end": 363,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 364,
"end": 365,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 367,
"end": 386,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 371,
"end": 385,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 371,
"end": 374,
"ctxt": 0
},
"value": "r11",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 377,
"end": 385,
"ctxt": 0
},
"operator": "**",
"left": {
"type": "Identifier",
"span": {
"start": 377,
"end": 378,
"ctxt": 0
},
"value": "b",
"optional": false
},
"right": {
"type": "MemberExpression",
"span": {
"start": 382,
"end": 385,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 382,
"end": 383,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 384,
"end": 385,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 387,
"end": 406,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 391,
"end": 405,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 391,
"end": 394,
"ctxt": 0
},
"value": "r12",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 397,
"end": 405,
"ctxt": 0
},
"operator": "**",
"left": {
"type": "NumericLiteral",
"span": {
"start": 397,
"end": 398,
"ctxt": 0
},
"value": 1.0
},
"right": {
"type": "MemberExpression",
"span": {
"start": 402,
"end": 405,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 402,
"end": 403,
"ctxt": 0
},
"value": "E",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 404,
"end": 405,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}