code: private static boolean isLhsByDestructuringHelper(Node n) {
      Node parent = n.getParent();
      Node grandparent = n.getGrandparent();
  
      switch (parent.getToken()) {
        case ARRAY_PATTERN: // `b` in `var [b] = ...`
        case REST: // `b` in `var [...b] = ...`
          return true;
  
        case COMPUTED_PROP:
          if (n.isFirstChildOf(parent)) {
            return false;
          }
          // Fall through.
        case STRING_KEY:
          return grandparent.isObjectPattern(); // the "b" in "var {a: b} = ..."
  
        case DEFAULT_VALUE:
          if (n.isFirstChildOf(parent)) {
            // The first child of a DEFAULT_VALUE is a NAME node and a potential LHS.
            // The second child is the value, so never a LHS node.
            return isLhsByDestructuringHelper(parent);
          }
          return false;
  
        default:
          return false;
      }
    }
docs: Returns true if the given node is either an LHS node in a destructuring pattern or if one of
  its descendants contains an LHS node in a destructuring pattern. For example, in {@code var {a:
  b = 3}}}, this returns true given the NAME b or the DEFAULT_VALUE node containing b.