src/com/google/javascript/jscomp/parsing/IRFactory.java
// avoid recursing in this case and loop instead.
avoid recursing in this case and loop instead.
avoid recursing in this case and loop instead .
private Node processBinaryExpressionHelper(BinaryOperatorTree exprTree) {
      Node root = null;
      Node current = null;
      Node previous = null;
      while (exprTree != null) {
        if (exprTree.operator.type == TokenType.STAR_STAR
            || exprTree.operator.type == TokenType.STAR_STAR_EQUAL) {
          maybeWarnForFeature(exprTree, Feature.EXPONENT_OP);
        }
        previous = current;
        current = newNode(
            transformBinaryTokenType(exprTree.operator.type),
            transform(exprTree.right));
        setSourceInfo(current, exprTree);
        if (previous != null) {
          previous.addChildToFront(current);
        }
        if (exprTree.left instanceof BinaryOperatorTree) {
          exprTree = (BinaryOperatorTree) exprTree.left;
        } else {
          Node leftNode = transform(exprTree.left);
          current.addChildToFront(leftNode);
          exprTree = null;
        }
        if (root == null) {
          root = current;
        }
      }
      return root;
    }
private Node processBinaryExpressionHelper ( BinaryOperatorTree exprTree ) { Node root = null ; Node current = null ; Node previous = null ; while ( exprTree != null ) { if ( exprTree . operator . type == TokenType . STAR_STAR || exprTree . operator . type == TokenType . STAR_STAR_EQUAL ) { maybeWarnForFeature ( exprTree , Feature . EXPONENT_OP ) ; } previous = current ; current = newNode ( transformBinaryTokenType ( exprTree . operator . type ) , transform ( exprTree . right ) ) ; setSourceInfo ( current , exprTree ) ; if ( previous != null ) { previous . addChildToFront ( current ) ; } if ( exprTree . left instanceof BinaryOperatorTree ) { exprTree = ( BinaryOperatorTree ) exprTree . left ; } else { Node leftNode = transform ( exprTree . left ) ; current . addChildToFront ( leftNode ) ; exprTree = null ; } if ( root == null ) { root = current ; } } return root ; }
avoid recursing in this case and loop instead.
avoid recursing in this case and loop instead .
// Skip the first child but recurse normally into the right operand as typically this isn't // deep and because we have already checked that there isn't any JSDoc we can traverse // out of order. // We have inlined "transform" here. Normally, we would need to handle the JSDoc here but we // know there is no JSDoc to attach, which simplifies things. // As the iteration continues add the left operand. // continue with the left hand child // Finish things off, add the left operand to the current node. // Nothing left to do. // Save the top binary op, this is the result to return.