if (expr instanceof CanBooleanEval) {
CanBooleanEval cond = (CanBooleanEval) expr;
// If false, replace with initializers and condition.
if (cond.isBooleanFalse()) {
JsBlock block = new JsBlock();
if (x.getInitExpr() != null) {
block.getStatements().add(x.getInitExpr().makeStmt());
}
if (x.getInitVars() != null) {
block.getStatements().add(x.getInitVars());
}
block.getStatements().add(expr.makeStmt());
JsStatement decls = ensureDeclarations(x.getBody());
if (decls != null) {
block.getStatements().add(decls);
}
ctx.replaceMe(accept(block));
}
}
}