}
return null;
}
protected JS doVisit(WriterVisitor<JS> visitor, UnaryTree tree, GenerationContext<JS> context, boolean global) {
UnaryOperator op = UnaryOperator.valueOf(tree.getKind());
assert op != null : "Unknow operator:" + tree.getKind();
BinaryOperator binaryOp = getBinaryOperator(op);
if (binaryOp == null) {
return super.visit(visitor, tree, context);
}
JS operand = visitor.scan(tree.getExpression(), context);
TreeWrapper<ExpressionTree, JS> twOperand = context.getCurrentWrapper().child(tree.getExpression());
JS target = SetterAssignmentTemplate.getTarget(visitor, twOperand, context);
JS field = SetterAssignmentTemplate.getField(twOperand, context);
JS value = context.js().binary(binaryOp, Arrays.asList(operand, context.js().number(1)));
List<JS> arguments = new ArrayList<JS>();
arguments.add(field);
arguments.add(value);
if (op.isPostfix()) {
arguments.add(context.js().keyword(Keyword.TRUE));
}
if (global) {
arguments.add(0, target);