Examples of copyInformationFromForTree()


Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

   * Try to fold arithmetic binary operators
   */
  private Node tryFoldArithmeticOp(Node n, Node left, Node right) {
    Node result = performArithmeticOp(n.getType(), left, right);
    if (result != null) {
      result.copyInformationFromForTree(n);
      n.getParent().replaceChild(n, result);
      reportCodeChange();
      return result;
    }
    return n;
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

        left.removeChild(valueToCombine);
        // Replace the left op with the remaining child.
        n.replaceChild(left, left.removeFirstChild());
        // New "-Infinity" node need location info explicitly
        // added.
        replacement.copyInformationFromForTree(right);
        n.replaceChild(right, replacement);
        reportCodeChange();
      }
    }
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

      for (Map.Entry<String, String> entry : varmap.entrySet()) {
        Node val = initvals.get(entry.getKey());
        Node varnode = NodeUtil.newVarNode(entry.getValue(), val);
        if (val == null) {
          // is this right?
          varnode.copyInformationFromForTree(vnode);
        } else {
          blacklistVarReferencesInTree(val, v.scope);
        }
        vnode.getParent().addChildBefore(varnode, vnode);
        compiler.reportChangeToEnclosingScope(vnode);
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

    // A result is needed create a dummy value.
    Node srcLocation = node;
    Node retVal = NodeUtil.newUndefinedNode(srcLocation);
    Node resultNode = createAssignStatementNode(resultName, retVal);
    resultNode.copyInformationFromForTree(node);

    node.addChildrenToBack(resultNode);
  }

  /**
 
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

    Node resultNode = getReplacementReturnStatement(ret, resultName);

    if (resultNode == null) {
      block.removeChild(ret);
    } else {
      resultNode.copyInformationFromForTree(ret);
      block.replaceChild(ret, resultNode);
    }
  }

  /**
 
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

      Node resultNode = getReplacementReturnStatement(current, resultName);
      Node breakNode = IR.breakNode(IR.labelName(labelName));

      // Replace the node in parent, and reset current to the first new child.
      breakNode.copyInformationFromForTree(current);
      parent.replaceChild(current, breakNode);
      if (resultNode != null) {
        resultNode.copyInformationFromForTree(current);
        parent.addChildBefore(resultNode, breakNode);
      }
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

          reportCodeChange();
          return number;
      }

      Node not = IR.not(IR.number(n.isTrue() ? 0 : 1));
      not.copyInformationFromForTree(n);
      n.getParent().replaceChild(n, not);
      reportCodeChange();
      return not;
    }
    return n;
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

      Node call = IR.call(
          IR.getprop(
              IR.string(template),
              IR.string("split")),
          IR.string("" + delimiter));
      call.copyInformationFromForTree(n);
      n.getParent().replaceChild(n, call);
      reportCodeChange();
      return call;
    }
    return n;
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

   *   "void 0"
   */
  static Node newUndefinedNode(Node srcReferenceNode) {
    Node node = IR.voidNode(IR.number(0));
    if (srcReferenceNode != null) {
        node.copyInformationFromForTree(srcReferenceNode);
    }
    return node;
  }

  /**
 
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

               compiler, className + ".prototype",
               instance.parent, className + ".prototype"));
      call.putIntProp(Node.FREE_CALL, 1);

      Node stmt = new Node(first.node.getType(), call);
      stmt.copyInformationFromForTree(first.node);
      instance.parent.addChildBefore(stmt, first.node);
      for (PrototypeMemberDeclaration declar : instance.declarations) {
        block.addChildToBack(declar.node.detachFromParent());
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.