swc/crates/swc_ecma_parser/tests/tsc/for-inStatementsArray.json

1623 lines
46 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 555,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 15,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 5,
"end": 14,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 6,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 6,
"end": 14,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 8,
"end": 14,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
"start": 8,
"end": 12,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 8,
"end": 12,
"ctxt": 0
},
"value": "Date",
"optional": false
},
"typeParams": null
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 16,
"end": 33,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 20,
"end": 32,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 20,
"end": 21,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 21,
"end": 32,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 23,
"end": 32,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 23,
"end": 30,
"ctxt": 0
},
"kind": "boolean"
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForInStatement",
"span": {
"start": 35,
"end": 175,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
"start": 40,
"end": 45,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 44,
"end": 45,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 44,
"end": 45,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 49,
"end": 50,
"ctxt": 0
},
"value": "a",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 52,
"end": 175,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 58,
"end": 72,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 62,
"end": 71,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 62,
"end": 64,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 67,
"end": 71,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 67,
"end": 68,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 68,
"end": 71,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 69,
"end": 70,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 77,
"end": 93,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 81,
"end": 92,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 81,
"end": 83,
"ctxt": 0
},
"value": "a2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 86,
"end": 92,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 87,
"end": 92,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 88,
"end": 91,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 89,
"end": 90,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 98,
"end": 113,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 102,
"end": 112,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 102,
"end": 104,
"ctxt": 0
},
"value": "a3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 107,
"end": 112,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 107,
"end": 108,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 108,
"end": 112,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 109,
"end": 111,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "Identifier",
"span": {
"start": 110,
"end": 111,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 118,
"end": 132,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 122,
"end": 131,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 122,
"end": 124,
"ctxt": 0
},
"value": "b1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 127,
"end": 131,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 127,
"end": 128,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 128,
"end": 131,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 129,
"end": 130,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 137,
"end": 153,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 141,
"end": 152,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 141,
"end": 143,
"ctxt": 0
},
"value": "b2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 146,
"end": 152,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 146,
"end": 147,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 147,
"end": 152,
"ctxt": 0
},
"expression": {
"type": "ParenthesisExpression",
"span": {
"start": 148,
"end": 151,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 149,
"end": 150,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 158,
"end": 173,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 162,
"end": 172,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 162,
"end": 164,
"ctxt": 0
},
"value": "b3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 167,
"end": 172,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 167,
"end": 168,
"ctxt": 0
},
"value": "b",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 168,
"end": 172,
"ctxt": 0
},
"expression": {
"type": "UnaryExpression",
"span": {
"start": 169,
"end": 171,
"ctxt": 0
},
"operator": "+",
"argument": {
"type": "Identifier",
"span": {
"start": 170,
"end": 171,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
}
},
"definite": false
}
]
}
]
}
},
{
"type": "ForInStatement",
"span": {
"start": 177,
"end": 344,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
"start": 182,
"end": 187,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 186,
"end": 187,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 186,
"end": 187,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 191,
"end": 192,
"ctxt": 0
},
"value": "a",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 194,
"end": 344,
"ctxt": 0
},
"stmts": [
{
"type": "ForInStatement",
"span": {
"start": 200,
"end": 342,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
"start": 205,
"end": 210,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 209,
"end": 210,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 209,
"end": 210,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 214,
"end": 215,
"ctxt": 0
},
"value": "a",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 217,
"end": 342,
"ctxt": 0
},
"stmts": [
{
"type": "ForInStatement",
"span": {
"start": 227,
"end": 336,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
"start": 232,
"end": 237,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 236,
"end": 237,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 236,
"end": 237,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": "a",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 244,
"end": 336,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 258,
"end": 272,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 262,
"end": 271,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 262,
"end": 264,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 267,
"end": 271,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 267,
"end": 268,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 268,
"end": 271,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 269,
"end": 270,
"ctxt": 0
},
"value": "x",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 285,
"end": 299,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 289,
"end": 298,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 289,
"end": 291,
"ctxt": 0
},
"value": "a2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 294,
"end": 298,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 294,
"end": 295,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 295,
"end": 298,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 296,
"end": 297,
"ctxt": 0
},
"value": "y",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 312,
"end": 326,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 316,
"end": 325,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 316,
"end": 318,
"ctxt": 0
},
"value": "a3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 321,
"end": 325,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 321,
"end": 322,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 322,
"end": 325,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 323,
"end": 324,
"ctxt": 0
},
"value": "z",
"optional": false
}
}
},
"definite": false
}
]
}
]
}
}
]
}
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 346,
"end": 360,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 350,
"end": 359,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 350,
"end": 351,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 351,
"end": 359,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 353,
"end": 359,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 361,
"end": 375,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 365,
"end": 374,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 365,
"end": 366,
"ctxt": 0
},
"value": "j",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 366,
"end": 374,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 368,
"end": 374,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForInStatement",
"span": {
"start": 376,
"end": 463,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 381,
"end": 382,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 386,
"end": 387,
"ctxt": 0
},
"value": "a",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 389,
"end": 463,
"ctxt": 0
},
"stmts": [
{
"type": "ForInStatement",
"span": {
"start": 395,
"end": 461,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 400,
"end": 401,
"ctxt": 0
},
"value": "j",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 405,
"end": 406,
"ctxt": 0
},
"value": "b",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 408,
"end": 461,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 418,
"end": 432,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 422,
"end": 431,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 422,
"end": 424,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 427,
"end": 431,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 427,
"end": 428,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 428,
"end": 431,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 429,
"end": 430,
"ctxt": 0
},
"value": "i",
"optional": false
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 441,
"end": 455,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 445,
"end": 454,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 445,
"end": 447,
"ctxt": 0
},
"value": "a2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 450,
"end": 454,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 450,
"end": 451,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 451,
"end": 454,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 452,
"end": 453,
"ctxt": 0
},
"value": "j",
"optional": false
}
}
},
"definite": false
}
]
}
]
}
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 465,
"end": 479,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 469,
"end": 478,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 469,
"end": 470,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 470,
"end": 478,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 472,
"end": 478,
"ctxt": 0
},
"kind": "string"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ForInStatement",
"span": {
"start": 480,
"end": 519,
"ctxt": 0
},
"left": {
"type": "VariableDeclaration",
"span": {
"start": 485,
"end": 490,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 489,
"end": 490,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 489,
"end": 490,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": null
},
"init": null,
"definite": false
}
]
},
"right": {
"type": "Identifier",
"span": {
"start": 494,
"end": 495,
"ctxt": 0
},
"value": "a",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 497,
"end": 519,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 503,
"end": 517,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 507,
"end": 516,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 507,
"end": 509,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 512,
"end": 516,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 512,
"end": 513,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 513,
"end": 516,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 514,
"end": 515,
"ctxt": 0
},
"value": "s",
"optional": false
}
}
},
"definite": false
}
]
}
]
}
},
{
"type": "ForInStatement",
"span": {
"start": 520,
"end": 555,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 525,
"end": 526,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 530,
"end": 531,
"ctxt": 0
},
"value": "a",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 533,
"end": 555,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 539,
"end": 553,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 543,
"end": 552,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 543,
"end": 545,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 548,
"end": 552,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 548,
"end": 549,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 549,
"end": 552,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 550,
"end": 551,
"ctxt": 0
},
"value": "s",
"optional": false
}
}
},
"definite": false
}
]
}
]
}
}
],
"interpreter": null
}