Examples of detachFromParent()


Examples of com.gargoylesoftware.htmlunit.javascript.host.Attr.detachFromParent()

    public Attr jsxFunction_setAttributeNode(final Attr newAtt) {
        final String name = newAtt.jsxGet_name();
        final String value = newAtt.jsxGet_value();
        final Attr replacedAtt = (Attr) jsxFunction_getAttributeNode(name);
        if (replacedAtt != null) {
            replacedAtt.detachFromParent();
        }
        getDomNodeOrDie().setAttribute(name, value);
        return replacedAtt;
    }
View Full Code Here

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

   */
  private void visitArrowFunction(NodeTraversal t, Node n) {
    n.setIsArrowFunction(false);
    Node body = n.getLastChild();
    if (!body.isBlock()) {
      body.detachFromParent();
      body = IR.block(IR.returnNode(body).srcref(body)).srcref(body);
      n.addChildToBack(body);
    }

    UpdateThisAndArgumentsReferences updater =
View Full Code Here

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

        } else {
          Node assign = n.getFirstChild();
          Node lhs = assign.getFirstChild();
          Preconditions.checkState(lhs.isName());
          Node rhs = assign.getLastChild();
          lhs.addChildToBack(rhs.detachFromParent());
          var.addChildToBack(lhs.detachFromParent());
          redeclaration = true;
        }
        n = next;
      }
View Full Code Here

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

        CustomPassExecutionTime.BEFORE_OPTIMIZATIONS,
        new CompilerPass() {
          @Override public void process(Node externs, Node root) {
            Node var = root.getLastChild().getFirstChild();
            assertEquals(Token.VAR, var.getType());
            var.detachFromParent();
          }
        });
    try {
      test(options,
           "var x = 3; function f() { return x + z; }",
View Full Code Here

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

    Node right = subtree.getLastChild();
    // Only names
    if (left.isName()
        && right.isName()
        && left.getString().equals(right.getString())) {
      subtree.getParent().replaceChild(subtree, right.detachFromParent());
      reportCodeChange();
      return right;
    }
    return subtree;
  }
View Full Code Here

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

      ErrorManager symbolTableErrorManager =
          new BlackHoleErrorManager(compiler);
      Node expectedRoot = null;
      if (expected != null) {
        expectedRoot = parseExpectedJs(expected);
        expectedRoot.detachFromParent();
      }

      JSError[] stErrors = symbolTableErrorManager.getErrors();
      if (expectedSymbolTableError != null) {
        assertEquals("There should be one error.", 1, stErrors.length);
View Full Code Here

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

      // Collapse the scopes.
      for (Node scopeCall : traversal.getScopeCalls()) {
        Node expressionWithScopeCall = scopeCall.getParent();
        Node scopeClosureBlock = scopeCall.getLastChild().getLastChild();
        scopeClosureBlock.detachFromParent();
        expressionWithScopeCall.getParent().replaceChild(
            expressionWithScopeCall,
            scopeClosureBlock);
        NodeUtil.tryMergeBlock(scopeClosureBlock);
      }
View Full Code Here

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

    Preconditions.checkState(input.isExtern(), "Not an extern input: %s", input.getName());
    inputsById.remove(id);
    externs.remove(input);
    Node root = input.getAstRoot(this);
    if (root != null) {
      root.detachFromParent();
    }
  }

  @Override
  public CompilerInput newExternInput(String name) {
View Full Code Here

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

    } else {
      // Return the original object
      Node callTarget = n.getFirstChild();
      Node objectToLoopOver = callTarget.getNext();

      objectToLoopOver.detachFromParent();
      Node ret = IR.returnNode(objectToLoopOver).srcref(callTarget);
      expandedBlock.addChildToBack(ret);

      // Wrap all of the expanded loop calls in a new anonymous function
      Node fnc = IR.function(IR.name("").srcref(callTarget),
View Full Code Here

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

        Node thenNode = cond.getNext();
        Node elseNode = thenNode.getNext();
        MinimizedCondition thenSubtree =
            computeMinimizedCondition(thenNode.detachFromParent());
        MinimizedCondition elseSubtree =
            computeMinimizedCondition(elseNode.detachFromParent());
        MeasuredNode posTree = MeasuredNode.addNode(
            new Node(Token.HOOK, cond.cloneTree()).srcref(n),
            thenSubtree.positive,
            elseSubtree.positive);
        MeasuredNode negTree = MeasuredNode.addNode(
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.