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

505 lines
11 KiB
JSON

{
"type": "Script",
"span": {
"start": 90,
"end": 367,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 99,
"end": 103,
"ctxt": 0
},
"value": "fn4a",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 104,
"end": 114,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 104,
"end": 114,
"ctxt": 0
},
"value": "x",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 106,
"end": 114,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 108,
"end": 114,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 116,
"end": 125,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 116,
"end": 125,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 117,
"end": 125,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 119,
"end": 125,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 90,
"end": 127,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 137,
"end": 141,
"ctxt": 0
},
"value": "fn4a",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 128,
"end": 147,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 144,
"end": 147,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 158,
"end": 162,
"ctxt": 0
},
"value": "fn4b",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 163,
"end": 172,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 163,
"end": 172,
"ctxt": 0
},
"value": "n",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 164,
"end": 172,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 166,
"end": 172,
"ctxt": 0
},
"kind": "string"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 174,
"end": 184,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 174,
"end": 184,
"ctxt": 0
},
"value": "x",
"optional": true,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 176,
"end": 184,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 178,
"end": 184,
"ctxt": 0
},
"kind": "number"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 186,
"end": 195,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 186,
"end": 195,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 187,
"end": 195,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 189,
"end": 195,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 149,
"end": 197,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 207,
"end": 211,
"ctxt": 0
},
"value": "fn4b",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 198,
"end": 217,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 214,
"end": 217,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 309,
"end": 312,
"ctxt": 0
},
"value": "fn5",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 313,
"end": 322,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 313,
"end": 322,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 314,
"end": 322,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 316,
"end": 322,
"ctxt": 0
},
"kind": "string"
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 324,
"end": 335,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "RestElement",
"span": {
"start": 324,
"end": 335,
"ctxt": 0
},
"rest": {
"start": 324,
"end": 327,
"ctxt": 0
},
"argument": {
"type": "Identifier",
"span": {
"start": 327,
"end": 328,
"ctxt": 0
},
"value": "y",
"optional": false,
"typeAnnotation": null
},
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 328,
"end": 335,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsArrayType",
"span": {
"start": 330,
"end": 335,
"ctxt": 0
},
"elemType": {
"type": "TsKeywordType",
"span": {
"start": 330,
"end": 333,
"ctxt": 0
},
"kind": "any"
}
}
}
}
},
{
"type": "Parameter",
"span": {
"start": 337,
"end": 346,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 337,
"end": 346,
"ctxt": 0
},
"value": "z",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 338,
"end": 346,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 340,
"end": 346,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 300,
"end": 348,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 358,
"end": 361,
"ctxt": 0
},
"value": "fn5",
"optional": false
},
"declare": false,
"params": [],
"decorators": [],
"span": {
"start": 349,
"end": 367,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 364,
"end": 367,
"ctxt": 0
},
"stmts": []
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}