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

718 lines
17 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 1,
"end": 406,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 35,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 5,
"end": 34,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 5,
"end": 16,
"ctxt": 0
},
"value": "numStrTuple",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 16,
"end": 34,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 18,
"end": 34,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 19,
"end": 25,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 19,
"end": 25,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsTupleElement",
"span": {
"start": 27,
"end": 33,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 27,
"end": 33,
"ctxt": 0
},
"kind": "string"
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 36,
"end": 70,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 40,
"end": 69,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 40,
"end": 51,
"ctxt": 0
},
"value": "numNumTuple",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 51,
"end": 69,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 53,
"end": 69,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 54,
"end": 60,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 54,
"end": 60,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsTupleElement",
"span": {
"start": 62,
"end": 68,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 62,
"end": 68,
"ctxt": 0
},
"kind": "number"
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 71,
"end": 106,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 75,
"end": 105,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 75,
"end": 91,
"ctxt": 0
},
"value": "numEmptyObjTuple",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 91,
"end": 105,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 93,
"end": 105,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 94,
"end": 100,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 94,
"end": 100,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsTupleElement",
"span": {
"start": 102,
"end": 104,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsTypeLiteral",
"span": {
"start": 102,
"end": 104,
"ctxt": 0
},
"members": []
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 107,
"end": 131,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 111,
"end": 130,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 111,
"end": 124,
"ctxt": 0
},
"value": "emptyObjTuple",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 124,
"end": 130,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 126,
"end": 130,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 127,
"end": 129,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsTypeLiteral",
"span": {
"start": 127,
"end": 129,
"ctxt": 0
},
"members": []
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 133,
"end": 156,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 137,
"end": 155,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 137,
"end": 145,
"ctxt": 0
},
"value": "numArray",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 145,
"end": 155,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 147,
"end": 155,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 147,
"end": 153,
"ctxt": 0
},
"kind": "number"
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 157,
"end": 181,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 161,
"end": 180,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 161,
"end": 174,
"ctxt": 0
},
"value": "emptyObjArray",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 174,
"end": 180,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 176,
"end": 180,
"ctxt": 0
},
"elemType": {
"type": "TsTypeLiteral",
"span": {
"start": 176,
"end": 178,
"ctxt": 0
},
"members": []
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 195,
"end": 218,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 195,
"end": 217,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 195,
"end": 203,
"ctxt": 0
},
"value": "numArray",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 206,
"end": 217,
"ctxt": 0
},
"value": "numNumTuple",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 219,
"end": 249,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 219,
"end": 248,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 219,
"end": 232,
"ctxt": 0
},
"value": "emptyObjArray",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 235,
"end": 248,
"ctxt": 0
},
"value": "emptyObjTuple",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 250,
"end": 278,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 250,
"end": 277,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 250,
"end": 263,
"ctxt": 0
},
"value": "emptyObjArray",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 266,
"end": 277,
"ctxt": 0
},
"value": "numStrTuple",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 279,
"end": 307,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 279,
"end": 306,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 279,
"end": 292,
"ctxt": 0
},
"value": "emptyObjArray",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 295,
"end": 306,
"ctxt": 0
},
"value": "numNumTuple",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 308,
"end": 341,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 308,
"end": 340,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 308,
"end": 321,
"ctxt": 0
},
"value": "emptyObjArray",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 324,
"end": 340,
"ctxt": 0
},
"value": "numEmptyObjTuple",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 352,
"end": 375,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 352,
"end": 374,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 352,
"end": 360,
"ctxt": 0
},
"value": "numArray",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 363,
"end": 374,
"ctxt": 0
},
"value": "numStrTuple",
"optional": false
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 376,
"end": 406,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 376,
"end": 405,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "Identifier",
"span": {
"start": 376,
"end": 389,
"ctxt": 0
},
"value": "emptyObjTuple",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "Identifier",
"span": {
"start": 392,
"end": 405,
"ctxt": 0
},
"value": "emptyObjArray",
"optional": false
}
}
}
],
"interpreter": null
}