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

200 lines
5.8 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 15,
"end": 75,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 15,
"end": 75,
"ctxt": 0
},
"kind": "var",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 19,
"end": 74,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 19,
"end": 23,
"ctxt": 0
},
"value": "iter",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 23,
"end": 56,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeReference",
"span": {
"start": 25,
"end": 56,
"ctxt": 0
},
"typeName": {
"type": "Identifier",
"span": {
"start": 25,
"end": 33,
"ctxt": 0
},
"value": "Iterable",
"optional": false
},
"typeParams": {
"type": "TsTypeParameterInstantiation",
"span": {
"start": 33,
"end": 56,
"ctxt": 0
},
"params": [
{
"type": "TsFunctionType",
"span": {
"start": 34,
"end": 55,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 35,
"end": 44,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 36,
"end": 44,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 38,
"end": 44,
"ctxt": 0
},
"kind": "string"
}
}
}
],
"typeParams": null,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 46,
"end": 55,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 49,
"end": 55,
"ctxt": 0
},
"kind": "number"
}
}
}
]
}
}
}
},
"init": {
"type": "ArrayExpression",
"span": {
"start": 59,
"end": 74,
"ctxt": 0
},
"elements": [
{
"spread": null,
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 60,
"end": 73,
"ctxt": 0
},
"params": [
{
"type": "Identifier",
"span": {
"start": 60,
"end": 61,
"ctxt": 0
},
"value": "s",
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "MemberExpression",
"span": {
"start": 65,
"end": 73,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 65,
"end": 66,
"ctxt": 0
},
"value": "s",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 67,
"end": 73,
"ctxt": 0
},
"value": "length",
"optional": false
}
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
}
]
},
"definite": false
}
]
}
],
"interpreter": null
}