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

586 lines
14 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
2022-02-04 14:17:42 +03:00
"start": 84,
"end": 282,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 93,
"end": 96,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 97,
"end": 98,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 97,
"end": 98,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": null
}
}
],
"decorators": [],
"span": {
2022-02-04 14:17:42 +03:00
"start": 84,
"end": 103,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 100,
"end": 103,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 104,
"end": 119,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 108,
"end": 118,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 108,
"end": 109,
"ctxt": 0
},
"value": "r",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 112,
"end": 118,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 112,
"end": 115,
"ctxt": 0
},
"value": "foo",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "NumericLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 116,
"end": 117,
"ctxt": 0
},
"value": 1.0
}
}
],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "TsInterfaceDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 150,
"end": 182,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 160,
"end": 161,
"ctxt": 0
},
"value": "I",
"optional": false
},
"declare": false,
"typeParams": null,
"extends": [],
"body": {
"type": "TsInterfaceBody",
"span": {
2022-02-04 14:17:42 +03:00
"start": 162,
"end": 182,
"ctxt": 0
},
"body": [
{
"type": "TsCallSignatureDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 168,
"end": 171,
"ctxt": 0
},
"params": [],
"typeAnnotation": null,
"typeParams": null
},
{
"type": "TsMethodSignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 176,
"end": 180,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 176,
"end": 177,
"ctxt": 0
},
"value": "f",
"optional": false
},
"computed": false,
"optional": false,
"params": [],
"typeAnn": null,
"typeParams": null
}
]
}
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 183,
"end": 192,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 187,
"end": 191,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 187,
"end": 188,
"ctxt": 0
},
"value": "i",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 188,
"end": 191,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 190,
"end": 191,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 190,
"end": 191,
"ctxt": 0
},
"value": "I",
"optional": false
},
"typeParams": null
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 193,
"end": 206,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 197,
"end": 205,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 197,
"end": 199,
"ctxt": 0
},
"value": "r2",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 202,
"end": 205,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 202,
"end": 203,
"ctxt": 0
},
"value": "i",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 207,
"end": 222,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 211,
"end": 221,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 211,
"end": 213,
"ctxt": 0
},
"value": "r3",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 216,
"end": 221,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 216,
"end": 219,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 216,
"end": 217,
"ctxt": 0
},
"value": "i",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 218,
"end": 219,
"ctxt": 0
},
"value": "f",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 224,
"end": 252,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 228,
"end": 251,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 228,
"end": 229,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 229,
"end": 251,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 231,
"end": 251,
"ctxt": 0
},
"members": [
{
"type": "TsCallSignatureDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 237,
"end": 240,
"ctxt": 0
},
"params": [],
"typeAnnotation": null,
"typeParams": null
},
{
"type": "TsMethodSignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 245,
"end": 249,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 245,
"end": 246,
"ctxt": 0
},
"value": "f",
"optional": false
},
"computed": false,
"optional": false,
"params": [],
"typeAnn": null,
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 253,
"end": 266,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 257,
"end": 265,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 257,
"end": 259,
"ctxt": 0
},
"value": "r4",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 262,
"end": 265,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 262,
"end": 263,
"ctxt": 0
},
"value": "a",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 267,
"end": 282,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 271,
"end": 281,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 271,
"end": 273,
"ctxt": 0
},
"value": "r5",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "CallExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 276,
"end": 281,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 276,
"end": 279,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 276,
"end": 277,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 278,
"end": 279,
"ctxt": 0
},
"value": "f",
"optional": false
}
},
"arguments": [],
"typeArguments": null
},
"definite": false
}
]
}
],
"interpreter": null
}