bool consume_body_handle_for_bodyAll(JSContext *cx, HandleObject self, HandleValue body_parser,
                                     CallArgs args) {
  BodyHandle body = body_handle(self);
  auto parse_body = (ParseBodyCB *)body_parser.toPrivate();

  size_t bytes_read;
  UniqueChars buf(read_from_handle_all<xqd_body_read, BodyHandle>(cx, body, &bytes_read, true));
  if (!buf) {
    RootedObject result_promise(cx);
    result_promise = &JS::GetReservedSlot(self, Slots::BodyAllPromise).toObject();
    JS::SetReservedSlot(self, Slots::BodyAllPromise, JS::UndefinedValue());
    return RejectPromiseWithPendingError(cx, result_promise);
  }

  return parse_body(cx, self, std::move(buf), bytes_read);
}
bool consume_body_handle_for_bodyAll(JSContext *cx, HandleObject self, HandleValue body_parser,
                                     CallArgs args) {
  BodyHandle body = body_handle(self);
  auto parse_body = (ParseBodyCB *)body_parser.toPrivate();

  size_t bytes_read;
  UniqueChars buf(read_from_handle_all<xqd_body_read, BodyHandle>(cx, body, &bytes_read, true));
  if (!buf) {
    RootedObject result_promise(cx);
    result_promise = &JS::GetReservedSlot(self, Slots::BodyAllPromise).toObject();
    JS::SetReservedSlot(self, Slots::BodyAllPromise, JS::UndefinedValue());
    return RejectPromiseWithPendingError(cx, result_promise);
  }

  return parse_body(cx, self, std::move(buf), bytes_read);
}