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

1259 lines
33 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
2022-02-04 14:17:42 +03:00
"start": 62,
"end": 644,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 62,
"end": 91,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 74,
"end": 90,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 74,
"end": 75,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 75,
"end": 90,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 77,
"end": 90,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 79,
"end": 88,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 79,
"end": 80,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 80,
"end": 88,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 82,
"end": 88,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 92,
"end": 122,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 104,
"end": 121,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 104,
"end": 105,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 105,
"end": 121,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 107,
"end": 121,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 109,
"end": 119,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 109,
"end": 110,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 111,
"end": 119,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 113,
"end": 119,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 123,
"end": 164,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 135,
"end": 163,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 135,
"end": 136,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 136,
"end": 163,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 138,
"end": 163,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 140,
"end": 161,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 140,
"end": 141,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 141,
"end": 161,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 143,
"end": 161,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 143,
"end": 149,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 152,
"end": 161,
"ctxt": 0
},
"kind": "undefined"
}
]
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 165,
"end": 207,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 177,
"end": 206,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 177,
"end": 178,
"ctxt": 0
},
"value": "d",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 178,
"end": 206,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 180,
"end": 206,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 182,
"end": 204,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 182,
"end": 183,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 184,
"end": 204,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 186,
"end": 204,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 186,
"end": 192,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 195,
"end": 204,
"ctxt": 0
},
"kind": "undefined"
}
]
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 209,
"end": 232,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 221,
"end": 231,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 221,
"end": 222,
"ctxt": 0
},
"value": "t",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 222,
"end": 231,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 224,
"end": 231,
"ctxt": 0
},
"kind": "boolean"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 234,
"end": 260,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 238,
"end": 259,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 238,
"end": 240,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 243,
"end": 259,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 245,
"end": 246,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 248,
"end": 251,
"ctxt": 0
},
"value": 123.0
}
},
{
"type": "SpreadElement",
"spread": {
2022-02-04 14:17:42 +03:00
"start": 253,
"end": 256,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 256,
"end": 257,
"ctxt": 0
},
"value": "a",
"optional": false
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 280,
"end": 306,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 284,
"end": 305,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 284,
"end": 286,
"ctxt": 0
},
"value": "b1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 289,
"end": 305,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 291,
"end": 292,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 294,
"end": 297,
"ctxt": 0
},
"value": 123.0
}
},
{
"type": "SpreadElement",
"spread": {
2022-02-04 14:17:42 +03:00
"start": 299,
"end": 302,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 302,
"end": 303,
"ctxt": 0
},
"value": "b",
"optional": false
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 327,
"end": 353,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 331,
"end": 352,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 331,
"end": 333,
"ctxt": 0
},
"value": "c1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 336,
"end": 352,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 338,
"end": 339,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 341,
"end": 344,
"ctxt": 0
},
"value": 123.0
}
},
{
"type": "SpreadElement",
"spread": {
2022-02-04 14:17:42 +03:00
"start": 346,
"end": 349,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 349,
"end": 350,
"ctxt": 0
},
"value": "c",
"optional": false
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 385,
"end": 411,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 389,
"end": 410,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 389,
"end": 391,
"ctxt": 0
},
"value": "d1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 394,
"end": 410,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 396,
"end": 397,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 399,
"end": 402,
"ctxt": 0
},
"value": 123.0
}
},
{
"type": "SpreadElement",
"spread": {
2022-02-04 14:17:42 +03:00
"start": 404,
"end": 407,
"ctxt": 0
},
"arguments": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 407,
"end": 408,
"ctxt": 0
},
"value": "d",
"optional": false
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 433,
"end": 470,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 437,
"end": 469,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 437,
"end": 439,
"ctxt": 0
},
"value": "a2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 442,
"end": 469,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 444,
"end": 445,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 447,
"end": 450,
"ctxt": 0
},
"value": 123.0
}
},
{
"type": "SpreadElement",
"spread": {
2022-02-04 14:17:42 +03:00
"start": 452,
"end": 455,
"ctxt": 0
},
"arguments": {
"type": "ParenthesisExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 455,
"end": 467,
"ctxt": 0
},
"expression": {
"type": "ConditionalExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 456,
"end": 466,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 456,
"end": 457,
"ctxt": 0
},
"value": "t",
"optional": false
},
"consequent": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 460,
"end": 461,
"ctxt": 0
},
"value": "a",
"optional": false
},
"alternate": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 464,
"end": 466,
"ctxt": 0
},
"properties": []
}
}
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 491,
"end": 528,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 495,
"end": 527,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 495,
"end": 497,
"ctxt": 0
},
"value": "b2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 500,
"end": 527,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 502,
"end": 503,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 505,
"end": 508,
"ctxt": 0
},
"value": 123.0
}
},
{
"type": "SpreadElement",
"spread": {
2022-02-04 14:17:42 +03:00
"start": 510,
"end": 513,
"ctxt": 0
},
"arguments": {
"type": "ParenthesisExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 513,
"end": 525,
"ctxt": 0
},
"expression": {
"type": "ConditionalExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 514,
"end": 524,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 514,
"end": 515,
"ctxt": 0
},
"value": "t",
"optional": false
},
"consequent": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 518,
"end": 519,
"ctxt": 0
},
"value": "b",
"optional": false
},
"alternate": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 522,
"end": 524,
"ctxt": 0
},
"properties": []
}
}
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 549,
"end": 586,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 553,
"end": 585,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 553,
"end": 555,
"ctxt": 0
},
"value": "c2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 558,
"end": 585,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 560,
"end": 561,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 563,
"end": 566,
"ctxt": 0
},
"value": 123.0
}
},
{
"type": "SpreadElement",
"spread": {
2022-02-04 14:17:42 +03:00
"start": 568,
"end": 571,
"ctxt": 0
},
"arguments": {
"type": "ParenthesisExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 571,
"end": 583,
"ctxt": 0
},
"expression": {
"type": "ConditionalExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 572,
"end": 582,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 572,
"end": 573,
"ctxt": 0
},
"value": "t",
"optional": false
},
"consequent": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 576,
"end": 577,
"ctxt": 0
},
"value": "c",
"optional": false
},
"alternate": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 580,
"end": 582,
"ctxt": 0
},
"properties": []
}
}
}
}
]
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 607,
"end": 644,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 611,
"end": 643,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 611,
"end": 613,
"ctxt": 0
},
"value": "d2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 616,
"end": 643,
"ctxt": 0
},
"properties": [
{
"type": "KeyValueProperty",
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 618,
"end": 619,
"ctxt": 0
},
"value": "a",
"optional": false
},
"value": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 621,
"end": 624,
"ctxt": 0
},
"value": 123.0
}
},
{
"type": "SpreadElement",
"spread": {
2022-02-04 14:17:42 +03:00
"start": 626,
"end": 629,
"ctxt": 0
},
"arguments": {
"type": "ParenthesisExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 629,
"end": 641,
"ctxt": 0
},
"expression": {
"type": "ConditionalExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 630,
"end": 640,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 630,
"end": 631,
"ctxt": 0
},
"value": "t",
"optional": false
},
"consequent": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 634,
"end": 635,
"ctxt": 0
},
"value": "d",
"optional": false
},
"alternate": {
"type": "ObjectExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 638,
"end": 640,
"ctxt": 0
},
"properties": []
}
}
}
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}