return doVisit(visitor, tree, context, false);
}
@SuppressWarnings("PMD.CompareObjectsWithEquals")
protected JS doVisit(WriterVisitor<JS> visitor, CompoundAssignmentTree tree, GenerationContext<JS> context, boolean global) {
AssignOperator op = AssignOperator.valueOf(tree.getKind());
assert op != null : "Unknown operator:" + tree.getKind();
JS left = visitor.scan(tree.getVariable(), context);
JS right = visitor.scan(tree.getExpression(), context);
JS modifiedRight = DefaultCompoundAssignmentTemplate.rightSide(left, right, tree, context);
JS value;
if (modifiedRight == right) {
value = context.js().binary(op.getBinaryOperator(), Arrays.asList(left, context.js().paren(right)));
} else {
value = modifiedRight;
}
TreeWrapper<ExpressionTree, JS> leftSide = context.getCurrentWrapper().child(tree.getVariable());