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

371 lines
10 KiB
JSON

{
"type": "Script",
"span": {
"start": 16,
"end": 157,
"ctxt": 0
},
"body": [
{
"type": "TsModuleDeclaration",
"span": {
"start": 16,
"end": 157,
"ctxt": 0
},
"declare": false,
"global": false,
"id": {
"type": "Identifier",
"span": {
"start": 23,
"end": 24,
"ctxt": 0
},
"value": "M",
"optional": false
},
"body": {
"type": "TsModuleBlock",
"span": {
"start": 25,
"end": 157,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 41,
"end": 42,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 43,
"end": 52,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 43,
"end": 52,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 44,
"end": 52,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 46,
"end": 52,
"ctxt": 0
},
"kind": "string"
}
}
}
}
],
"decorators": [],
"span": {
"start": 31,
"end": 69,
"ctxt": 0
},
"body": null,
"generator": true,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 53,
"end": 68,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 55,
"end": 68,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 55,
"end": 63,
"ctxt": 0
},
"value": "Iterable",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 63,
"end": 68,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 64,
"end": 67,
"ctxt": 0
},
"kind": "any"
}
]
}
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 84,
"end": 85,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 86,
"end": 95,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 86,
"end": 95,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 87,
"end": 95,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 89,
"end": 95,
"ctxt": 0
},
"kind": "number"
}
}
}
}
],
"decorators": [],
"span": {
"start": 74,
"end": 112,
"ctxt": 0
},
"body": null,
"generator": true,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 96,
"end": 111,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 98,
"end": 111,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 98,
"end": 106,
"ctxt": 0
},
"value": "Iterable",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 106,
"end": 111,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 107,
"end": 110,
"ctxt": 0
},
"kind": "any"
}
]
}
}
}
},
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 127,
"end": 128,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 129,
"end": 135,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 129,
"end": 135,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 130,
"end": 135,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 132,
"end": 135,
"ctxt": 0
},
"kind": "any"
}
}
}
}
],
"decorators": [],
"span": {
"start": 117,
"end": 155,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 152,
"end": 155,
"ctxt": 0
},
"stmts": []
},
"generator": true,
"async": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 136,
"end": 151,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 138,
"end": 151,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 138,
"end": 146,
"ctxt": 0
},
"value": "Iterable",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 146,
"end": 151,
"ctxt": 0
},
"params": [
{
"type": "TsKeywordType",
"span": {
"start": 147,
"end": 150,
"ctxt": 0
},
"kind": "any"
}
]
}
}
}
}
]
}
}
],
"interpreter": null
}