Skip to content

Commit

Permalink
run make format on codebase once more
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Champion authored and JakeChampion committed Jan 11, 2024
1 parent e9310e2 commit 7999143
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
28 changes: 12 additions & 16 deletions runtime/js-compute-runtime/builtins/request-response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1308,15 +1308,14 @@ bool Request::setManualFramingHeaders(JSContext *cx, unsigned argc, JS::Value *v
METHOD_HEADER(1)

bool manualFramingHeaders = JS::ToBoolean(args.get(0));
JS::SetReservedSlot(self, static_cast<uint32_t>(Slots::ManualFramingHeaders), JS::BooleanValue(manualFramingHeaders));
JS::SetReservedSlot(self, static_cast<uint32_t>(Slots::ManualFramingHeaders),
JS::BooleanValue(manualFramingHeaders));
auto handle = request_handle(self);
host_api::Result<host_api::Void> res;
if (manualFramingHeaders) {
res =
handle.set_framing_headers_mode(host_api::FramingHeadersMode::ManuallyFromHeaders);
res = handle.set_framing_headers_mode(host_api::FramingHeadersMode::ManuallyFromHeaders);
} else {
res =
handle.set_framing_headers_mode(host_api::FramingHeadersMode::Automatic);
res = handle.set_framing_headers_mode(host_api::FramingHeadersMode::Automatic);
}
if (auto *err = res.to_err()) {
HANDLE_ERROR(cx, *err);
Expand Down Expand Up @@ -1349,10 +1348,8 @@ bool Request::clone(JSContext *cx, unsigned argc, JS::Value *vp) {
JS::SetReservedSlot(requestInstance, static_cast<uint32_t>(Slots::IsDownstream),
JS::GetReservedSlot(self, static_cast<uint32_t>(Slots::IsDownstream)));
JS::RootedValue manualFramingHeaders(
cx,
JS::GetReservedSlot(self, static_cast<uint32_t>(Slots::ManualFramingHeaders)));
JS::SetReservedSlot(requestInstance,
static_cast<uint32_t>(Slots::ManualFramingHeaders),
cx, JS::GetReservedSlot(self, static_cast<uint32_t>(Slots::ManualFramingHeaders)));
JS::SetReservedSlot(requestInstance, static_cast<uint32_t>(Slots::ManualFramingHeaders),
manualFramingHeaders);
if (JS::ToBoolean(manualFramingHeaders)) {
auto res =
Expand Down Expand Up @@ -2035,8 +2032,8 @@ JSObject *Request::create(JSContext *cx, JS::HandleObject requestInstance, JS::H

if (!hasmanualFramingHeaders) {
if (input_request) {
manualFramingHeaders.set(JS::GetReservedSlot(
input_request, static_cast<uint32_t>(Slots::ManualFramingHeaders)));
manualFramingHeaders.set(
JS::GetReservedSlot(input_request, static_cast<uint32_t>(Slots::ManualFramingHeaders)));
} else {
manualFramingHeaders.setBoolean(false);
}
Expand Down Expand Up @@ -2678,7 +2675,8 @@ bool Response::setManualFramingHeaders(JSContext *cx, unsigned argc, JS::Value *
METHOD_HEADER(1)

bool manualFramingHeaders = JS::ToBoolean(args.get(0));
JS::SetReservedSlot(self, static_cast<uint32_t>(Slots::ManualFramingHeaders), JS::BooleanValue(manualFramingHeaders));
JS::SetReservedSlot(self, static_cast<uint32_t>(Slots::ManualFramingHeaders),
JS::BooleanValue(manualFramingHeaders));
auto handle = response_handle(self);
host_api::Result<host_api::Void> res;
if (manualFramingHeaders) {
Expand All @@ -2695,7 +2693,6 @@ bool Response::setManualFramingHeaders(JSContext *cx, unsigned argc, JS::Value *
return true;
}


const JSFunctionSpec Response::static_methods[] = {
JS_FN("redirect", redirect, 1, JSPROP_ENUMERATE),
JS_FN("json", json, 1, JSPROP_ENUMERATE),
Expand Down Expand Up @@ -2850,9 +2847,8 @@ bool Response::constructor(JSContext *cx, unsigned argc, JS::Value *vp) {

if (!hasmanualFramingHeaders) {
if (is_instance(init_val)) {
manualFramingHeaders.set(
JS::GetReservedSlot(init_val.toObjectOrNull(),
static_cast<uint32_t>(Slots::ManualFramingHeaders)));
manualFramingHeaders.set(JS::GetReservedSlot(
init_val.toObjectOrNull(), static_cast<uint32_t>(Slots::ManualFramingHeaders)));
} else {
manualFramingHeaders.setBoolean(false);
}
Expand Down
6 changes: 2 additions & 4 deletions runtime/js-compute-runtime/builtins/request-response.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ class Request final : public BuiltinImpl<Request> {
BodyUsed = static_cast<int>(RequestOrResponse::Slots::BodyUsed),
Headers = static_cast<int>(RequestOrResponse::Slots::Headers),
URL = static_cast<int>(RequestOrResponse::Slots::URL),
ManualFramingHeaders =
static_cast<int>(RequestOrResponse::Slots::ManualFramingHeaders),
ManualFramingHeaders = static_cast<int>(RequestOrResponse::Slots::ManualFramingHeaders),
Backend = static_cast<int>(RequestOrResponse::Slots::Count),
Method,
CacheOverride,
Expand Down Expand Up @@ -202,8 +201,7 @@ class Response final : public BuiltinImpl<Response> {
HasBody = static_cast<int>(RequestOrResponse::Slots::HasBody),
BodyUsed = static_cast<int>(RequestOrResponse::Slots::BodyUsed),
Headers = static_cast<int>(RequestOrResponse::Slots::Headers),
ManualFramingHeaders =
static_cast<int>(RequestOrResponse::Slots::ManualFramingHeaders),
ManualFramingHeaders = static_cast<int>(RequestOrResponse::Slots::ManualFramingHeaders),
IsUpstream = static_cast<int>(RequestOrResponse::Slots::Count),
Status,
StatusMessage,
Expand Down

0 comments on commit 7999143

Please sign in to comment.