code: public final S getClosestHoistScope() {
      S current = thisScope();
      while (current != null) {
        if (current.isHoistScope()) {
          return current;
        }
        current = current.getParent();
      }
      return null;
    }
docs: If a var were declared in this scope, return the scope it would be hoisted to.
  
  <p>For function scopes, we return back the scope itself, since even though there is no way to
  declare a var inside function parameters, it would make even less sense to say that such
  declarations would be "hoisted" somewhere else.