code: public static boolean isNameDeclOrSimpleAssignLhs(Node n, Node parent) {
      return
          (parent.isAssign() && parent.getFirstChild() == n) || NodeUtil.isNameDeclaration(parent);
    }
docs: Determines whether this node is strictly on the left hand side of an assign or var
  initialization. Notably, this does not include all L-values, only statements where the node is
  used only as an L-value.
  
  @param n The node
  @param parent Parent of the node
  @return True if n is the left hand of an assign