code: public static Node getAssignedValue(Node n) {
      checkState(n.isName() || n.isGetProp(), n);
      Node parent = n.getParent();
      if (NodeUtil.isNameDeclaration(parent)) {
        return n.getFirstChild();
      } else if (parent.isAssign() && parent.getFirstChild() == n) {
        return n.getNext();
      } else {
        return null;
      }
    }
docs: For an assignment or variable declaration get the assigned value.
  @return The value node representing the new value.