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

188 lines
3.9 KiB
JSON

{
"type": "Script",
"span": {
"start": 0,
"end": 74,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 9,
"end": 10,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 11,
"end": 20,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 11,
"end": 20,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 12,
"end": 20,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 14,
"end": 20,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 0,
"end": 30,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 21,
"end": 29,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 23,
"end": 29,
"ctxt": 0
},
"kind": "number"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 40,
"end": 41,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 42,
"end": 51,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 42,
"end": 51,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 43,
"end": 51,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 45,
"end": 51,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 31,
"end": 74,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 59,
"end": 74,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 65,
"end": 72,
"ctxt": 0
},
"argument": null
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 52,
"end": 58,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 54,
"end": 58,
"ctxt": 0
},
"kind": "void"
}
}
}
],
"interpreter": null
}