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

991 lines
22 KiB
JSON

{
"type": "Script",
"span": {
"start": 71,
"end": 872,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 71,
"end": 87,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 75,
"end": 86,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 75,
"end": 81,
"ctxt": 0
},
"value": "anyVar",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 81,
"end": 86,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 83,
"end": 86,
"ctxt": 0
},
"kind": "any"
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 88,
"end": 98,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 88,
"end": 97,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 88,
"end": 94,
"ctxt": 0
},
"value": "anyVar",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 95,
"end": 96,
"ctxt": 0
},
"value": 0.0
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 99,
"end": 110,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 99,
"end": 109,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 99,
"end": 105,
"ctxt": 0
},
"value": "anyVar",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 106,
"end": 108,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 205,
"end": 229,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 205,
"end": 228,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 205,
"end": 211,
"ctxt": 0
},
"value": "anyVar",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 220,
"end": 227,
"ctxt": 0
},
"value": "hello",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 211,
"end": 219,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 212,
"end": 218,
"ctxt": 0
},
"kind": "string"
}
]
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 230,
"end": 247,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 230,
"end": 246,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 230,
"end": 236,
"ctxt": 0
},
"value": "anyVar",
"optional": false
},
"arguments": [],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 236,
"end": 244,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 237,
"end": 243,
"ctxt": 0
},
"kind": "number"
}
]
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 248,
"end": 274,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 248,
"end": 273,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 248,
"end": 254,
"ctxt": 0
},
"value": "anyVar",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "Identifier",
"span": {
"start": 263,
"end": 272,
"ctxt": 0
},
"value": "undefined",
"optional": false
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 254,
"end": 262,
"ctxt": 0
},
"params": [
{
"type": "TsTypeReference",
"span": {
"start": 255,
"end": 261,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 255,
"end": 261,
"ctxt": 0
},
"value": "Window",
"optional": false
},
"typeParams": null
}
]
}
}
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 382,
"end": 438,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 392,
"end": 399,
"ctxt": 0
},
"value": "SubFunc",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [
{
"type": "TsExpressionWithTypeArguments",
"span": {
"start": 408,
"end": 416,
"ctxt": 0
},
"expression": {
"type": "Identifier",
"span": {
"start": 408,
"end": 416,
"ctxt": 0
},
"value": "Function",
"optional": false
},
"typeArguments": null
}
],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 417,
"end": 438,
"ctxt": 0
},
"body": [
{
"type": "TsPropertySignature",
"span": {
"start": 423,
"end": 436,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 423,
"end": 427,
"ctxt": 0
},
"value": "prop",
"optional": false
},
"computed": false,
"optional": false,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 427,
"end": 435,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 429,
"end": 435,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 439,
"end": 460,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 443,
"end": 459,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 443,
"end": 450,
"ctxt": 0
},
"value": "subFunc",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 450,
"end": 459,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 452,
"end": 459,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 452,
"end": 459,
"ctxt": 0
},
"value": "SubFunc",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 461,
"end": 472,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 461,
"end": 471,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 461,
"end": 468,
"ctxt": 0
},
"value": "subFunc",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 469,
"end": 470,
"ctxt": 0
},
"value": 0.0
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 473,
"end": 485,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 473,
"end": 484,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 473,
"end": 480,
"ctxt": 0
},
"value": "subFunc",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 481,
"end": 483,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 486,
"end": 496,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 486,
"end": 495,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 486,
"end": 493,
"ctxt": 0
},
"value": "subFunc",
"optional": false
},
"arguments": [],
"typeArguments": null
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 627,
"end": 646,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 627,
"end": 645,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 627,
"end": 634,
"ctxt": 0
},
"value": "subFunc",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 643,
"end": 644,
"ctxt": 0
},
"value": 0.0
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 634,
"end": 642,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 635,
"end": 641,
"ctxt": 0
},
"kind": "number"
}
]
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 647,
"end": 667,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 647,
"end": 666,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 647,
"end": 654,
"ctxt": 0
},
"value": "subFunc",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 663,
"end": 665,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 654,
"end": 662,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 655,
"end": 661,
"ctxt": 0
},
"kind": "string"
}
]
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 668,
"end": 683,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 668,
"end": 682,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 668,
"end": 675,
"ctxt": 0
},
"value": "subFunc",
"optional": false
},
"arguments": [],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 675,
"end": 680,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 676,
"end": 679,
"ctxt": 0
},
"kind": "any"
}
]
}
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 805,
"end": 824,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 809,
"end": 823,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 809,
"end": 813,
"ctxt": 0
},
"value": "func",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 813,
"end": 823,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 815,
"end": 823,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 815,
"end": 823,
"ctxt": 0
},
"value": "Function",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 825,
"end": 841,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 825,
"end": 840,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 825,
"end": 829,
"ctxt": 0
},
"value": "func",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 838,
"end": 839,
"ctxt": 0
},
"value": 0.0
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 829,
"end": 837,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 830,
"end": 836,
"ctxt": 0
},
"kind": "number"
}
]
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 842,
"end": 859,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 842,
"end": 858,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 842,
"end": 846,
"ctxt": 0
},
"value": "func",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "StringLiteral",
"span": {
"start": 855,
"end": 857,
"ctxt": 0
},
"value": "",
"hasEscape": false,
"kind": {
"type": "normal",
"containsQuote": true
}
}
}
],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 846,
"end": 854,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 847,
"end": 853,
"ctxt": 0
},
"kind": "string"
}
]
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 860,
"end": 872,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 860,
"end": 871,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 860,
"end": 864,
"ctxt": 0
},
"value": "func",
"optional": false
},
"arguments": [],
"typeArguments": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 864,
"end": 869,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 865,
"end": 868,
"ctxt": 0
},
"kind": "any"
}
]
}
}
}
],
"interpreter": null
}