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

608 lines
16 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 24,
"end": 235,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 41,
"end": 45,
"ctxt": 0
},
"value": "call",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 74,
"end": 104,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 74,
"end": 104,
"ctxt": 0
},
"value": "handler",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 81,
"end": 104,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
"start": 83,
"end": 104,
"ctxt": 0
},
"params": [
{
"type": "RestElement",
"span": {
"start": 84,
"end": 95,
"ctxt": 0
},
"rest": {
"start": 84,
"end": 87,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 87,
"end": 91,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 91,
"end": 95,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 93,
"end": 95,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 93,
"end": 95,
"ctxt": 0
},
"value": "TS",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 97,
"end": 104,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 100,
"end": 104,
"ctxt": 0
},
"kind": "void"
}
}
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 111,
"end": 122,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 111,
"end": 122,
"ctxt": 0
},
"rest": {
"start": 111,
"end": 114,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 114,
"end": 118,
"ctxt": 0
},
"value": "args",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 118,
"end": 122,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 120,
"end": 122,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 120,
"end": 122,
"ctxt": 0
},
"value": "TS",
"optional": false
},
"typeParams": null
}
}
}
}
],
"decorators": [],
"span": {
"start": 24,
"end": 130,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 45,
"end": 67,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 46,
"end": 66,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 46,
"end": 48,
"ctxt": 0
},
"value": "TS",
"optional": false
},
"constraint": {
"type": "TsArrayType",
"span": {
"start": 57,
"end": 66,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 57,
"end": 64,
"ctxt": 0
},
"kind": "unknown"
}
},
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 123,
"end": 129,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 125,
"end": 129,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 136,
"end": 174,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 136,
"end": 173,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 136,
"end": 140,
"ctxt": 0
},
"value": "call",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 141,
"end": 172,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 142,
"end": 151,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 143,
"end": 151,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 145,
"end": 151,
"ctxt": 0
},
"kind": "number"
}
}
},
{
"type": "Identifier",
"span": {
"start": 153,
"end": 162,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 154,
"end": 162,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 156,
"end": 162,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"body": {
"type": "BinaryExpression",
"span": {
"start": 167,
"end": 172,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 167,
"end": 168,
"ctxt": 0
},
"value": "x",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 171,
"end": 172,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 176,
"end": 235,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 176,
"end": 234,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 176,
"end": 180,
"ctxt": 0
},
"value": "call",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 181,
"end": 212,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 182,
"end": 191,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 183,
"end": 191,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 185,
"end": 191,
"ctxt": 0
},
"kind": "number"
}
}
},
{
"type": "Identifier",
"span": {
"start": 193,
"end": 202,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 194,
"end": 202,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 196,
"end": 202,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"body": {
"type": "BinaryExpression",
"span": {
"start": 207,
"end": 212,
"ctxt": 0
},
"operator": "+",
"left": {
"type": "Identifier",
"span": {
"start": 207,
"end": 208,
"ctxt": 0
},
"value": "x",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
"start": 211,
"end": 212,
"ctxt": 0
},
"value": "y",
"optional": false
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 214,
"end": 215,
"ctxt": 0
},
"value": 1.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 217,
"end": 218,
"ctxt": 0
},
"value": 2.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 220,
"end": 221,
"ctxt": 0
},
"value": 3.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 223,
"end": 224,
"ctxt": 0
},
"value": 4.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 226,
"end": 227,
"ctxt": 0
},
"value": 5.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 229,
"end": 230,
"ctxt": 0
},
"value": 6.0
}
},
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 232,
"end": 233,
"ctxt": 0
},
"value": 7.0
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}