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

197 lines
4.1 KiB
JSON

{
"type": "Script",
"span": {
"start": 1,
"end": 77,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 12,
"end": 21,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 12,
"end": 21,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 13,
"end": 21,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 15,
"end": 21,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 1,
"end": 29,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 22,
"end": 28,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 24,
"end": 28,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 39,
"end": 40,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 41,
"end": 50,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 41,
"end": 50,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 42,
"end": 50,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 44,
"end": 50,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 30,
"end": 77,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 60,
"end": 77,
"ctxt": 0
},
"stmts": [
{
"type": "ReturnStatement",
"span": {
"start": 66,
"end": 75,
"ctxt": 0
},
"argument": {
"type": "NumericLiteral",
"span": {
"start": 73,
"end": 74,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
}
]
},
"generator": false,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 51,
"end": 59,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 53,
"end": 59,
"ctxt": 0
},
"kind": "number"
}
}
}
],
"interpreter": null
}