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

1136 lines
37 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
2022-02-04 14:17:42 +03:00
"start": 79,
"end": 488,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 79,
"end": 231,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 83,
"end": 230,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 83,
"end": 84,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 84,
"end": 230,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 86,
"end": 230,
"ctxt": 0
},
"members": [
{
"type": "TsMethodSignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 92,
"end": 118,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 92,
"end": 97,
"ctxt": 0
},
"value": "func4",
"optional": false
},
"computed": false,
"optional": true,
"params": [
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 99,
"end": 108,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 100,
"end": 108,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 102,
"end": 108,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 109,
"end": 117,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 111,
"end": 117,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsMethodSignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 123,
"end": 149,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 123,
"end": 128,
"ctxt": 0
},
"value": "func4",
"optional": false
},
"computed": false,
"optional": true,
"params": [
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 130,
"end": 139,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 131,
"end": 139,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 133,
"end": 139,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 140,
"end": 148,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 142,
"end": 148,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
},
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 154,
"end": 228,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 154,
"end": 159,
"ctxt": 0
},
"value": "func5",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 160,
"end": 227,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 162,
"end": 227,
"ctxt": 0
},
"members": [
{
"type": "TsCallSignatureDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 172,
"end": 192,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 173,
"end": 182,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 174,
"end": 182,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 176,
"end": 182,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 183,
"end": 191,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 185,
"end": 191,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
},
{
"type": "TsCallSignatureDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 201,
"end": 221,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 202,
"end": 211,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 203,
"end": 211,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 205,
"end": 211,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 212,
"end": 220,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 214,
"end": 220,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": null
}
]
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 246,
"end": 264,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 246,
"end": 263,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 246,
"end": 253,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 246,
"end": 247,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 248,
"end": 253,
"ctxt": 0
},
"value": "func4",
"optional": false
}
},
"right": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 256,
"end": 263,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 256,
"end": 257,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 258,
"end": 263,
"ctxt": 0
},
"value": "func5",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 265,
"end": 283,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 265,
"end": 282,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 265,
"end": 272,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 265,
"end": 266,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 267,
"end": 272,
"ctxt": 0
},
"value": "func5",
"optional": false
}
},
"right": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 275,
"end": 282,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 275,
"end": 276,
"ctxt": 0
},
"value": "c",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 277,
"end": 282,
"ctxt": 0
},
"value": "func4",
"optional": false
}
}
}
},
{
"type": "VariableDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 286,
"end": 432,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
2022-02-04 14:17:42 +03:00
"start": 290,
"end": 431,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 290,
"end": 292,
"ctxt": 0
},
"value": "c2",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 292,
"end": 431,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 294,
"end": 431,
"ctxt": 0
},
"members": [
{
"type": "TsMethodSignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 300,
"end": 324,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 300,
"end": 305,
"ctxt": 0
},
"value": "func4",
"optional": false
},
"computed": false,
"optional": true,
"params": [
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 310,
"end": 314,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 311,
"end": 314,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 313,
"end": 314,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 313,
"end": 314,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 315,
"end": 323,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 317,
"end": 323,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 306,
"end": 309,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 307,
"end": 308,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 307,
"end": 308,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
}
},
{
"type": "TsMethodSignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 329,
"end": 354,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 329,
"end": 334,
"ctxt": 0
},
"value": "func4",
"optional": false
},
"computed": false,
"optional": true,
"params": [
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 340,
"end": 344,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 341,
"end": 344,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 343,
"end": 344,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 343,
"end": 344,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnn": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 345,
"end": 353,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 347,
"end": 353,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 336,
"end": 339,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 337,
"end": 338,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 337,
"end": 338,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
}
},
{
"type": "TsPropertySignature",
"span": {
2022-02-04 14:17:42 +03:00
"start": 359,
"end": 429,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 359,
"end": 364,
"ctxt": 0
},
"value": "func5",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 365,
"end": 428,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
2022-02-04 14:17:42 +03:00
"start": 367,
"end": 428,
"ctxt": 0
},
"members": [
{
"type": "TsCallSignatureDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 377,
"end": 395,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 381,
"end": 385,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 382,
"end": 385,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 384,
"end": 385,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 384,
"end": 385,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 386,
"end": 394,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 388,
"end": 394,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 377,
"end": 380,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 378,
"end": 379,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 378,
"end": 379,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
}
},
{
"type": "TsCallSignatureDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 404,
"end": 422,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 408,
"end": 412,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 409,
"end": 412,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
2022-02-04 14:17:42 +03:00
"start": 411,
"end": 412,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 411,
"end": 412,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
}
}
}
],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
2022-02-04 14:17:42 +03:00
"start": 413,
"end": 421,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
2022-02-04 14:17:42 +03:00
"start": 415,
"end": 421,
"ctxt": 0
},
"kind": "string"
}
},
"typeParams": {
"type": "TsTypeParameterDeclaration",
"span": {
2022-02-04 14:17:42 +03:00
"start": 404,
"end": 407,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
2022-02-04 14:17:42 +03:00
"start": 405,
"end": 406,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 405,
"end": 406,
"ctxt": 0
},
"value": "T",
"optional": false
},
"constraint": null,
"default": null
}
]
}
}
]
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 447,
"end": 467,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 447,
"end": 466,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 447,
"end": 455,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 447,
"end": 449,
"ctxt": 0
},
"value": "c2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 450,
"end": 455,
"ctxt": 0
},
"value": "func4",
"optional": false
}
},
"right": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 458,
"end": 466,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 458,
"end": 460,
"ctxt": 0
},
"value": "c2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 461,
"end": 466,
"ctxt": 0
},
"value": "func5",
"optional": false
}
}
}
},
{
"type": "ExpressionStatement",
"span": {
2022-02-04 14:17:42 +03:00
"start": 468,
"end": 488,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 468,
"end": 487,
"ctxt": 0
},
"operator": "=",
"left": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 468,
"end": 476,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 468,
"end": 470,
"ctxt": 0
},
"value": "c2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 471,
"end": 476,
"ctxt": 0
},
"value": "func5",
"optional": false
}
},
"right": {
"type": "MemberExpression",
"span": {
2022-02-04 14:17:42 +03:00
"start": 479,
"end": 487,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 479,
"end": 481,
"ctxt": 0
},
"value": "c2",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
2022-02-04 14:17:42 +03:00
"start": 482,
"end": 487,
"ctxt": 0
},
"value": "func4",
"optional": false
}
}
}
}
],
"interpreter": null
}