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

1369 lines
31 KiB
JSON

{
"type": "Script",
"span": {
"start": 92,
"end": 781,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 109,
"end": 111,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 112,
"end": 119,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 112,
"end": 119,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 113,
"end": 119,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 115,
"end": 119,
"ctxt": 0
},
"kind": "void"
}
}
}
}
],
"decorators": [],
"span": {
"start": 92,
"end": 127,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 120,
"end": 126,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 122,
"end": 126,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 145,
"end": 147,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 148,
"end": 160,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 148,
"end": 160,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 149,
"end": 160,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 151,
"end": 160,
"ctxt": 0
},
"kind": "undefined"
}
}
}
}
],
"decorators": [],
"span": {
"start": 128,
"end": 168,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 161,
"end": 167,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 163,
"end": 167,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 186,
"end": 188,
"ctxt": 0
},
"value": "f3",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 189,
"end": 199,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 189,
"end": 199,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 190,
"end": 199,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 192,
"end": 199,
"ctxt": 0
},
"kind": "unknown"
}
}
}
}
],
"decorators": [],
"span": {
"start": 169,
"end": 207,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 200,
"end": 206,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 202,
"end": 206,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 225,
"end": 227,
"ctxt": 0
},
"value": "f4",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 228,
"end": 234,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 228,
"end": 234,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 229,
"end": 234,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 231,
"end": 234,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"decorators": [],
"span": {
"start": 208,
"end": 242,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 235,
"end": 241,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 237,
"end": 241,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 244,
"end": 277,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 254,
"end": 255,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 255,
"end": 258,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 256,
"end": 257,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 256,
"end": 257,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 259,
"end": 277,
"ctxt": 0
},
"body": [
{
"type": "TsMethodSignature",
"span": {
"start": 261,
"end": 275,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 261,
"end": 262,
"ctxt": 0
},
"value": "m",
"optional": false
},
"computed": false,
"optional": false,
"params": [
{
"type": "Identifier",
"span": {
"start": 263,
"end": 267,
"ctxt": 0
},
"value": "p",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 264,
"end": 267,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 266,
"end": 267,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 266,
"end": 267,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
"start": 268,
"end": 274,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 270,
"end": 274,
"ctxt": 0
},
"kind": "void"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 278,
"end": 304,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 292,
"end": 303,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 292,
"end": 294,
"ctxt": 0
},
"value": "o1",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 294,
"end": 303,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 296,
"end": 303,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 296,
"end": 297,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 297,
"end": 303,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 298,
"end": 302,
"ctxt": 0
},
"kind": "void"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 305,
"end": 336,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 319,
"end": 335,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 319,
"end": 321,
"ctxt": 0
},
"value": "o2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 321,
"end": 335,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 323,
"end": 335,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 323,
"end": 324,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 324,
"end": 335,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 325,
"end": 334,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 337,
"end": 366,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 351,
"end": 365,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 351,
"end": 353,
"ctxt": 0
},
"value": "o3",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 353,
"end": 365,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 355,
"end": 365,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 355,
"end": 356,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 356,
"end": 365,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 357,
"end": 364,
"ctxt": 0
},
"kind": "unknown"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 367,
"end": 392,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 381,
"end": 391,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 381,
"end": 383,
"ctxt": 0
},
"value": "o4",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 383,
"end": 391,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 385,
"end": 391,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 385,
"end": 386,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 386,
"end": 391,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 387,
"end": 390,
"ctxt": 0
},
"kind": "any"
}
]
}
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 473,
"end": 478,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 473,
"end": 477,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 473,
"end": 475,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 479,
"end": 486,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 479,
"end": 485,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 479,
"end": 483,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 479,
"end": 481,
"ctxt": 0
},
"value": "o1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 482,
"end": 483,
"ctxt": 0
},
"value": "m",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 576,
"end": 581,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 576,
"end": 580,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 576,
"end": 578,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 582,
"end": 587,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 582,
"end": 586,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 582,
"end": 584,
"ctxt": 0
},
"value": "f3",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 588,
"end": 593,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 588,
"end": 592,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 588,
"end": 590,
"ctxt": 0
},
"value": "f4",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 595,
"end": 602,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 595,
"end": 601,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 595,
"end": 599,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 595,
"end": 597,
"ctxt": 0
},
"value": "o2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 598,
"end": 599,
"ctxt": 0
},
"value": "m",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 603,
"end": 610,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 603,
"end": 609,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 603,
"end": 607,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 603,
"end": 605,
"ctxt": 0
},
"value": "o3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 606,
"end": 607,
"ctxt": 0
},
"value": "m",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 611,
"end": 618,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 611,
"end": 617,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 611,
"end": 615,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 611,
"end": 613,
"ctxt": 0
},
"value": "o4",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 614,
"end": 615,
"ctxt": 0
},
"value": "m",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 699,
"end": 704,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 699,
"end": 703,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 699,
"end": 701,
"ctxt": 0
},
"value": "f1",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 705,
"end": 712,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 705,
"end": 711,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 705,
"end": 709,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 705,
"end": 707,
"ctxt": 0
},
"value": "o1",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 708,
"end": 709,
"ctxt": 0
},
"value": "m",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 739,
"end": 744,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 739,
"end": 743,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 739,
"end": 741,
"ctxt": 0
},
"value": "f2",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 745,
"end": 750,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 745,
"end": 749,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 745,
"end": 747,
"ctxt": 0
},
"value": "f3",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 751,
"end": 756,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 751,
"end": 755,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 751,
"end": 753,
"ctxt": 0
},
"value": "f4",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 758,
"end": 765,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 758,
"end": 764,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 758,
"end": 762,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 758,
"end": 760,
"ctxt": 0
},
"value": "o2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 761,
"end": 762,
"ctxt": 0
},
"value": "m",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 766,
"end": 773,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 766,
"end": 772,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 766,
"end": 770,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 766,
"end": 768,
"ctxt": 0
},
"value": "o3",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 769,
"end": 770,
"ctxt": 0
},
"value": "m",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 774,
"end": 781,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 774,
"end": 780,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 774,
"end": 778,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 774,
"end": 776,
"ctxt": 0
},
"value": "o4",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 777,
"end": 778,
"ctxt": 0
},
"value": "m",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
}
],
"interpreter": null
}