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

586 lines
14 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 86,
"end": 300,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 95,
"end": 98,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 99,
"end": 100,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 99,
"end": 100,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
"start": 86,
"end": 105,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 102,
"end": 105,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "VariableDeclaration",
"span": {
"start": 107,
"end": 122,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 111,
"end": 121,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 111,
"end": 112,
"ctxt": 0
},
"value": "r",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 115,
"end": 121,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 115,
"end": 118,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
"start": 119,
"end": 120,
"ctxt": 0
},
"value": 1.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "TsInterfaceDeclaration",
"span": {
"start": 155,
"end": 190,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
"start": 167,
"end": 190,
"ctxt": 0
},
"body": [
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 174,
"end": 177,
"ctxt": 0
},
"params": [],
"typeAnnotation": null,
"typeParams": null
},
{
"type": "TsMethodSignature",
"span": {
"start": 183,
"end": 187,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 183,
"end": 184,
"ctxt": 0
},
"value": "f",
"optional": false
},
"computed": false,
"optional": false,
"params": [],
"typeAnn": null,
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
"start": 192,
"end": 201,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 196,
"end": 200,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 196,
"end": 197,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 197,
"end": 200,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 199,
"end": 200,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 199,
"end": 200,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 203,
"end": 216,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 207,
"end": 215,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 207,
"end": 209,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 212,
"end": 215,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 212,
"end": 213,
"ctxt": 0
},
"value": "i",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 218,
"end": 233,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 222,
"end": 232,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 222,
"end": 224,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 227,
"end": 232,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 227,
"end": 230,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 227,
"end": 228,
"ctxt": 0
},
"value": "i",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 229,
"end": 230,
"ctxt": 0
},
"value": "f",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 237,
"end": 268,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 241,
"end": 267,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 241,
"end": 242,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 242,
"end": 267,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 244,
"end": 267,
"ctxt": 0
},
"members": [
{
"type": "TsCallSignatureDeclaration",
"span": {
"start": 251,
"end": 254,
"ctxt": 0
},
"params": [],
"typeAnnotation": null,
"typeParams": null
},
{
"type": "TsMethodSignature",
"span": {
"start": 260,
"end": 264,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 260,
"end": 261,
"ctxt": 0
},
"value": "f",
"optional": false
},
"computed": false,
"optional": false,
"params": [],
"typeAnn": null,
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 270,
"end": 283,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 274,
"end": 282,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 274,
"end": 276,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 279,
"end": 282,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 279,
"end": 280,
"ctxt": 0
},
"value": "a",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 285,
"end": 300,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 289,
"end": 299,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 289,
"end": 291,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
"start": 294,
"end": 299,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 294,
"end": 297,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 294,
"end": 295,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 296,
"end": 297,
"ctxt": 0
},
"value": "f",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}