Skip to content

Commit f44e08e

Browse files
Jake ChampionJakeChampion
authored andcommitted
formatting changes
1 parent cf1aa92 commit f44e08e

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

runtime/js-compute-runtime/builtins/headers.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,8 @@ bool Headers::append(JSContext *cx, unsigned argc, JS::Value *vp) {
618618
METHOD_HEADER(2)
619619

620620
if (Headers::is_immutable(self)) {
621-
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_HEADERS_IMMUTABLE, "Headers.append");
621+
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_HEADERS_IMMUTABLE,
622+
"Headers.append");
622623
return false;
623624
}
624625

@@ -662,7 +663,8 @@ bool Headers::delete_(JSContext *cx, unsigned argc, JS::Value *vp) {
662663
NORMALIZE_NAME(args[0], "Headers.delete")
663664

664665
if (Headers::is_immutable(self)) {
665-
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_HEADERS_IMMUTABLE, "Headers.delete");
666+
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_HEADERS_IMMUTABLE,
667+
"Headers.delete");
666668
return false;
667669
}
668670

@@ -782,7 +784,8 @@ const JSPropertySpec Headers::properties[] = {
782784
bool Headers::constructor(JSContext *cx, unsigned argc, JS::Value *vp) {
783785
CTOR_HEADER("Headers", 0);
784786
JS::RootedObject headersInstance(cx, JS_NewObjectForConstructor(cx, &class_, args));
785-
JS::RootedObject headers(cx, create(cx, headersInstance, Mode::Standalone, nullptr, args.get(0), false));
787+
JS::RootedObject headers(
788+
cx, create(cx, headersInstance, Mode::Standalone, nullptr, args.get(0), false));
786789
if (!headers) {
787790
return false;
788791
}

runtime/js-compute-runtime/builtins/request-response.cpp

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ bool RequestOrResponse::mark_body_used(JSContext *cx, JS::HandleObject obj) {
167167
// it's a disturbed ReadableStream. To improve error reporting, we clear
168168
// the current exception and throw a better one.
169169
JS_ClearPendingException(cx);
170-
JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr, JSMSG_READABLE_STREAM_LOCKED_OR_DISTRUBED);
170+
JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr,
171+
JSMSG_READABLE_STREAM_LOCKED_OR_DISTRUBED);
171172
return false;
172173
}
173174
}
@@ -258,7 +259,8 @@ bool RequestOrResponse::extract_body(JSContext *cx, JS::HandleObject self,
258259

259260
if (body_obj && JS::IsReadableStream(body_obj)) {
260261
if (RequestOrResponse::body_unusable(cx, body_obj)) {
261-
JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr, JSMSG_READABLE_STREAM_LOCKED_OR_DISTRUBED);
262+
JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr,
263+
JSMSG_READABLE_STREAM_LOCKED_OR_DISTRUBED);
262264
return false;
263265
}
264266

@@ -1367,7 +1369,8 @@ bool Request::clone(JSContext *cx, unsigned argc, JS::Value *vp) {
13671369
}
13681370
body_stream.set(&body1_val.toObject());
13691371
if (RequestOrResponse::body_unusable(cx, body_stream)) {
1370-
JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr, JSMSG_READABLE_STREAM_LOCKED_OR_DISTRUBED);
1372+
JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr,
1373+
JSMSG_READABLE_STREAM_LOCKED_OR_DISTRUBED);
13711374
return false;
13721375
}
13731376

@@ -2423,7 +2426,8 @@ bool Response::redirect(JSContext *cx, unsigned argc, JS::Value *vp) {
24232426
if (!builtins::Headers::maybe_add(cx, headers, "location", url_str.begin())) {
24242427
return false;
24252428
}
2426-
JS::SetReservedSlot(headers, static_cast<uint32_t>(builtins::Headers::Slots::Immutable), JS::TrueValue());
2429+
JS::SetReservedSlot(headers, static_cast<uint32_t>(builtins::Headers::Slots::Immutable),
2430+
JS::TrueValue());
24272431
JS::SetReservedSlot(response, static_cast<uint32_t>(Slots::Headers), JS::ObjectValue(*headers));
24282432
JS::SetReservedSlot(response, static_cast<uint32_t>(Slots::Redirected), JS::FalseValue());
24292433
// 8. Return responseObject.
@@ -2653,7 +2657,8 @@ bool Response::constructor(JSContext *cx, unsigned argc, JS::Value *vp) {
26532657
if (!statusText_val.isUndefined()) {
26542658
auto status_text_result = GlobalProperties::convertJSValueToByteString(cx, statusText_val);
26552659
if (status_text_result.isErr()) {
2656-
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_RESPONSE_CONSTRUCTOR_INVALID_STATUS_TEXT);
2660+
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
2661+
JSMSG_RESPONSE_CONSTRUCTOR_INVALID_STATUS_TEXT);
26572662
return false;
26582663
}
26592664
auto status_text = status_text_result.unwrap();
@@ -2674,7 +2679,8 @@ bool Response::constructor(JSContext *cx, unsigned argc, JS::Value *vp) {
26742679
});
26752680

26762681
if (it != status_text.end()) {
2677-
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_RESPONSE_CONSTRUCTOR_INVALID_STATUS_TEXT);
2682+
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
2683+
JSMSG_RESPONSE_CONSTRUCTOR_INVALID_STATUS_TEXT);
26782684
return false;
26792685
}
26802686
statusText = JS_NewStringCopyZ(cx, status_text.c_str());
@@ -2689,7 +2695,8 @@ bool Response::constructor(JSContext *cx, unsigned argc, JS::Value *vp) {
26892695
// 1. If `init`["status"] is not in the range 200 to 599, inclusive, then
26902696
// `throw` a ``RangeError``.
26912697
if (status < 200 || status > 599) {
2692-
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_RESPONSE_CONSTRUCTOR_INVALID_STATUS, status);
2698+
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
2699+
JSMSG_RESPONSE_CONSTRUCTOR_INVALID_STATUS, status);
26932700
return false;
26942701
}
26952702

@@ -2775,7 +2782,8 @@ bool Response::constructor(JSContext *cx, unsigned argc, JS::Value *vp) {
27752782
// 1. If `init`["status"] is a `null body status`, then `throw` a
27762783
// ``TypeError``.
27772784
if (status == 204 || status == 205 || status == 304) {
2778-
JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr, JSMSG_RESPONSE_CONSTRUCTOR_BODY_WITH_NULL_BODY_STATUS);
2785+
JS_ReportErrorNumberLatin1(cx, GetErrorMessage, nullptr,
2786+
JSMSG_RESPONSE_CONSTRUCTOR_BODY_WITH_NULL_BODY_STATUS);
27792787
return false;
27802788
}
27812789

0 commit comments

Comments
 (0)