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

608 lines
16 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
2022-02-04 14:17:42 +03:00
"start": 40,
"end": 246,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 57,
"end": 61,
"ctxt": 0
},
"value": "call",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 89,
"end": 119,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 89,
"end": 119,
"ctxt": 0
},
"value": "handler",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 96,
"end": 119,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 98,
"end": 119,
"ctxt": 0
},
"params": [
{
"type": "RestElement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 99,
"end": 110,
"ctxt": 0
},
"rest": {
2022-02-04 14:17:42 +03:00
"start": 99,
"end": 102,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 102,
"end": 106,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 106,
"end": 110,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 108,
"end": 110,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 108,
"end": 110,
"ctxt": 0
},
"value": "TS",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 112,
"end": 119,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 115,
"end": 119,
"ctxt": 0
},
"kind": "void"
}
}
}
}
}
},
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 125,
"end": 136,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 125,
"end": 136,
"ctxt": 0
},
"rest": {
2022-02-04 14:17:42 +03:00
"start": 125,
"end": 128,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 128,
"end": 132,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 132,
"end": 136,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 134,
"end": 136,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 134,
"end": 136,
"ctxt": 0
},
"value": "TS",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 40,
"end": 144,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 61,
"end": 83,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 62,
"end": 82,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 62,
"end": 64,
"ctxt": 0
},
"value": "TS",
"optional": false
},
"constraint": {
"type": "TsArrayType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 73,
"end": 82,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 73,
"end": 80,
"ctxt": 0
},
"kind": "unknown"
}
},
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 137,
"end": 143,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 139,
"end": 143,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 148,
"end": 186,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 148,
"end": 185,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 148,
"end": 152,
"ctxt": 0
},
"value": "call",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 153,
"end": 184,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 154,
"end": 163,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 155,
"end": 163,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 157,
"end": 163,
"ctxt": 0
},
"kind": "number"
}
}
},
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 165,
"end": 174,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 166,
"end": 174,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 168,
"end": 174,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"body": {
"type": "BinaryExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 179,
"end": 184,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 179,
"end": 180,
"ctxt": 0
},
"value": "x",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 183,
"end": 184,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 187,
"end": 246,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 187,
"end": 245,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 187,
"end": 191,
"ctxt": 0
},
"value": "call",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 192,
"end": 223,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 193,
"end": 202,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 194,
"end": 202,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 196,
"end": 202,
"ctxt": 0
},
"kind": "number"
}
}
},
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 204,
"end": 213,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 205,
"end": 213,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 207,
"end": 213,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"body": {
"type": "BinaryExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 218,
"end": 223,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 218,
"end": 219,
"ctxt": 0
},
"value": "x",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 222,
"end": 223,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 225,
"end": 226,
"ctxt": 0
},
"value": 1.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 228,
"end": 229,
"ctxt": 0
},
"value": 2.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 231,
"end": 232,
"ctxt": 0
},
"value": 3.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 234,
"end": 235,
"ctxt": 0
},
"value": 4.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 237,
"end": 238,
"ctxt": 0
},
"value": 5.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 240,
"end": 241,
"ctxt": 0
},
"value": 6.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 243,
"end": 244,
"ctxt": 0
},
"value": 7.0
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}