static bool ensure_all_header_values_from_handle(JSContext *cx, HandleObject self,
                                                 HandleObject backing_map) {
  if (!lazy_values(self))
    return true;

  RootedValue iterable(cx);
  if (!JS::MapKeys(cx, backing_map, &iterable))
    return false;

  JS::ForOfIterator it(cx);
  if (!it.init(iterable))
    return false;

  RootedValue name(cx);
  RootedValue v(cx);
  while (true) {
    bool done;
    if (!it.next(&name, &done))
      return false;

    if (done)
      break;

    if (!ensure_value_for_header(cx, self, name, &v))
      return false;
  }

  JS::SetReservedSlot(self, Slots::HasLazyValues, JS::BooleanValue(false));

  return true;
}
static bool ensure_all_header_values_from_handle(JSContext *cx, HandleObject self,
                                                 HandleObject backing_map) {
  if (!lazy_values(self))
    return true;

  RootedValue iterable(cx);
  if (!JS::MapKeys(cx, backing_map, &iterable))
    return false;

  JS::ForOfIterator it(cx);
  if (!it.init(iterable))
    return false;

  RootedValue name(cx);
  RootedValue v(cx);
  while (true) {
    bool done;
    if (!it.next(&name, &done))
      return false;

    if (done)
      break;

    if (!ensure_value_for_header(cx, self, name, &v))
      return false;
  }

  JS::SetReservedSlot(self, Slots::HasLazyValues, JS::BooleanValue(false));

  return true;
}