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

2057 lines
53 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
2022-02-04 14:17:42 +03:00
"start": 53,
"end": 783,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 70,
"end": 72,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 76,
"end": 82,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 76,
"end": 82,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 77,
"end": 82,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 79,
"end": 82,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 79,
"end": 80,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 79,
"end": 80,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 53,
"end": 87,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 72,
"end": 75,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 73,
"end": 74,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 73,
"end": 74,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 83,
"end": 86,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 85,
"end": 86,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 85,
"end": 86,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 89,
"end": 118,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 93,
"end": 117,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 93,
"end": 103,
"ctxt": 0
},
"value": "neverArray",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 103,
"end": 112,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 105,
"end": 112,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 105,
"end": 110,
"ctxt": 0
},
"kind": "never"
}
}
}
},
"init": {
"type": "ArrayExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 115,
"end": 117,
"ctxt": 0
},
"elements": []
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 120,
"end": 136,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 124,
"end": 135,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 124,
"end": 126,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 129,
"end": 135,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 129,
"end": 131,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 132,
"end": 134,
"ctxt": 0
},
"elements": []
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 147,
"end": 171,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 151,
"end": 170,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 151,
"end": 153,
"ctxt": 0
},
"value": "a2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 156,
"end": 170,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 156,
"end": 158,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 159,
"end": 169,
"ctxt": 0
},
"value": "neverArray",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "TsTypeAliasDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 205,
"end": 249,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 210,
"end": 220,
"ctxt": 0
},
"value": "Comparator",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 220,
"end": 223,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 221,
"end": 222,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 221,
"end": 222,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 226,
"end": 248,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 227,
"end": 231,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 228,
"end": 231,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 230,
"end": 231,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 230,
"end": 231,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 233,
"end": 237,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 234,
"end": 237,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 236,
"end": 237,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 236,
"end": 237,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 239,
"end": 248,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 242,
"end": 248,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 251,
"end": 328,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 261,
"end": 271,
"ctxt": 0
},
"value": "LinkedList",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 271,
"end": 274,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 272,
"end": 273,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 272,
"end": 273,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
2022-02-04 14:17:42 +03:00
"start": 275,
"end": 328,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 281,
"end": 307,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 281,
"end": 291,
"ctxt": 0
},
"value": "comparator",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 291,
"end": 306,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 293,
"end": 306,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 293,
"end": 303,
"ctxt": 0
},
"value": "Comparator",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 303,
"end": 306,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 304,
"end": 305,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 304,
"end": 305,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 312,
"end": 326,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 312,
"end": 317,
"ctxt": 0
},
"value": "nodes",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 317,
"end": 326,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 319,
"end": 326,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 319,
"end": 323,
"ctxt": 0
},
"value": "Node",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 323,
"end": 326,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 324,
"end": 325,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 324,
"end": 325,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": null
}
]
}
},
{
"type": "TsTypeAliasDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 330,
"end": 379,
"ctxt": 0
},
"declare": false,
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 335,
"end": 339,
"ctxt": 0
},
"value": "Node",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 339,
"end": 342,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 340,
"end": 341,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 340,
"end": 341,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 345,
"end": 379,
"ctxt": 0
},
"types": [
{
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 345,
"end": 372,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 347,
"end": 356,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 347,
"end": 352,
"ctxt": 0
},
"value": "value",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 352,
"end": 355,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 354,
"end": 355,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 354,
"end": 355,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 357,
"end": 370,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 357,
"end": 361,
"ctxt": 0
},
"value": "next",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 361,
"end": 370,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 363,
"end": 370,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 363,
"end": 367,
"ctxt": 0
},
"value": "Node",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 367,
"end": 370,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 368,
"end": 369,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 368,
"end": 369,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
},
"typeParams": null
}
]
},
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 375,
"end": 379,
"ctxt": 0
},
"kind": "null"
}
]
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 398,
"end": 412,
"ctxt": 0
},
"value": "compareNumbers",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 413,
"end": 422,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 413,
"end": 422,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 414,
"end": 422,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 416,
"end": 422,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 424,
"end": 433,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 424,
"end": 433,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 425,
"end": 433,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 427,
"end": 433,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 381,
"end": 443,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 434,
"end": 442,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 436,
"end": 442,
"ctxt": 0
},
"kind": "number"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 461,
"end": 467,
"ctxt": 0
},
"value": "mkList",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 471,
"end": 481,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 471,
"end": 481,
"ctxt": 0
},
"value": "items",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 476,
"end": 481,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 478,
"end": 481,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 478,
"end": 479,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 478,
"end": 479,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
}
},
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 483,
"end": 508,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 483,
"end": 508,
"ctxt": 0
},
"value": "comparator",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 493,
"end": 508,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 495,
"end": 508,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 495,
"end": 505,
"ctxt": 0
},
"value": "Comparator",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 505,
"end": 508,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 506,
"end": 507,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 506,
"end": 507,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 444,
"end": 525,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 467,
"end": 470,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 468,
"end": 469,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 468,
"end": 469,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 509,
"end": 524,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 511,
"end": 524,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 511,
"end": 521,
"ctxt": 0
},
"value": "LinkedList",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 521,
"end": 524,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 522,
"end": 523,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 522,
"end": 523,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
]
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 527,
"end": 587,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 533,
"end": 586,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 533,
"end": 537,
"ctxt": 0
},
"value": "list",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 537,
"end": 557,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 539,
"end": 557,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 539,
"end": 549,
"ctxt": 0
},
"value": "LinkedList",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 549,
"end": 557,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 550,
"end": 556,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
},
"init": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 560,
"end": 586,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 560,
"end": 566,
"ctxt": 0
},
"value": "mkList",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 567,
"end": 569,
"ctxt": 0
},
"elements": []
}
},
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 571,
"end": 585,
"ctxt": 0
},
"value": "compareNumbers",
"optional": false
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 628,
"end": 630,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 634,
"end": 642,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 634,
"end": 642,
"ctxt": 0
},
"value": "as1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 637,
"end": 642,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 639,
"end": 642,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 639,
"end": 640,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 639,
"end": 640,
"ctxt": 0
},
"value": "a",
"optional": false
},
"typeParams": null
}
}
}
}
},
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 644,
"end": 652,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 644,
"end": 652,
"ctxt": 0
},
"value": "as2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 647,
"end": 652,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 649,
"end": 652,
"ctxt": 0
},
"elemType": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 649,
"end": 650,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 649,
"end": 650,
"ctxt": 0
},
"value": "a",
"optional": false
},
"typeParams": null
}
}
}
}
},
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 654,
"end": 683,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 654,
"end": 683,
"ctxt": 0
},
"value": "cmp",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 657,
"end": 683,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsFunctionType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 659,
"end": 683,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 660,
"end": 665,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 662,
"end": 665,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 664,
"end": 665,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 664,
"end": 665,
"ctxt": 0
},
"value": "a",
"optional": false
},
"typeParams": null
}
}
},
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 667,
"end": 672,
"ctxt": 0
},
"value": "a2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 669,
"end": 672,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 671,
"end": 672,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 671,
"end": 672,
"ctxt": 0
},
"value": "a",
"optional": false
},
"typeParams": null
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 674,
"end": 683,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 677,
"end": 683,
"ctxt": 0
},
"kind": "number"
}
}
}
}
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 611,
"end": 691,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 630,
"end": 633,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 631,
"end": 632,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 631,
"end": 632,
"ctxt": 0
},
"value": "a",
"optional": false
},
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 684,
"end": 690,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 686,
"end": 690,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 692,
"end": 737,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 692,
"end": 736,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 692,
"end": 694,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 695,
"end": 710,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 695,
"end": 705,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 695,
"end": 700,
"ctxt": 0
},
"value": "Array",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 701,
"end": 705,
"ctxt": 0
},
"value": "from",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 706,
"end": 709,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 707,
"end": 708,
"ctxt": 0
},
"value": 0.0
}
}
]
}
}
],
"typeArguments": null
}
},
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 712,
"end": 714,
"ctxt": 0
},
"elements": []
}
},
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 716,
"end": 735,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 717,
"end": 719,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 721,
"end": 723,
"ctxt": 0
},
"value": "a2",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BinaryExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 728,
"end": 735,
"ctxt": 0
},
"operator": "-",
"left": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 728,
"end": 730,
"ctxt": 0
},
"value": "a1",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 733,
"end": 735,
"ctxt": 0
},
"value": "a2",
"optional": false
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 738,
"end": 783,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 738,
"end": 782,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 738,
"end": 740,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 741,
"end": 755,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 741,
"end": 751,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 741,
"end": 746,
"ctxt": 0
},
"value": "Array",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 747,
"end": 751,
"ctxt": 0
},
"value": "from",
"optional": false
}
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 752,
"end": 754,
"ctxt": 0
},
"elements": []
}
}
],
"typeArguments": null
}
},
{
"spread": null,
"expression": {
"type": "ArrayExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 757,
"end": 760,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 758,
"end": 759,
"ctxt": 0
},
"value": 0.0
}
}
]
}
},
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 762,
"end": 781,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 763,
"end": 765,
"ctxt": 0
},
"value": "a1",
"optional": false,
"typeAnnotation": null
},
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 767,
"end": 769,
"ctxt": 0
},
"value": "a2",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BinaryExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 774,
"end": 781,
"ctxt": 0
},
"operator": "-",
"left": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 774,
"end": 776,
"ctxt": 0
},
"value": "a1",
"optional": false
},
"right": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 779,
"end": 781,
"ctxt": 0
},
"value": "a2",
"optional": false
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}