Java Code Examples for com.google.javascript.rhino.Node#isInc()

The following examples show how to use com.google.javascript.rhino.Node#isInc() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Cardumen_00200_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Determines whether this node is used as an L-value. Notice that sometimes
 * names are used as both L-values and R-values.
 *
 * We treat "var x;" as a pseudo-L-value, which kind of makes sense if you
 * treat it as "assignment to 'undefined' at the top of the scope". But if
 * we're honest with ourselves, it doesn't make sense, and we only do this
 * because it makes sense to treat this as syntactically similar to
 * "var x = 0;".
 *
 * @param n The node
 * @return True if n is an L-value.
 */
public static boolean isLValue(Node n) {
  Preconditions.checkArgument(n.isName() || n.isGetProp() ||
      n.isGetElem());
  Node parent = n.getParent();
  if (parent == null) {
    return false;
  }
  return (NodeUtil.isAssignmentOp(parent) && parent.getFirstChild() == n)
      || (NodeUtil.isForIn(parent) && parent.getFirstChild() == n)
      || parent.isVar()
      || (parent.isFunction() && parent.getFirstChild() == n)
      || parent.isDec()
      || parent.isInc()
      || parent.isParamList()
      || parent.isCatch();
}
 
Example 2
Source File: Closure_10_NodeUtil_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Determines whether this node is used as an L-value. Notice that sometimes
 * names are used as both L-values and R-values.
 *
 * We treat "var x;" as a pseudo-L-value, which kind of makes sense if you
 * treat it as "assignment to 'undefined' at the top of the scope". But if
 * we're honest with ourselves, it doesn't make sense, and we only do this
 * because it makes sense to treat this as syntactically similar to
 * "var x = 0;".
 *
 * @param n The node
 * @return True if n is an L-value.
 */
public static boolean isLValue(Node n) {
  Preconditions.checkArgument(n.isName() || n.isGetProp() ||
      n.isGetElem());
  Node parent = n.getParent();
  if (parent == null) {
    return false;
  }
  return (NodeUtil.isAssignmentOp(parent) && parent.getFirstChild() == n)
      || (NodeUtil.isForIn(parent) && parent.getFirstChild() == n)
      || parent.isVar()
      || (parent.isFunction() && parent.getFirstChild() == n)
      || parent.isDec()
      || parent.isInc()
      || parent.isParamList()
      || parent.isCatch();
}
 
Example 3
Source File: Closure_10_NodeUtil_t.java    From coming with MIT License 6 votes vote down vote up
/**
 * Determines whether this node is used as an L-value. Notice that sometimes
 * names are used as both L-values and R-values.
 *
 * We treat "var x;" as a pseudo-L-value, which kind of makes sense if you
 * treat it as "assignment to 'undefined' at the top of the scope". But if
 * we're honest with ourselves, it doesn't make sense, and we only do this
 * because it makes sense to treat this as syntactically similar to
 * "var x = 0;".
 *
 * @param n The node
 * @return True if n is an L-value.
 */
public static boolean isLValue(Node n) {
  Preconditions.checkArgument(n.isName() || n.isGetProp() ||
      n.isGetElem());
  Node parent = n.getParent();
  if (parent == null) {
    return false;
  }
  return (NodeUtil.isAssignmentOp(parent) && parent.getFirstChild() == n)
      || (NodeUtil.isForIn(parent) && parent.getFirstChild() == n)
      || parent.isVar()
      || (parent.isFunction() && parent.getFirstChild() == n)
      || parent.isDec()
      || parent.isInc()
      || parent.isParamList()
      || parent.isCatch();
}
 
Example 4
Source File: RemoveUnusedClassProperties.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
private void removeUnused() {
  for (Node n : candidates) {
    Preconditions.checkState(n.isGetProp());
    if (!used.contains(n.getLastChild().getString())) {
      Node parent = n.getParent();
      if (NodeUtil.isAssignmentOp(parent)) {
        Node assign = parent;
        Preconditions.checkState(assign != null
            && NodeUtil.isAssignmentOp(assign)
            && assign.getFirstChild() == n);
        // 'this.x = y' to 'y'
        assign.getParent().replaceChild(assign,
            assign.getLastChild().detachFromParent());
      } else if (parent.isInc() || parent.isDec()) {
        parent.getParent().replaceChild(parent, IR.number(0));
      } else {
        throw new IllegalStateException("unexpected: "+ parent);
      }
      compiler.reportCodeChange();
    }
  }
}
 
Example 5
Source File: jMutRepair_003_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Determines whether this node is used as an L-value. Notice that sometimes
 * names are used as both L-values and R-values.
 *
 * We treat "var x;" as a pseudo-L-value, which kind of makes sense if you
 * treat it as "assignment to 'undefined' at the top of the scope". But if
 * we're honest with ourselves, it doesn't make sense, and we only do this
 * because it makes sense to treat this as syntactically similar to
 * "var x = 0;".
 *
 * @param n The node
 * @return True if n is an L-value.
 */
public static boolean isLValue(Node n) {
  Preconditions.checkArgument(n.isName() || n.isGetProp() ||
      n.isGetElem());
  Node parent = n.getParent();
  if (parent == null) {
    return false;
  }
  return (NodeUtil.isAssignmentOp(parent) && parent.getFirstChild() == n)
      || (NodeUtil.isForIn(parent) && parent.getFirstChild() == n)
      || parent.isVar()
      || (parent.isFunction() && parent.getFirstChild() == n)
      || parent.isDec()
      || parent.isInc()
      || parent.isParamList()
      || parent.isCatch();
}
 
Example 6
Source File: jKali_003_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Determines whether this node is used as an L-value. Notice that sometimes
 * names are used as both L-values and R-values.
 *
 * We treat "var x;" as a pseudo-L-value, which kind of makes sense if you
 * treat it as "assignment to 'undefined' at the top of the scope". But if
 * we're honest with ourselves, it doesn't make sense, and we only do this
 * because it makes sense to treat this as syntactically similar to
 * "var x = 0;".
 *
 * @param n The node
 * @return True if n is an L-value.
 */
public static boolean isLValue(Node n) {
  Preconditions.checkArgument(n.isName() || n.isGetProp() ||
      n.isGetElem());
  Node parent = n.getParent();
  if (parent == null) {
    return false;
  }
  return (NodeUtil.isAssignmentOp(parent) && parent.getFirstChild() == n)
      || (NodeUtil.isForIn(parent) && parent.getFirstChild() == n)
      || parent.isVar()
      || (parent.isFunction() && parent.getFirstChild() == n)
      || parent.isDec()
      || parent.isInc()
      || parent.isParamList()
      || parent.isCatch();
}
 
Example 7
Source File: SideEffectsAnalysis.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Return true if the storage node is an r-value.
 */
private static boolean storageNodeIsRValue(Node node) {
  Preconditions.checkArgument(isStorageNode(node));

  // We consider all names to be r-values unless
  // LHS of Token.ASSIGN
  // LHS of of for in expression
  // Child of VAR

  Node parent = node.getParent();

  if (storageNodeIsLValue(node)) {
    // Assume l-value is NOT an r-value
    // unless it is a non-simple assign
    // or an increment/decrement

    boolean nonSimpleAssign =
      NodeUtil.isAssignmentOp(parent) && !parent.isAssign();

    return (nonSimpleAssign
        || parent.isDec()
        || parent.isInc());
  }

  return true;
}
 
Example 8
Source File: Cardumen_0014_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Determines whether this node is used as an L-value. Notice that sometimes
 * names are used as both L-values and R-values.
 *
 * We treat "var x;" as a pseudo-L-value, which kind of makes sense if you
 * treat it as "assignment to 'undefined' at the top of the scope". But if
 * we're honest with ourselves, it doesn't make sense, and we only do this
 * because it makes sense to treat this as syntactically similar to
 * "var x = 0;".
 *
 * @param n The node
 * @return True if n is an L-value.
 */
public static boolean isLValue(Node n) {
  Preconditions.checkArgument(n.isName() || n.isGetProp() ||
      n.isGetElem());
  Node parent = n.getParent();
  if (parent == null) {
    return false;
  }
  return (NodeUtil.isAssignmentOp(parent) && parent.getFirstChild() == n)
      || (NodeUtil.isForIn(parent) && parent.getFirstChild() == n)
      || parent.isVar()
      || (parent.isFunction() && parent.getFirstChild() == n)
      || parent.isDec()
      || parent.isInc()
      || parent.isParamList()
      || parent.isCatch();
}
 
Example 9
Source File: NodeUtil.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Determines whether this node is used as an L-value. Notice that sometimes
 * names are used as both L-values and R-values.
 *
 * We treat "var x;" as a pseudo-L-value, which kind of makes sense if you
 * treat it as "assignment to 'undefined' at the top of the scope". But if
 * we're honest with ourselves, it doesn't make sense, and we only do this
 * because it makes sense to treat this as syntactically similar to
 * "var x = 0;".
 *
 * @param n The node
 * @return True if n is an L-value.
 */
public static boolean isLValue(Node n) {
  Preconditions.checkArgument(n.isName() || n.isGetProp() ||
      n.isGetElem());
  Node parent = n.getParent();
  if (parent == null) {
    return false;
  }
  return (NodeUtil.isAssignmentOp(parent) && parent.getFirstChild() == n)
      || (NodeUtil.isForIn(parent) && parent.getFirstChild() == n)
      || parent.isVar()
      || (parent.isFunction() && parent.getFirstChild() == n)
      || parent.isDec()
      || parent.isInc()
      || parent.isParamList()
      || parent.isCatch();
}
 
Example 10
Source File: Cardumen_00149_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Determines whether this node is used as an L-value. Notice that sometimes
 * names are used as both L-values and R-values.
 *
 * We treat "var x;" as a pseudo-L-value, which kind of makes sense if you
 * treat it as "assignment to 'undefined' at the top of the scope". But if
 * we're honest with ourselves, it doesn't make sense, and we only do this
 * because it makes sense to treat this as syntactically similar to
 * "var x = 0;".
 *
 * @param n The node
 * @return True if n is an L-value.
 */
public static boolean isLValue(Node n) {
  Preconditions.checkArgument(n.isName() || n.isGetProp() ||
      n.isGetElem());
  Node parent = n.getParent();
  if (parent == null) {
    return false;
  }
  return (NodeUtil.isAssignmentOp(parent) && parent.getFirstChild() == n)
      || (NodeUtil.isForIn(parent) && parent.getFirstChild() == n)
      || parent.isVar()
      || (parent.isFunction() && parent.getFirstChild() == n)
      || parent.isDec()
      || parent.isInc()
      || parent.isParamList()
      || parent.isCatch();
}
 
Example 11
Source File: Cardumen_00200_s.java    From coming with MIT License 6 votes vote down vote up
/**
 * Determines whether this node is used as an L-value. Notice that sometimes
 * names are used as both L-values and R-values.
 *
 * We treat "var x;" as a pseudo-L-value, which kind of makes sense if you
 * treat it as "assignment to 'undefined' at the top of the scope". But if
 * we're honest with ourselves, it doesn't make sense, and we only do this
 * because it makes sense to treat this as syntactically similar to
 * "var x = 0;".
 *
 * @param n The node
 * @return True if n is an L-value.
 */
public static boolean isLValue(Node n) {
  Preconditions.checkArgument(n.isName() || n.isGetProp() ||
      n.isGetElem());
  Node parent = n.getParent();
  if (parent == null) {
    return false;
  }
  return (NodeUtil.isAssignmentOp(parent) && parent.getFirstChild() == n)
      || (NodeUtil.isForIn(parent) && parent.getFirstChild() == n)
      || parent.isVar()
      || (parent.isFunction() && parent.getFirstChild() == n)
      || parent.isDec()
      || parent.isInc()
      || parent.isParamList()
      || parent.isCatch();
}
 
Example 12
Source File: Closure_36_InlineVariables_s.java    From coming with MIT License 5 votes vote down vote up
private boolean isLValue(Node n) {
  Node parent = n.getParent();
  return (parent.isInc()
      || parent.isDec()
      || (NodeUtil.isAssignmentOp(parent)
      && parent.getFirstChild() == n));
}
 
Example 13
Source File: Closure_36_InlineVariables_t.java    From coming with MIT License 5 votes vote down vote up
private boolean isLValue(Node n) {
  Node parent = n.getParent();
  return (parent.isInc()
      || parent.isDec()
      || (NodeUtil.isAssignmentOp(parent)
      && parent.getFirstChild() == n));
}
 
Example 14
Source File: Closure_23_PeepholeFoldConstants_t.java    From coming with MIT License 5 votes vote down vote up
private boolean isAssignmentTarget(Node n) {
  Node parent = n.getParent();
  if ((NodeUtil.isAssignmentOp(parent) && parent.getFirstChild() == n)
      || parent.isInc()
      || parent.isDec()) {
    // If GETPROP/GETELEM is used as assignment target the object literal is
    // acting as a temporary we can't fold it here:
    //    "{a:x}.a += 1" is not "x += 1"
    return true;
  }
  return false;
}
 
Example 15
Source File: AliasExternals.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Logic for when a getprop can be replaced.
 * Can't alias a call to eval per ECMA-262 spec section 15.1.2.1
 * Can't be an assign -> no a.b = c;
 * Can't be inc or dec -> no a.b++; or a.b--;
 * Must be a GETPROP (NODE, A) where A is a reserved name
 * @param propNameNode Property name node
 * @param getPropNode GETPROP node
 * @param parent parent node
 * @return True if can be replaced
 */
private boolean canReplaceWithGetProp(Node propNameNode, Node getPropNode,
      Node parent) {
  boolean isCallTarget = (parent.isCall())
      && (parent.getFirstChild() == getPropNode);
  boolean isAssignTarget = NodeUtil.isAssignmentOp(parent)
      && (parent.getFirstChild() == getPropNode);
  boolean isIncOrDec = (parent.isInc()) ||
      (parent.isDec());
  return (propNameNode.isString()) && !isAssignTarget
      && (!isCallTarget || !"eval".equals(propNameNode.getString()))
      && !isIncOrDec
      && props.containsKey(propNameNode.getString());
}
 
Example 16
Source File: AliasExternals.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void visit(NodeTraversal t, Node n, Node parent) {
  if (n.isName()) {
    String name = n.getString();
    Scope.Var var = t.getScope().getVar(name);

    // It's ok for var to be null since it won't be in any scope if it's
    // an extern
    if (var != null && var.isLocal()) {
      return;
    }

    Symbol global = globals.get(name);
    if (global != null) {
      // If a variable is declared in both externs and normal source,
      // don't alias it.
      if (n.getParent().isVar() ||
          n.getParent().isFunction()) {
        globals.remove(name);
      }

      boolean isFirst = parent.getFirstChild() == n;
      // If a global is being assigned to or otherwise modified, then we
      // don't want to alias it.
      // Using "new" with this global is not a mutator, but it's also
      // something that we want to avoid when aliasing, since we may be
      // dealing with external objects (e.g. ActiveXObject in MSIE)
      if ((NodeUtil.isAssignmentOp(parent) && isFirst) ||
          (parent.isNew() && isFirst) ||
          parent.isInc() ||
          parent.isDec()) {
        global.recordMutator(t);
      } else {
        global.recordAccessor(t);
      }

      global.uses.add(n);
    }
  }
}
 
Example 17
Source File: Closure_121_InlineVariables_t.java    From coming with MIT License 5 votes vote down vote up
private boolean isLValue(Node n) {
  Node parent = n.getParent();
  return (parent.isInc()
      || parent.isDec()
      || (NodeUtil.isAssignmentOp(parent)
      && parent.getFirstChild() == n));
}
 
Example 18
Source File: Closure_30_MustBeReachingVariableDef_s.java    From coming with MIT License 4 votes vote down vote up
/**
 * @param n The node in question.
 * @param cfgNode The node to add
 * @param conditional true if the definition is not always executed.
 */
private void computeMustDef(
    Node n, Node cfgNode, MustDef output, boolean conditional) {
  switch (n.getType()) {

    case Token.BLOCK:
    case Token.FUNCTION:
      return;

    case Token.WHILE:
    case Token.DO:
    case Token.IF:
      computeMustDef(
          NodeUtil.getConditionExpression(n), cfgNode, output, conditional);
      return;

    case Token.FOR:
      if (!NodeUtil.isForIn(n)) {
        computeMustDef(
            NodeUtil.getConditionExpression(n), cfgNode, output, conditional);
      } else {
        // for(x in y) {...}
        Node lhs = n.getFirstChild();
        Node rhs = lhs.getNext();
        if (lhs.isVar()) {
          lhs = lhs.getLastChild(); // for(var x in y) {...}
        }
        if (lhs.isName()) {
          addToDefIfLocal(lhs.getString(), cfgNode, rhs, output);
        }
      }
      return;

    case Token.AND:
    case Token.OR:
      computeMustDef(n.getFirstChild(), cfgNode, output, conditional);
      computeMustDef(n.getLastChild(), cfgNode, output, true);
      return;

    case Token.HOOK:
      computeMustDef(n.getFirstChild(), cfgNode, output, conditional);
      computeMustDef(n.getFirstChild().getNext(), cfgNode, output, true);
      computeMustDef(n.getLastChild(), cfgNode, output, true);
      return;

    case Token.VAR:
      for (Node c = n.getFirstChild(); c != null; c = c.getNext()) {
        if (c.hasChildren()) {
          computeMustDef(c.getFirstChild(), cfgNode, output, conditional);
          addToDefIfLocal(c.getString(), conditional ? null : cfgNode,
              c.getFirstChild(), output);
        }
      }
      return;

    default:
      if (NodeUtil.isAssignmentOp(n)) {
        if (n.getFirstChild().isName()) {
          Node name = n.getFirstChild();
          computeMustDef(name.getNext(), cfgNode, output, conditional);
          addToDefIfLocal(name.getString(), conditional ? null : cfgNode,
            n.getLastChild(), output);
          return;
        } else if (NodeUtil.isGet(n.getFirstChild())) {
          // Treat all assignments to arguments as redefining the
          // parameters itself.
          Node obj = n.getFirstChild().getFirstChild();
          if (obj.isName() && "arguments".equals(obj.getString())) {
            // TODO(user): More accuracy can be introduced
            // ie: We know exactly what arguments[x] is if x is a constant
            // number.
            escapeParameters(output);
          }
        }
      }

      if (n.isName() && "arguments".equals(n.getString())) {
        escapeParameters(output);
      }

      // DEC and INC actually defines the variable.
      if (n.isDec() || n.isInc()) {
        Node target = n.getFirstChild();
        if (target.isName()) {
          addToDefIfLocal(target.getString(),
              conditional ? null : cfgNode, null, output);
          return;
        }
      }

      for (Node c = n.getFirstChild(); c != null; c = c.getNext()) {
        computeMustDef(c, cfgNode, output, conditional);
      }
  }
}
 
Example 19
Source File: MustBeReachingVariableDef.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @param n The node in question.
 * @param cfgNode The node to add
 * @param conditional true if the definition is not always executed.
 */
private void computeMustDef(
    Node n, Node cfgNode, MustDef output, boolean conditional) {
  switch (n.getType()) {

    case Token.BLOCK:
    case Token.FUNCTION:
      return;

    case Token.WHILE:
    case Token.DO:
    case Token.IF:
      computeMustDef(
          NodeUtil.getConditionExpression(n), cfgNode, output, conditional);
      return;

    case Token.FOR:
      if (!NodeUtil.isForIn(n)) {
        computeMustDef(
            NodeUtil.getConditionExpression(n), cfgNode, output, conditional);
      } else {
        // for(x in y) {...}
        Node lhs = n.getFirstChild();
        Node rhs = lhs.getNext();
        if (lhs.isVar()) {
          lhs = lhs.getLastChild(); // for(var x in y) {...}
        }
        if (lhs.isName()) {
          addToDefIfLocal(lhs.getString(), cfgNode, rhs, output);
        }
      }
      return;

    case Token.AND:
    case Token.OR:
      computeMustDef(n.getFirstChild(), cfgNode, output, conditional);
      computeMustDef(n.getLastChild(), cfgNode, output, true);
      return;

    case Token.HOOK:
      computeMustDef(n.getFirstChild(), cfgNode, output, conditional);
      computeMustDef(n.getFirstChild().getNext(), cfgNode, output, true);
      computeMustDef(n.getLastChild(), cfgNode, output, true);
      return;

    case Token.VAR:
      for (Node c = n.getFirstChild(); c != null; c = c.getNext()) {
        if (c.hasChildren()) {
          computeMustDef(c.getFirstChild(), cfgNode, output, conditional);
          addToDefIfLocal(c.getString(), conditional ? null : cfgNode,
              c.getFirstChild(), output);
        }
      }
      return;

    default:
      if (NodeUtil.isAssignmentOp(n)) {
        if (n.getFirstChild().isName()) {
          Node name = n.getFirstChild();
          computeMustDef(name.getNext(), cfgNode, output, conditional);
          addToDefIfLocal(name.getString(), conditional ? null : cfgNode,
            n.getLastChild(), output);
          return;
        } else if (NodeUtil.isGet(n.getFirstChild())) {
          // Treat all assignments to arguments as redefining the
          // parameters itself.
          Node obj = n.getFirstChild().getFirstChild();
          if (obj.isName() && "arguments".equals(obj.getString())) {
            // TODO(user): More accuracy can be introduced
            // i.e. We know exactly what arguments[x] is if x is a constant
            // number.
            escapeParameters(output);
          }
        }
      }

      if (n.isName() && "arguments".equals(n.getString())) {
        escapeParameters(output);
      }

      // DEC and INC actually defines the variable.
      if (n.isDec() || n.isInc()) {
        Node target = n.getFirstChild();
        if (target.isName()) {
          addToDefIfLocal(target.getString(),
              conditional ? null : cfgNode, null, output);
          return;
        }
      }

      for (Node c = n.getFirstChild(); c != null; c = c.getNext()) {
        computeMustDef(c, cfgNode, output, conditional);
      }
  }
}
 
Example 20
Source File: Closure_30_MustBeReachingVariableDef_t.java    From coming with MIT License 4 votes vote down vote up
/**
 * @param n The node in question.
 * @param cfgNode The node to add
 * @param conditional true if the definition is not always executed.
 */
private void computeMustDef(
    Node n, Node cfgNode, MustDef output, boolean conditional) {
  switch (n.getType()) {

    case Token.BLOCK:
    case Token.FUNCTION:
      return;

    case Token.WHILE:
    case Token.DO:
    case Token.IF:
      computeMustDef(
          NodeUtil.getConditionExpression(n), cfgNode, output, conditional);
      return;

    case Token.FOR:
      if (!NodeUtil.isForIn(n)) {
        computeMustDef(
            NodeUtil.getConditionExpression(n), cfgNode, output, conditional);
      } else {
        // for(x in y) {...}
        Node lhs = n.getFirstChild();
        Node rhs = lhs.getNext();
        if (lhs.isVar()) {
          lhs = lhs.getLastChild(); // for(var x in y) {...}
        }
        if (lhs.isName()) {
          addToDefIfLocal(lhs.getString(), cfgNode, rhs, output);
        }
      }
      return;

    case Token.AND:
    case Token.OR:
      computeMustDef(n.getFirstChild(), cfgNode, output, conditional);
      computeMustDef(n.getLastChild(), cfgNode, output, true);
      return;

    case Token.HOOK:
      computeMustDef(n.getFirstChild(), cfgNode, output, conditional);
      computeMustDef(n.getFirstChild().getNext(), cfgNode, output, true);
      computeMustDef(n.getLastChild(), cfgNode, output, true);
      return;

    case Token.VAR:
      for (Node c = n.getFirstChild(); c != null; c = c.getNext()) {
        if (c.hasChildren()) {
          computeMustDef(c.getFirstChild(), cfgNode, output, conditional);
          addToDefIfLocal(c.getString(), conditional ? null : cfgNode,
              c.getFirstChild(), output);
        }
      }
      return;

    default:
      if (NodeUtil.isAssignmentOp(n)) {
        if (n.getFirstChild().isName()) {
          Node name = n.getFirstChild();
          computeMustDef(name.getNext(), cfgNode, output, conditional);
          addToDefIfLocal(name.getString(), conditional ? null : cfgNode,
            n.getLastChild(), output);
          return;
        } else if (NodeUtil.isGet(n.getFirstChild())) {
          // Treat all assignments to arguments as redefining the
          // parameters itself.
          Node obj = n.getFirstChild().getFirstChild();
          if (obj.isName() && "arguments".equals(obj.getString())) {
            // TODO(user): More accuracy can be introduced
            // ie: We know exactly what arguments[x] is if x is a constant
            // number.
            escapeParameters(output);
          }
        }
      }

      if (n.isName() && "arguments".equals(n.getString())) {
        escapeParameters(output);
      }

      // DEC and INC actually defines the variable.
      if (n.isDec() || n.isInc()) {
        Node target = n.getFirstChild();
        if (target.isName()) {
          addToDefIfLocal(target.getString(),
              conditional ? null : cfgNode, null, output);
          return;
        }
      }

      for (Node c = n.getFirstChild(); c != null; c = c.getNext()) {
        computeMustDef(c, cfgNode, output, conditional);
      }
  }
}