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

687 lines
16 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 216,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 0,
"end": 33,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 14,
"end": 33,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 14,
"end": 15,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 15,
"end": 33,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 17,
"end": 33,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 18,
"end": 24,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 18,
"end": 24,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsTupleElement",
"span": {
"start": 26,
"end": 32,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 26,
"end": 32,
"ctxt": 0
},
"kind": "string"
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 34,
"end": 84,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 48,
"end": 84,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 48,
"end": 52,
"ctxt": 0
},
"value": "rest",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 52,
"end": 84,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTupleType",
"span": {
"start": 54,
"end": 84,
"ctxt": 0
},
"elemTypes": [
{
"type": "TsTupleElement",
"span": {
"start": 55,
"end": 61,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 55,
"end": 61,
"ctxt": 0
},
"kind": "number"
}
},
{
"type": "TsTupleElement",
"span": {
"start": 63,
"end": 69,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsKeywordType",
"span": {
"start": 63,
"end": 69,
"ctxt": 0
},
"kind": "string"
}
},
{
"type": "TsTupleElement",
"span": {
"start": 71,
"end": 83,
"ctxt": 0
},
"label": null,
"ty": {
"type": "TsRestType",
"span": {
"start": 71,
"end": 83,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 74,
"end": 83,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 74,
"end": 81,
"ctxt": 0
},
"kind": "boolean"
}
}
}
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 86,
"end": 101,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 92,
"end": 101,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 92,
"end": 94,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 97,
"end": 101,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 98,
"end": 101,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 99,
"end": 100,
"ctxt": 0
},
"value": 1.0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 102,
"end": 117,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 108,
"end": 117,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 108,
"end": 110,
"ctxt": 0
},
"value": "a2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 113,
"end": 117,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 113,
"end": 114,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 114,
"end": 117,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 115,
"end": 116,
"ctxt": 0
},
"value": 2.0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 118,
"end": 136,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 124,
"end": 136,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 124,
"end": 126,
"ctxt": 0
},
"value": "a3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 129,
"end": 136,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 129,
"end": 130,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 130,
"end": 136,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 131,
"end": 135,
"ctxt": 0
},
"value": 1000.0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 138,
"end": 156,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 144,
"end": 156,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 144,
"end": 146,
"ctxt": 0
},
"value": "a4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 149,
"end": 156,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 149,
"end": 153,
"ctxt": 0
},
"value": "rest",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 153,
"end": 156,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 154,
"end": 155,
"ctxt": 0
},
"value": 1.0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 157,
"end": 175,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 163,
"end": 175,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 163,
"end": 165,
"ctxt": 0
},
"value": "a5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 168,
"end": 175,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 168,
"end": 172,
"ctxt": 0
},
"value": "rest",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 172,
"end": 175,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 173,
"end": 174,
"ctxt": 0
},
"value": 2.0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 176,
"end": 194,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 182,
"end": 194,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 182,
"end": 184,
"ctxt": 0
},
"value": "a6",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 187,
"end": 194,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 187,
"end": 191,
"ctxt": 0
},
"value": "rest",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 191,
"end": 194,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 192,
"end": 193,
"ctxt": 0
},
"value": 3.0
}
}
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 195,
"end": 216,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 201,
"end": 216,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 201,
"end": 203,
"ctxt": 0
},
"value": "a7",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "MemberExpression",
"span": {
"start": 206,
"end": 216,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 206,
"end": 210,
"ctxt": 0
},
"value": "rest",
"optional": false
},
"property": {
"type": "Computed",
"span": {
"start": 210,
"end": 216,
"ctxt": 0
},
"expression": {
"type": "NumericLiteral",
"span": {
"start": 211,
"end": 215,
"ctxt": 0
},
"value": 1000.0
}
}
},
"definite": false
}
]
}
],
"interpreter": null
}