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

269 lines
7.2 KiB
JSON

{
"type": "Script",
"span": {
"start": 155,
"end": 259,
"ctxt": 0
},
"body": [
{
"type": "FunctionDeclaration",
"identifier": {
"type": "Identifier",
"span": {
"start": 171,
"end": 172,
"ctxt": 0
},
"value": "f",
"optional": false
},
"declare": false,
"params": [
{
"type": "Parameter",
"span": {
"start": 173,
"end": 190,
"ctxt": 0
},
"decorators": [],
"pat": {
"type": "Identifier",
"span": {
"start": 173,
"end": 190,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 174,
"end": 190,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 176,
"end": 190,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 178,
"end": 188,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 178,
"end": 179,
"ctxt": 0
},
"value": "b",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 180,
"end": 188,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 182,
"end": 188,
"ctxt": 0
},
"kind": "number"
}
},
"typeParams": null
}
]
}
}
}
}
],
"decorators": [],
"span": {
"start": 155,
"end": 259,
"ctxt": 0
},
"body": {
"type": "BlockStatement",
"span": {
"start": 192,
"end": 259,
"ctxt": 0
},
"stmts": [
{
"type": "VariableDeclaration",
"span": {
"start": 198,
"end": 216,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 202,
"end": 215,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 202,
"end": 203,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 206,
"end": 215,
"ctxt": 0
},
"operator": "??",
"left": {
"type": "MemberExpression",
"span": {
"start": 206,
"end": 209,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 206,
"end": 207,
"ctxt": 0
},
"value": "a",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 208,
"end": 209,
"ctxt": 0
},
"value": "b",
"optional": false
}
},
"right": {
"type": "NumericLiteral",
"span": {
"start": 213,
"end": 215,
"ctxt": 0
},
"value": 10.0
}
},
"definite": false
}
]
},
{
"type": "WhileStatement",
"span": {
"start": 221,
"end": 257,
"ctxt": 0
},
"test": {
"type": "Identifier",
"span": {
"start": 228,
"end": 229,
"ctxt": 0
},
"value": "c",
"optional": false
},
"body": {
"type": "BlockStatement",
"span": {
"start": 231,
"end": 257,
"ctxt": 0
},
"stmts": [
{
"type": "ExpressionStatement",
"span": {
"start": 241,
"end": 251,
"ctxt": 0
},
"expression": {
"type": "YieldExpression",
"span": {
"start": 241,
"end": 250,
"ctxt": 0
},
"argument": {
"type": "UpdateExpression",
"span": {
"start": 247,
"end": 250,
"ctxt": 0
},
"operator": "--",
"prefix": false,
"argument": {
"type": "Identifier",
"span": {
"start": 247,
"end": 248,
"ctxt": 0
},
"value": "c",
"optional": false
}
},
"delegate": false
}
}
]
}
}
]
},
"generator": true,
"async": true,
"typeParameters": null,
"returnType": null
}
],
"interpreter": null
}