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

223 lines
5.6 KiB
JSON

{
"type": "Script",
"span": {
"start": 19,
"end": 100,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 19,
"end": 68,
"ctxt": 0
},
"kind": "const",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 33,
"end": 67,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 33,
"end": 36,
"ctxt": 0
},
"value": "f11",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 36,
"end": 67,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsUnionType",
"span": {
"start": 38,
"end": 67,
"ctxt": 0
},
"types": [
{
"type": "TsLiteralType",
"span": {
"start": 38,
"end": 39,
"ctxt": 0
},
"literal": {
"type": "NumericLiteral",
"span": {
"start": 38,
"end": 39,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
}
},
{
"type": "TsLiteralType",
"span": {
"start": 42,
"end": 43,
"ctxt": 0
},
"literal": {
"type": "NumericLiteral",
"span": {
"start": 42,
"end": 43,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
},
{
"type": "TsLiteralType",
"span": {
"start": 46,
"end": 48,
"ctxt": 0
},
"literal": {
"type": "StringLiteral",
"span": {
"start": 46,
"end": 48,
"ctxt": 0
},
"value": "",
"raw": "''"
}
},
{
"type": "TsKeywordType",
"span": {
"start": 51,
"end": 55,
"ctxt": 0
},
"kind": "null"
},
{
"type": "TsKeywordType",
"span": {
"start": 58,
"end": 67,
"ctxt": 0
},
"kind": "undefined"
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "VariableDeclaration",
"span": {
"start": 70,
"end": 100,
"ctxt": 0
},
"kind": "let",
"declare": false,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 74,
"end": 100,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 74,
"end": 77,
"ctxt": 0
},
"value": "g11",
"optional": false,
"typeAnnotation": null
},
"init": {
"type": "BinaryExpression",
"span": {
"start": 80,
"end": 100,
"ctxt": 0
},
"operator": "??",
"left": {
"type": "Identifier",
"span": {
"start": 80,
"end": 83,
"ctxt": 0
},
"value": "f11",
"optional": false
},
"right": {
"type": "CallExpression",
"span": {
"start": 87,
"end": 100,
"ctxt": 0
},
"callee": {
"type": "MemberExpression",
"span": {
"start": 87,
"end": 98,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 87,
"end": 90,
"ctxt": 0
},
"value": "f11",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 91,
"end": 98,
"ctxt": 0
},
"value": "toFixed",
"optional": false
}
},
"arguments": [],
"typeArguments": null
}
},
"definite": false
}
]
}
],
"interpreter": null
}