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

211 lines
4.9 KiB
JSON
Raw Normal View History

{
"type": "Script",
"span": {
"start": 17,
"end": 78,
"ctxt": 0
},
"body": [
{
"type": "VariableDeclaration",
"span": {
"start": 17,
"end": 48,
"ctxt": 0
},
"kind": "let",
"declare": true,
"declarations": [
{
"type": "VariableDeclarator",
"span": {
"start": 29,
"end": 47,
"ctxt": 0
},
"id": {
"type": "Identifier",
"span": {
"start": 29,
"end": 30,
"ctxt": 0
},
"value": "x",
"optional": false,
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 30,
"end": 47,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsTypeLiteral",
"span": {
"start": 32,
"end": 47,
"ctxt": 0
},
"members": [
{
"type": "TsPropertySignature",
"span": {
"start": 34,
"end": 45,
"ctxt": 0
},
"readonly": false,
"key": {
"type": "Identifier",
"span": {
"start": 34,
"end": 35,
"ctxt": 0
},
"value": "a",
"optional": false
},
"computed": false,
"optional": true,
"init": null,
"params": [],
"typeAnnotation": {
"type": "TsTypeAnnotation",
"span": {
"start": 36,
"end": 45,
"ctxt": 0
},
"typeAnnotation": {
"type": "TsKeywordType",
"span": {
"start": 38,
"end": 45,
"ctxt": 0
},
"kind": "boolean"
}
},
"typeParams": null
}
]
}
}
},
"init": null,
"definite": false
}
]
},
{
"type": "ExpressionStatement",
"span": {
"start": 50,
"end": 63,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 50,
"end": 62,
"ctxt": 0
},
"operator": "??=",
"left": {
"type": "MemberExpression",
"span": {
"start": 50,
"end": 53,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 50,
"end": 51,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 52,
"end": 53,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 58,
"end": 62,
"ctxt": 0
},
"value": true
}
}
},
{
"type": "ExpressionStatement",
"span": {
"start": 64,
"end": 78,
"ctxt": 0
},
"expression": {
"type": "AssignmentExpression",
"span": {
"start": 64,
"end": 77,
"ctxt": 0
},
"operator": "&&=",
"left": {
"type": "MemberExpression",
"span": {
"start": 64,
"end": 67,
"ctxt": 0
},
"object": {
"type": "Identifier",
"span": {
"start": 64,
"end": 65,
"ctxt": 0
},
"value": "x",
"optional": false
},
"property": {
"type": "Identifier",
"span": {
"start": 66,
"end": 67,
"ctxt": 0
},
"value": "a",
"optional": false
}
},
"right": {
"type": "BooleanLiteral",
"span": {
"start": 72,
"end": 77,
"ctxt": 0
},
"value": false
}
}
}
],
"interpreter": null
}