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

242 lines
6.6 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 116,
"end": 200,
"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": 200,
"ctxt": 0
},
"expression": {
"type": "CallExpression",
"span": {
"start": 163,
"end": 199,
"ctxt": 0
},
"callee": {
"type": "ParenthesisExpression",
"span": {
"start": 163,
"end": 197,
"ctxt": 0
},
"expression": {
"type": "ArrowFunctionExpression",
"span": {
"start": 164,
"end": 196,
"ctxt": 0
},
"params": [
{
"type": "ObjectPattern",
"span": {
"start": 165,
"end": 189,
"ctxt": 0
},
"properties": [
{
"type": "KeyValuePatternProperty",
"key": {
"type": "Computed",
"span": {
"start": 167,
"end": 179,
"ctxt": 0
},
"expression": {
"type": "BinaryExpression",
"span": {
"start": 168,
"end": 178,
"ctxt": 0
},
"operator": "??",
"left": {
"type": "CallExpression",
"span": {
"start": 168,
"end": 171,
"ctxt": 0
},
"callee": {
"type": "Identifier",
"span": {
"start": 168,
"end": 169,
"ctxt": 0
},
"value": "a",
"optional": false
},
"arguments": [],
"typeArguments": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 175,
"end": 178,
"ctxt": 0
},
"value": "d",
"raw": "\"d\""
}
}
},
"value": {
"type": "AssignmentPattern",
"span": {
"start": 181,
"end": 187,
"ctxt": 0
},
"left": {
"type": "Identifier",
"span": {
"start": 181,
"end": 182,
"ctxt": 0
},
"value": "c",
"optional": false,
"typeAnnotation": null
},
"right": {
"type": "StringLiteral",
"span": {
"start": 185,
"end": 187,
"ctxt": 0
},
"value": "",
"raw": "\"\""
}
}
}
],
"optional": false,
"typeAnnotation": null
}
],
"body": {
"type": "BlockStatement",
"span": {
"start": 194,
"end": 196,
"ctxt": 0
},
"stmts": []
},
"async": false,
"generator": false,
"typeParameters": null,
"returnType": null
}
},
"arguments": [],
"typeArguments": null
}
}
],
"interpreter": null
}