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

1401 lines
44 KiB
JSON

{
"type": "Script",
"span": {
"start": 30,
"end": 513,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 39,
"end": 41,
"ctxt": 0
},
"value": "f0",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 30,
"end": 292,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 44,
"end": 292,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 50,
"end": 68,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 54,
"end": 67,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 54,
"end": 55,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 58,
"end": 67,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 59,
"end": 60,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 62,
"end": 63,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 65,
"end": 66,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 73,
"end": 89,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 77,
"end": 88,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 77,
"end": 79,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 82,
"end": 88,
"ctxt": 0
},
"elements": [
{
"spread": {
"start": 83,
"end": 86,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 86,
"end": 87,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 94,
"end": 113,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 98,
"end": 112,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 98,
"end": 100,
"ctxt": 0
},
"value": "a2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 103,
"end": 112,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 104,
"end": 105,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"spread": {
"start": 107,
"end": 110,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 110,
"end": 111,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 118,
"end": 140,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 122,
"end": 139,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 122,
"end": 124,
"ctxt": 0
},
"value": "a3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 127,
"end": 139,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 128,
"end": 129,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 131,
"end": 132,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
{
"spread": {
"start": 134,
"end": 137,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 137,
"end": 138,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 145,
"end": 164,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 149,
"end": 163,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 149,
"end": 151,
"ctxt": 0
},
"value": "a4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 154,
"end": 163,
"ctxt": 0
},
"elements": [
{
"spread": {
"start": 155,
"end": 158,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 158,
"end": 159,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 161,
"end": 162,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 169,
"end": 191,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 173,
"end": 190,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 173,
"end": 175,
"ctxt": 0
},
"value": "a5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 178,
"end": 190,
"ctxt": 0
},
"elements": [
{
"spread": {
"start": 179,
"end": 182,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 182,
"end": 183,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 185,
"end": 186,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 188,
"end": 189,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 196,
"end": 224,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 200,
"end": 223,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 200,
"end": 202,
"ctxt": 0
},
"value": "a6",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 205,
"end": 223,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 206,
"end": 207,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 209,
"end": 210,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
{
"spread": {
"start": 212,
"end": 215,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 215,
"end": 216,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 218,
"end": 219,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 221,
"end": 222,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 229,
"end": 257,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 233,
"end": 256,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 233,
"end": 235,
"ctxt": 0
},
"value": "a7",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 238,
"end": 256,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 239,
"end": 240,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"spread": {
"start": 242,
"end": 245,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 245,
"end": 246,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 248,
"end": 249,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
{
"spread": {
"start": 251,
"end": 254,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 254,
"end": 255,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 262,
"end": 290,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 266,
"end": 289,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 266,
"end": 268,
"ctxt": 0
},
"value": "a8",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 271,
"end": 289,
"ctxt": 0
},
"elements": [
{
"spread": {
"start": 272,
"end": 275,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 275,
"end": 276,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": {
"start": 278,
"end": 281,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 281,
"end": 282,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": {
"start": 284,
"end": 287,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 287,
"end": 288,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
]
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 303,
"end": 305,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 294,
"end": 411,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 308,
"end": 411,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 314,
"end": 332,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 318,
"end": 331,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 318,
"end": 319,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 322,
"end": 331,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 323,
"end": 324,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 326,
"end": 327,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 329,
"end": 330,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 337,
"end": 367,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 341,
"end": 366,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 341,
"end": 342,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 345,
"end": 366,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 346,
"end": 353,
"ctxt": 0
},
"value": "hello",
"raw": "\"hello\""
}
},
{
"spread": {
"start": 355,
"end": 358,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 358,
"end": 359,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
{
"spread": null,
"expression": {
"type": "BooleanLiteral",
"span": {
"start": 361,
"end": 365,
"ctxt": 0
},
"value": true
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 372,
"end": 409,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 376,
"end": 408,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 376,
"end": 377,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 377,
"end": 408,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 379,
"end": 408,
"ctxt": 0
},
"elemType": {
"type": "TsParenthesizedType",
"span": {
"start": 379,
"end": 406,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 380,
"end": 405,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 380,
"end": 386,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 389,
"end": 395,
"ctxt": 0
},
"kind": "number"
},
{
"type": "TsKeywordType",
"span": {
"start": 398,
"end": 405,
"ctxt": 0
},
"kind": "boolean"
}
]
}
}
}
}
},
"init": null,
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 422,
"end": 424,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 413,
"end": 513,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 427,
"end": 513,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 433,
"end": 469,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 437,
"end": 468,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 437,
"end": 438,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 441,
"end": 468,
"ctxt": 0
},
"elements": [
{
"spread": {
"start": 442,
"end": 445,
"ctxt": 0
},
"expression": {
"type": "ArrayExpression",
"span": {
"start": 445,
"end": 467,
"ctxt": 0
},
"elements": [
{
"spread": {
"start": 446,
"end": 449,
"ctxt": 0
},
"expression": {
"type": "ArrayExpression",
"span": {
"start": 449,
"end": 466,
"ctxt": 0
},
"elements": [
{
"spread": {
"start": 450,
"end": 453,
"ctxt": 0
},
"expression": {
"type": "ArrayExpression",
"span": {
"start": 453,
"end": 465,
"ctxt": 0
},
"elements": [
{
"spread": {
"start": 454,
"end": 457,
"ctxt": 0
},
"expression": {
"type": "ArrayExpression",
"span": {
"start": 457,
"end": 464,
"ctxt": 0
},
"elements": [
{
"spread": {
"start": 458,
"end": 461,
"ctxt": 0
},
"expression": {
"type": "ArrayExpression",
"span": {
"start": 461,
"end": 463,
"ctxt": 0
},
"elements": []
}
}
]
}
}
]
}
}
]
}
}
]
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 474,
"end": 511,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 478,
"end": 510,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 478,
"end": 479,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 482,
"end": 510,
"ctxt": 0
},
"elements": [
{
"spread": {
"start": 483,
"end": 486,
"ctxt": 0
},
"expression": {
"type": "ArrayExpression",
"span": {
"start": 486,
"end": 509,
"ctxt": 0
},
"elements": [
{
"spread": {
"start": 487,
"end": 490,
"ctxt": 0
},
"expression": {
"type": "ArrayExpression",
"span": {
"start": 490,
"end": 508,
"ctxt": 0
},
"elements": [
{
"spread": {
"start": 491,
"end": 494,
"ctxt": 0
},
"expression": {
"type": "ArrayExpression",
"span": {
"start": 494,
"end": 507,
"ctxt": 0
},
"elements": [
{
"spread": {
"start": 495,
"end": 498,
"ctxt": 0
},
"expression": {
"type": "ArrayExpression",
"span": {
"start": 498,
"end": 506,
"ctxt": 0
},
"elements": [
{
"spread": {
"start": 499,
"end": 502,
"ctxt": 0
},
"expression": {
"type": "ArrayExpression",
"span": {
"start": 502,
"end": 505,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 503,
"end": 504,
"ctxt": 0
},
"value": 5.0,
"raw": "5"
}
}
]
}
}
]
}
}
]
}
}
]
}
}
]
}
}
]
},
"definite": false
}
]
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}