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

694 lines
17 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 217,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 1,
"end": 34,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 15,
"end": 34,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 15,
"end": 16,
"ctxt": 0
},
"value": "a",
"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": 35,
"end": 85,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 49,
"end": 85,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 49,
"end": 53,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 53,
"end": 85,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 55,
"end": 85,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 56,
"end": 62,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 56,
"end": 62,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsTupleElement",
"span": {
"start": 64,
"end": 70,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 64,
"end": 70,
"ctxt": 0
},
"kind": "string"
}
},
{
"type": "TsTupleElement",
"span": {
"start": 72,
"end": 84,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsRestType",
"span": {
"start": 72,
"end": 84,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 75,
"end": 84,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 75,
"end": 82,
"ctxt": 0
},
"kind": "boolean"
}
}
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 87,
"end": 102,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 93,
"end": 102,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 93,
"end": 95,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 98,
"end": 102,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 98,
"end": 99,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 99,
"end": 102,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 100,
"end": 101,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 103,
"end": 118,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 109,
"end": 118,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 109,
"end": 111,
"ctxt": 0
},
"value": "a2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 114,
"end": 118,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 114,
"end": 115,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 115,
"end": 118,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 116,
"end": 117,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 119,
"end": 137,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 125,
"end": 137,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 125,
"end": 127,
"ctxt": 0
},
"value": "a3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 130,
"end": 137,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 130,
"end": 131,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 131,
"end": 137,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 132,
"end": 136,
"ctxt": 0
},
"value": 1000.0,
"raw": "1000"
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 139,
"end": 157,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 145,
"end": 157,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 145,
"end": 147,
"ctxt": 0
},
"value": "a4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 150,
"end": 157,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 150,
"end": 154,
"ctxt": 0
},
"value": "rest",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 154,
"end": 157,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 155,
"end": 156,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 158,
"end": 176,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 164,
"end": 176,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 164,
"end": 166,
"ctxt": 0
},
"value": "a5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 169,
"end": 176,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 169,
"end": 173,
"ctxt": 0
},
"value": "rest",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 173,
"end": 176,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 174,
"end": 175,
"ctxt": 0
},
"value": 2.0,
"raw": "2"
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 177,
"end": 195,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 183,
"end": 195,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 183,
"end": 185,
"ctxt": 0
},
"value": "a6",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 188,
"end": 195,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 188,
"end": 192,
"ctxt": 0
},
"value": "rest",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 192,
"end": 195,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 193,
"end": 194,
"ctxt": 0
},
"value": 3.0,
"raw": "3"
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 196,
"end": 217,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 202,
"end": 217,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 202,
"end": 204,
"ctxt": 0
},
"value": "a7",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 207,
"end": 217,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 207,
"end": 211,
"ctxt": 0
},
"value": "rest",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 211,
"end": 217,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 212,
"end": 216,
"ctxt": 0
},
"value": 1000.0,
"raw": "1000"
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}