code: protected void generateNonExpressionIfNode(IfNode node) {
      ConditionalBuilder conditional = null;
  
      for (SoyNode child : node.getChildren()) {
        if (child instanceof IfCondNode) {
          IfCondNode condNode = (IfCondNode) child;
  
          // Convert predicate.
          Expression predicate = translateExpr(condNode.getExpr());
          // Convert body.
          Statement consequent = visitChildrenReturningCodeChunk(condNode);
          // Add if-block to conditional.
          if (conditional == null) {
            conditional = ifStatement(predicate, consequent);
          } else {
            conditional.addElseIf(predicate, consequent);
          }
  
        } else if (child instanceof IfElseNode) {
          // Convert body.
          Statement trailingElse = visitChildrenReturningCodeChunk((IfElseNode) child);
          // Add else-block to conditional.
          conditional.setElse(trailingElse);
        } else {
          throw new AssertionError();
        }
      }
  
      jsCodeBuilder.append(conditional.build());
    }
docs: Generates the JavaScript code for an {if} block that cannot be done as an expression.
  
  <p>TODO(user): Instead of interleaving JsCodeBuilders like this, consider refactoring
  GenJsCodeVisitor to return CodeChunks for each sub-Template level SoyNode.