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

210 lines
5.3 KiB
JSON

{
"type": "Script",
"span": {
"start": 116,
"end": 190,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 116,
"end": 162,
"ctxt": 0
},
"kind": "const",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 122,
"end": 161,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 122,
"end": 123,
"ctxt": 0
},
"value": "a",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "ArrowFunctionExpression",
"span": {
"start": 126,
"end": 161,
"ctxt": 0
},
"params": [],
"body": {
"type": "Identifier",
"span": {
"start": 152,
"end": 161,
"ctxt": 0
},
"value": "undefined",
"optional": false
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": {
"type": "TsTypeAnnotation",
"span": {
"start": 128,
"end": 148,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 130,
"end": 148,
"ctxt": 0
},
"types": [
{
"type": "TsKeywordType",
"span": {
"start": 130,
"end": 136,
"ctxt": 0
},
"kind": "string"
},
{
"type": "TsKeywordType",
"span": {
"start": 139,
"end": 148,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
},
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 163,
"end": 190,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 163,
"end": 189,
"ctxt": 0
},
"callee": {
"type": "ParenthesisExpression",
"span": {
"start": 163,
"end": 187,
"ctxt": 0
},
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 164,
"end": 186,
"ctxt": 0
},
"params": [
{
"type": "AssignmentPattern",
"span": {
"start": 165,
"end": 179,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 165,
"end": 166,
"ctxt": 0
},
"value": "b",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "BinaryExpression",
"span": {
"start": 169,
"end": 179,
"ctxt": 0
},
"operator": "??",
"left": {
"type": "CallExpression",
"span": {
"start": 169,
"end": 172,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 169,
"end": 170,
"ctxt": 0
},
"value": "a",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 176,
"end": 179,
"ctxt": 0
},
"value": "d",
"raw": "\"d\""
}
},
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 184,
"end": 186,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
},
"arguments": [],
"typeArguments": null
}
}
],
"interpreter": null
}