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

235 lines
5.6 KiB
JSON

{
"type": "Script",
"span": {
"start": 36,
"end": 101,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 53,
"end": 54,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": true,
"params": [
{
"type": "Parameter",
"span": {
"start": 58,
"end": 75,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 58,
"end": 75,
"ctxt": 0
},
"value": "value",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 63,
"end": 75,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 65,
"end": 75,
"ctxt": 0
},
"types": [
{
"type": "TsTypeReference",
"span": {
"start": 65,
"end": 66,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 65,
"end": 66,
"ctxt": 0
},
"value": "T",
"optional": false
},
"typeParams": null
},
{
"type": "TsKeywordType",
"span": {
"start": 69,
"end": 75,
"ctxt": 0
},
"kind": "number"
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 36,
"end": 83,
"ctxt": 0
},
"body": null,
"generator": false,
"async": false,
"typeParameters": {
"type": "TsTypeParameterDeclaration",
"span": {
"start": 54,
"end": 57,
"ctxt": 0
},
"parameters": [
{
"type": "TsTypeParameter",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"name": {
"type": "Identifier",
"span": {
"start": 55,
"end": 56,
"ctxt": 0
},
"value": "T",
"optional": false
},
"in": false,
"out": false,
"const": false,
"constraint": null,
"default": null
}
]
},
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 76,
"end": 82,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 78,
"end": 82,
"ctxt": 0
},
"kind": "void"
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 84,
"end": 101,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 84,
"end": 101,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 84,
"end": 85,
"ctxt": 0
},
"value": "f",
"optional": false
},
"arguments": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 86,
"end": 100,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 87,
"end": 93,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 88,
"end": 93,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 90,
"end": 93,
"ctxt": 0
},
"kind": "any"
}
}
}
],
"body": {
"type": "StringLiteral",
"span": {
"start": 98,
"end": 100,
"ctxt": 0
},
"value": "",
"raw": "\"\""
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
],
"typeArguments": null
}
}
],
"interpreter": null
}