Bug 1488698 - Always use braces for if/for/while statements in js/src/builtin, part 3. r=evilpie
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 06 Sep 2018 10:17:41 +0200
changeset 435713 506e668e28645f38b226ea203aed38b5b5f0b0e5
parent 435712 422abc78931ce85a2950b6b2e554981f5354d5c1
child 435714 3fa402809570cf52220fd946081de01d7d117174
push id34618
push userbtara@mozilla.com
push dateTue, 11 Sep 2018 22:13:11 +0000
treeherdermozilla-central@1169e8a4ca2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersevilpie
bugs1488698
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1488698 - Always use braces for if/for/while statements in js/src/builtin, part 3. r=evilpie
js/src/builtin/Stream.cpp
js/src/builtin/String.cpp
js/src/builtin/Symbol.cpp
js/src/builtin/TestingFunctions.cpp
js/src/builtin/TypedObject.cpp
js/src/builtin/TypedObject.h
js/src/builtin/WeakMapObject-inl.h
js/src/builtin/WeakMapObject.cpp
js/src/builtin/WeakSetObject.cpp
--- a/js/src/builtin/Stream.cpp
+++ b/js/src/builtin/Stream.cpp
@@ -198,18 +198,19 @@ HasController(const ReadableStream* stre
 {
     return !stream->getFixedSlot(StreamSlot_Controller).isUndefined();
 }
 
 JS::ReadableStreamMode
 ReadableStream::mode() const
 {
     NativeObject* controller = ControllerFromStream(this);
-    if (controller->is<ReadableStreamDefaultController>())
+    if (controller->is<ReadableStreamDefaultController>()) {
         return JS::ReadableStreamMode::Default;
+    }
     return controller->as<ReadableByteStreamController>().hasExternalSource()
            ? JS::ReadableStreamMode::ExternalSource
            : JS::ReadableStreamMode::Byte;
 }
 
 inline static MOZ_MUST_USE ReadableStream*
 StreamFromReader(const NativeObject* reader)
 {
@@ -233,18 +234,19 @@ HasReader(const ReadableStream* stream)
 
 inline static MOZ_MUST_USE JSFunction*
 NewHandler(JSContext *cx, Native handler, HandleObject target)
 {
     RootedAtom funName(cx, cx->names().empty);
     RootedFunction handlerFun(cx, NewNativeFunction(cx, handler, 0, funName,
                                                     gc::AllocKind::FUNCTION_EXTENDED,
                                                     GenericObject));
-    if (!handlerFun)
+    if (!handlerFun) {
         return nullptr;
+    }
     handlerFun->setExtendedSlot(0, ObjectValue(*target));
     return handlerFun;
 }
 
 template<class T>
 inline static MOZ_MUST_USE T*
 TargetFromHandler(JSObject& handler)
 {
@@ -260,47 +262,51 @@ InvokeOrNoop(JSContext* cx, HandleValue 
 
 static MOZ_MUST_USE JSObject*
 PromiseInvokeOrNoop(JSContext* cx, HandleValue O, HandlePropertyName P, HandleValue arg);
 
 static MOZ_MUST_USE JSObject*
 PromiseRejectedWithPendingError(JSContext* cx) {
     // Not much we can do about uncatchable exceptions, just bail.
     RootedValue exn(cx);
-    if (!GetAndClearException(cx, &exn))
+    if (!GetAndClearException(cx, &exn)) {
         return nullptr;
+    }
     return PromiseObject::unforgeableReject(cx, exn);
 }
 
 static void
 ReportArgTypeError(JSContext* cx, const char* funName, const char* expectedType, HandleValue arg)
 {
     UniqueChars bytes = DecompileValueGenerator(cx, JSDVG_SEARCH_STACK, arg, nullptr);
-    if (!bytes)
+    if (!bytes) {
         return;
+    }
 
     JS_ReportErrorNumberUTF8(cx, GetErrorMessage, nullptr, JSMSG_NOT_EXPECTED_TYPE, funName,
                              expectedType, bytes.get());
 }
 
 static MOZ_MUST_USE bool
 RejectWithPendingError(JSContext* cx, Handle<PromiseObject*> promise) {
     // Not much we can do about uncatchable exceptions, just bail.
     RootedValue exn(cx);
-    if (!GetAndClearException(cx, &exn))
+    if (!GetAndClearException(cx, &exn)) {
         return false;
+    }
     return PromiseObject::reject(cx, promise, exn);
 }
 
 static MOZ_MUST_USE bool
 ReturnPromiseRejectedWithPendingError(JSContext* cx, const CallArgs& args)
 {
     JSObject* promise = PromiseRejectedWithPendingError(cx);
-    if (!promise)
+    if (!promise) {
         return false;
+    }
 
     args.rval().setObject(*promise);
     return true;
 }
 
 static MOZ_MUST_USE bool
 RejectNonGenericMethod(JSContext* cx, const CallArgs& args,
                        const char* className, const char* methodName)
@@ -310,18 +316,19 @@ RejectNonGenericMethod(JSContext* cx, co
 
     return ReturnPromiseRejectedWithPendingError(cx, args);
 }
 
 inline static MOZ_MUST_USE NativeObject*
 SetNewList(JSContext* cx, HandleNativeObject container, uint32_t slot)
 {
     NativeObject* list = NewList(cx);
-    if (!list)
+    if (!list) {
         return nullptr;
+    }
     container->setFixedSlot(slot, ObjectValue(*list));
     return list;
 }
 
 class ByteStreamChunk : public NativeObject
 {
   private:
     enum Slots {
@@ -345,18 +352,19 @@ class ByteStreamChunk : public NativeObj
     void SetByteLength(uint32_t length) {
         setFixedSlot(Slot_ByteLength, Int32Value(length));
     }
 
     static ByteStreamChunk* create(JSContext* cx, HandleObject buffer, uint32_t byteOffset,
                                    uint32_t byteLength)
    {
         Rooted<ByteStreamChunk*> chunk(cx, NewBuiltinClassInstance<ByteStreamChunk>(cx));
-        if (!chunk)
+        if (!chunk) {
             return nullptr;
+        }
 
         chunk->setFixedSlot(Slot_Buffer, ObjectValue(*buffer));
         chunk->setFixedSlot(Slot_ByteOffset, Int32Value(byteOffset));
         chunk->setFixedSlot(Slot_ByteLength, Int32Value(byteLength));
         return chunk;
    }
 };
 
@@ -394,18 +402,19 @@ class PullIntoDescriptor : public Native
     uint32_t readerType() const { return getFixedSlot(Slot_ReaderType).toInt32(); }
 
     static PullIntoDescriptor* create(JSContext* cx, HandleArrayBufferObject buffer,
                                       uint32_t byteOffset, uint32_t byteLength,
                                       uint32_t bytesFilled, uint32_t elementSize,
                                       HandleObject ctor, uint32_t readerType)
    {
         Rooted<PullIntoDescriptor*> descriptor(cx, NewBuiltinClassInstance<PullIntoDescriptor>(cx));
-        if (!descriptor)
+        if (!descriptor) {
             return nullptr;
+        }
 
         descriptor->setFixedSlot(Slot_buffer, ObjectValue(*buffer));
         descriptor->setFixedSlot(Slot_Ctor, ObjectOrNullValue(ctor));
         descriptor->setFixedSlot(Slot_ByteOffset, Int32Value(byteOffset));
         descriptor->setFixedSlot(Slot_ByteLength, Int32Value(byteLength));
         descriptor->setFixedSlot(Slot_BytesFilled, Int32Value(bytesFilled));
         descriptor->setFixedSlot(Slot_ElementSize, Int32Value(elementSize));
         descriptor->setFixedSlot(Slot_ReaderType, Int32Value(readerType));
@@ -431,18 +440,19 @@ class QueueEntry : public NativeObject
     static const Class class_;
 
     Value value() { return getFixedSlot(Slot_Value); }
     double size() { return getFixedSlot(Slot_Size).toNumber(); }
 
     static QueueEntry* create(JSContext* cx, HandleValue value, double size)
    {
         Rooted<QueueEntry*> entry(cx, NewBuiltinClassInstance<QueueEntry>(cx));
-        if (!entry)
+        if (!entry) {
             return nullptr;
+        }
 
         entry->setFixedSlot(Slot_Value, value);
         entry->setFixedSlot(Slot_Size, NumberValue(size));
 
         return entry;
    }
 };
 
@@ -543,22 +553,24 @@ class TeeState : public NativeObject
     void setBranch2(ReadableStreamDefaultController* controller) {
         MOZ_ASSERT(ControllerFlags(controller) & ControllerFlag_TeeBranch);
         MOZ_ASSERT(ControllerFlags(controller) & ControllerFlag_TeeBranch2);
         setFixedSlot(Slot_Branch2, ObjectValue(*controller));
     }
 
     static TeeState* create(JSContext* cx, Handle<ReadableStream*> stream) {
         Rooted<TeeState*> state(cx, NewBuiltinClassInstance<TeeState>(cx));
-        if (!state)
+        if (!state) {
             return nullptr;
+        }
 
         Rooted<PromiseObject*> promise(cx, PromiseObject::createSkippingExecutor(cx));
-        if (!promise)
+        if (!promise) {
             return nullptr;
+        }
 
         state->setFixedSlot(Slot_Flags, Int32Value(0));
         state->setFixedSlot(Slot_Promise, ObjectValue(*promise));
         state->setFixedSlot(Slot_Stream, ObjectValue(*stream));
 
         return state;
    }
 };
@@ -596,18 +608,19 @@ const Class cls::protoClass_ = { \
     &cls::classSpec_ \
 };
 
 // Streams spec, 3.2.3., steps 1-4.
 ReadableStream*
 ReadableStream::createStream(JSContext* cx, HandleObject proto /* = nullptr */)
 {
     Rooted<ReadableStream*> stream(cx, NewObjectWithClassProto<ReadableStream>(cx, proto));
-    if (!stream)
+    if (!stream) {
         return nullptr;
+    }
 
     // Step 1: Set this.[[state]] to "readable".
     // Step 2: Set this.[[reader]] and this.[[storedError]] to undefined (implicit).
     // Step 3: Set this.[[disturbed]] to false (implicit).
     // Step 4: Set this.[[readableStreamController]] to undefined (implicit).
     stream->setFixedSlot(StreamSlot_State, Int32Value(Readable));
 
     return stream;
@@ -621,29 +634,31 @@ CreateReadableStreamDefaultController(JS
 // Streams spec, 3.2.3., steps 1-4, 8.
 ReadableStream*
 ReadableStream::createDefaultStream(JSContext* cx, HandleValue underlyingSource,
                                     HandleValue size, HandleValue highWaterMark,
                                     HandleObject proto /* = nullptr */)
 {
     // Steps 1-4.
     Rooted<ReadableStream*> stream(cx, createStream(cx));
-    if (!stream)
+    if (!stream) {
         return nullptr;
+    }
 
     // Step 8.b: Set this.[[readableStreamController]] to
     //           ? Construct(ReadableStreamDefaultController,
     //                       « this, underlyingSource, size,
     //                         highWaterMark »).
     RootedObject controller(cx, CreateReadableStreamDefaultController(cx, stream,
                                                                       underlyingSource,
                                                                       size,
                                                                       highWaterMark));
-    if (!controller)
+    if (!controller) {
         return nullptr;
+    }
 
     stream->setFixedSlot(StreamSlot_Controller, ObjectValue(*controller));
 
     return stream;
 }
 
 static MOZ_MUST_USE ReadableByteStreamController*
 CreateReadableByteStreamController(JSContext* cx, Handle<ReadableStream*> stream,
@@ -652,49 +667,53 @@ CreateReadableByteStreamController(JSCon
 
 // Streams spec, 3.2.3., steps 1-4, 7.
 ReadableStream*
 ReadableStream::createByteStream(JSContext* cx, HandleValue underlyingSource,
                                  HandleValue highWaterMark, HandleObject proto /* = nullptr */)
 {
     // Steps 1-4.
     Rooted<ReadableStream*> stream(cx, createStream(cx, proto));
-    if (!stream)
+    if (!stream) {
         return nullptr;
+    }
 
     // Step 7.b: Set this.[[readableStreamController]] to
     //           ? Construct(ReadableByteStreamController,
     //                       « this, underlyingSource, highWaterMark »).
     RootedObject controller(cx, CreateReadableByteStreamController(cx, stream,
                                                                    underlyingSource,
                                                                    highWaterMark));
-    if (!controller)
+    if (!controller) {
         return nullptr;
+    }
 
     stream->setFixedSlot(StreamSlot_Controller, ObjectValue(*controller));
 
     return stream;
 }
 
 static MOZ_MUST_USE ReadableByteStreamController*
 CreateReadableByteStreamController(JSContext* cx, Handle<ReadableStream*> stream,
                                    void* underlyingSource);
 
 ReadableStream*
 ReadableStream::createExternalSourceStream(JSContext* cx, void* underlyingSource,
                                            uint8_t flags, HandleObject proto /* = nullptr */)
 {
     Rooted<ReadableStream*> stream(cx, createStream(cx, proto));
-    if (!stream)
+    if (!stream) {
         return nullptr;
+    }
 
     RootedNativeObject controller(cx, CreateReadableByteStreamController(cx, stream,
                                                                          underlyingSource));
-    if (!controller)
+    if (!controller) {
         return nullptr;
+    }
 
     stream->setFixedSlot(StreamSlot_Controller, ObjectValue(*controller));
     AddControllerFlags(controller, flags << ControllerEmbeddingFlagsOffset);
 
     return stream;
 }
 
 // Streams spec, 3.2.3.
@@ -705,52 +724,60 @@ ReadableStream::constructor(JSContext* c
 
     RootedValue val(cx, args.get(0));
     RootedValue underlyingSource(cx, args.get(0));
     RootedValue options(cx, args.get(1));
 
     // Do argument handling first to keep the right order of error reporting.
     if (underlyingSource.isUndefined()) {
         RootedObject sourceObj(cx, NewBuiltinClassInstance<PlainObject>(cx));
-        if (!sourceObj)
+        if (!sourceObj) {
             return false;
+        }
         underlyingSource = ObjectValue(*sourceObj);
     }
     RootedValue size(cx);
     RootedValue highWaterMark(cx);
 
     if (!options.isUndefined()) {
-        if (!GetProperty(cx, options, cx->names().size, &size))
+        if (!GetProperty(cx, options, cx->names().size, &size)) {
             return false;
-
-        if (!GetProperty(cx, options, cx->names().highWaterMark, &highWaterMark))
+        }
+
+        if (!GetProperty(cx, options, cx->names().highWaterMark, &highWaterMark)) {
             return false;
-    }
-
-    if (!ThrowIfNotConstructing(cx, args, "ReadableStream"))
+        }
+    }
+
+    if (!ThrowIfNotConstructing(cx, args, "ReadableStream")) {
         return false;
+    }
 
     // Step 5: Let type be ? GetV(underlyingSource, "type").
     RootedValue typeVal(cx);
-    if (!GetProperty(cx, underlyingSource, cx->names().type, &typeVal))
+    if (!GetProperty(cx, underlyingSource, cx->names().type, &typeVal)) {
         return false;
+    }
 
     // Step 6: Let typeString be ? ToString(type).
     RootedString type(cx, ToString<CanGC>(cx, typeVal));
-    if (!type)
+    if (!type) {
         return false;
+    }
 
     int32_t notByteStream;
-    if (!CompareStrings(cx, type, cx->names().bytes, &notByteStream))
+    if (!CompareStrings(cx, type, cx->names().bytes, &notByteStream)) {
         return false;
+    }
 
     // Step 7.a & 8.a (reordered): If highWaterMark is undefined, let
     //                             highWaterMark be 1 (or 0 for byte streams).
-    if (highWaterMark.isUndefined())
+    if (highWaterMark.isUndefined()) {
         highWaterMark = Int32Value(notByteStream ? 1 : 0);
+    }
 
     Rooted<ReadableStream*> stream(cx);
 
     // Step 7: If typeString is "bytes",
     if (!notByteStream) {
         // Step 7.b: Set this.[[readableStreamController]] to
         //           ? Construct(ReadableByteStreamController,
         //                       « this, underlyingSource, highWaterMark »).
@@ -762,18 +789,19 @@ ReadableStream::constructor(JSContext* c
         //                       « this, underlyingSource, size, highWaterMark »).
         stream = createDefaultStream(cx, underlyingSource, size, highWaterMark);
     } else {
         // Step 9: Otherwise, throw a RangeError exception.
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_READABLESTREAM_UNDERLYINGSOURCE_TYPE_WRONG);
         return false;
     }
-    if (!stream)
+    if (!stream) {
         return false;
+    }
 
     args.rval().setObject(*stream);
     return true;
 }
 
 // Streams spec, 3.2.4.1. get locked
 static MOZ_MUST_USE bool
 ReadableStream_locked_impl(JSContext* cx, const CallArgs& args)
@@ -813,18 +841,19 @@ ReadableStream_cancel(JSContext* cx, uns
     if (stream->locked()) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_READABLESTREAM_NOT_LOCKED, "cancel");
         return ReturnPromiseRejectedWithPendingError(cx, args);
     }
 
     // Step 3: Return ! ReadableStreamCancel(this, reason).
     RootedObject cancelPromise(cx, ReadableStream::cancel(cx, stream, args.get(0)));
-    if (!cancelPromise)
+    if (!cancelPromise) {
         return false;
+    }
     args.rval().setObject(*cancelPromise);
     return true;
 }
 
 static MOZ_MUST_USE ReadableStreamDefaultReader*
 CreateReadableStreamDefaultReader(JSContext* cx, Handle<ReadableStream*> stream);
 
 static MOZ_MUST_USE ReadableStreamBYOBReader*
@@ -837,45 +866,49 @@ ReadableStream_getReader_impl(JSContext*
     Rooted<ReadableStream*> stream(cx, &args.thisv().toObject().as<ReadableStream>());
     RootedObject reader(cx);
 
     // Step 2: If mode is undefined, return
     //         ? AcquireReadableStreamDefaultReader(this).
     RootedValue modeVal(cx);
     HandleValue optionsVal = args.get(0);
     if (!optionsVal.isUndefined()) {
-        if (!GetProperty(cx, optionsVal, cx->names().mode, &modeVal))
+        if (!GetProperty(cx, optionsVal, cx->names().mode, &modeVal)) {
             return false;
+        }
     }
 
     if (modeVal.isUndefined()) {
         reader = CreateReadableStreamDefaultReader(cx, stream);
     } else {
         // Step 3: Set mode to ? ToString(mode) (implicit).
         RootedString mode(cx, ToString<CanGC>(cx, modeVal));
-        if (!mode)
+        if (!mode) {
             return false;
+        }
 
         // Step 4: If mode is "byob", return ? AcquireReadableStreamBYOBReader(this).
         int32_t notByob;
-        if (!CompareStrings(cx, mode, cx->names().byob, &notByob))
+        if (!CompareStrings(cx, mode, cx->names().byob, &notByob)) {
             return false;
+        }
         if (notByob) {
             JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                       JSMSG_READABLESTREAM_INVALID_READER_MODE);
             // Step 5: Throw a RangeError exception.
             return false;
 
         }
         reader = CreateReadableStreamBYOBReader(cx, stream);
     }
 
     // Reordered second part of steps 2 and 4.
-    if (!reader)
+    if (!reader) {
         return false;
+    }
     args.rval().setObject(*reader);
     return true;
 }
 
 static bool
 ReadableStream_getReader(JSContext* cx, unsigned argc, Value* vp)
 {
     // Step 1: If ! IsReadableStream(this) is false, throw a TypeError exception.
@@ -914,23 +947,25 @@ ReadableStreamTee(JSContext* cx, Handle<
 static MOZ_MUST_USE bool
 ReadableStream_tee_impl(JSContext* cx, const CallArgs& args)
 {
     Rooted<ReadableStream*> stream(cx, &args.thisv().toObject().as<ReadableStream>());
 
     // Step 2: Let branches be ? ReadableStreamTee(this, false).
     Rooted<ReadableStream*> branch1(cx);
     Rooted<ReadableStream*> branch2(cx);
-    if (!ReadableStreamTee(cx, stream, false, &branch1, &branch2))
+    if (!ReadableStreamTee(cx, stream, false, &branch1, &branch2)) {
         return false;
+    }
 
     // Step 3: Return ! CreateArrayFromList(branches).
     RootedNativeObject branches(cx, NewDenseFullyAllocatedArray(cx, 2));
-    if (!branches)
+    if (!branches) {
         return false;
+    }
     branches->setDenseInitializedLength(2);
     branches->initDenseElement(0, ObjectValue(*branch1));
     branches->initDenseElement(1, ObjectValue(*branch2));
 
     args.rval().setObject(*branches);
     return true;
 }
 
@@ -1005,52 +1040,57 @@ TeeReaderReadHandler(JSContext* cx, unsi
     Rooted<TeeState*> teeState(cx, TargetFromHandler<TeeState>(args.callee()));
     HandleValue resultVal = args.get(0);
 
     // Step a: Assert: Type(result) is Object.
     RootedObject result(cx, &resultVal.toObject());
 
     // Step b: Let value be ? Get(result, "value").
     RootedValue value(cx);
-    if (!GetPropertyPure(cx, result, NameToId(cx->names().value), value.address()))
+    if (!GetPropertyPure(cx, result, NameToId(cx->names().value), value.address())) {
         return false;
+    }
 
     // Step c: Let done be ? Get(result, "done").
     RootedValue doneVal(cx);
-    if (!GetPropertyPure(cx, result, NameToId(cx->names().done), doneVal.address()))
+    if (!GetPropertyPure(cx, result, NameToId(cx->names().done), doneVal.address())) {
         return false;
+    }
 
     // Step d: Assert: Type(done) is Boolean.
     bool done = doneVal.toBoolean();
 
     // Step e: If done is true and teeState.[[closedOrErrored]] is false,
     if (done && !teeState->closedOrErrored()) {
         // Step i: If teeState.[[canceled1]] is false,
         if (!teeState->canceled1()) {
             // Step 1: Perform ! ReadableStreamDefaultControllerClose(branch1).
             Rooted<ReadableStreamDefaultController*> branch1(cx, teeState->branch1());
-            if (!ReadableStreamDefaultControllerClose(cx, branch1))
+            if (!ReadableStreamDefaultControllerClose(cx, branch1)) {
                 return false;
+            }
         }
 
         // Step ii: If teeState.[[canceled2]] is false,
         if (!teeState->canceled2()) {
             // Step 1: Perform ! ReadableStreamDefaultControllerClose(branch1).
             Rooted<ReadableStreamDefaultController*> branch2(cx, teeState->branch2());
-            if (!ReadableStreamDefaultControllerClose(cx, branch2))
+            if (!ReadableStreamDefaultControllerClose(cx, branch2)) {
                 return false;
+            }
         }
 
         // Step iii: Set teeState.[[closedOrErrored]] to true.
         teeState->setClosedOrErrored();
     }
 
     // Step f: If teeState.[[closedOrErrored]] is true, return.
-    if (teeState->closedOrErrored())
+    if (teeState->closedOrErrored()) {
         return true;
+    }
 
     // Step g: Let value1 and value2 be value.
     RootedValue value1(cx, value);
     RootedValue value2(cx, value);
 
     // Step h: If teeState.[[canceled2]] is false and cloneForBranch2 is
     //         true, set value2 to
     //         ? StructuredDeserialize(StructuredSerialize(value2),
@@ -1058,26 +1098,28 @@ TeeReaderReadHandler(JSContext* cx, unsi
     // TODO: add StructuredClone() intrinsic.
     MOZ_ASSERT(!teeState->cloneForBranch2(), "tee(cloneForBranch2=true) should not be exposed");
 
     // Step i: If teeState.[[canceled1]] is false, perform
     //         ? ReadableStreamDefaultControllerEnqueue(branch1, value1).
     Rooted<ReadableStreamDefaultController*> controller(cx);
     if (!teeState->canceled1()) {
         controller = teeState->branch1();
-        if (!ReadableStreamDefaultControllerEnqueue(cx, controller, value1))
+        if (!ReadableStreamDefaultControllerEnqueue(cx, controller, value1)) {
             return false;
+        }
     }
 
     // Step j: If teeState.[[canceled2]] is false,
     //         perform ? ReadableStreamDefaultControllerEnqueue(branch2, value2).
     if (!teeState->canceled2()) {
         controller = teeState->branch2();
-        if (!ReadableStreamDefaultControllerEnqueue(cx, controller, value2))
+        if (!ReadableStreamDefaultControllerEnqueue(cx, controller, value2)) {
             return false;
+        }
     }
 
     args.rval().setUndefined();
     return true;
 }
 
 static MOZ_MUST_USE JSObject*
 ReadableStreamTee_Pull(JSContext* cx, Handle<TeeState*> teeState,
@@ -1088,22 +1130,24 @@ ReadableStreamTee_Pull(JSContext* cx, Ha
     //         cloneForBranch2 be F.[[cloneForBranch2]].
 
     // Step 2: Return the result of transforming
     //         ! ReadableStreamDefaultReaderRead(reader) by a fulfillment
     //         handler which takes the argument result and performs the
     //         following steps:
     Rooted<ReadableStreamDefaultReader*> reader(cx, teeState->reader());
     RootedObject readPromise(cx, ReadableStreamDefaultReader::read(cx, reader));
-    if (!readPromise)
+    if (!readPromise) {
         return nullptr;
+    }
 
     RootedObject onFulfilled(cx, NewHandler(cx, TeeReaderReadHandler, teeState));
-    if (!onFulfilled)
+    if (!onFulfilled) {
         return nullptr;
+    }
 
     return JS::CallOriginalPromiseThen(cx, readPromise, onFulfilled, nullptr);
 }
 
 static MOZ_MUST_USE JSObject*
 ReadableStreamTee_Cancel(JSContext* cx, Handle<TeeState*> teeState,
                          Handle<ReadableStreamDefaultController*> branch, HandleValue reason)
 {
@@ -1124,36 +1168,39 @@ ReadableStreamTee_Cancel(JSContext* cx, 
     }
 
     // Step 4: If teeState.[[canceled1]] is true,
     // Step 4: If teeState.[[canceled2]] is true,
     if (bothBranchesCanceled) {
         // Step a: Let compositeReason be
         //         ! CreateArrayFromList(« teeState.[[reason1]], teeState.[[reason2]] »).
         RootedNativeObject compositeReason(cx, NewDenseFullyAllocatedArray(cx, 2));
-        if (!compositeReason)
+        if (!compositeReason) {
             return nullptr;
+        }
 
         compositeReason->setDenseInitializedLength(2);
         compositeReason->initDenseElement(0, teeState->reason1());
         compositeReason->initDenseElement(1, teeState->reason2());
         RootedValue compositeReasonVal(cx, ObjectValue(*compositeReason));
 
         Rooted<PromiseObject*> promise(cx, teeState->promise());
 
         // Step b: Let cancelResult be ! ReadableStreamCancel(stream, compositeReason).
         RootedObject cancelResult(cx, ReadableStream::cancel(cx, stream, compositeReasonVal));
         if (!cancelResult) {
-            if (!RejectWithPendingError(cx, promise))
+            if (!RejectWithPendingError(cx, promise)) {
                 return nullptr;
+            }
         } else {
             // Step c: Resolve teeState.[[promise]] with cancelResult.
             RootedValue resultVal(cx, ObjectValue(*cancelResult));
-            if (!PromiseObject::resolve(cx, promise, resultVal))
+            if (!PromiseObject::resolve(cx, promise, resultVal)) {
                 return nullptr;
+            }
         }
     }
 
     // Step 5: Return teeState.[[promise]].
     return teeState->promise();
 }
 
 static MOZ_MUST_USE bool
@@ -1167,23 +1214,25 @@ TeeReaderClosedHandler(JSContext* cx, un
     CallArgs args = CallArgsFromVp(argc, vp);
     Rooted<TeeState*> teeState(cx, TargetFromHandler<TeeState>(args.callee()));
     HandleValue reason = args.get(0);
 
     // Step a: If teeState.[[closedOrErrored]] is false, then:
     if (!teeState->closedOrErrored()) {
         // Step a.i: Perform ! ReadableStreamDefaultControllerError(pull.[[branch1]], r).
         Rooted<ReadableStreamDefaultController*> branch1(cx, teeState->branch1());
-        if (!ReadableStreamControllerError(cx, branch1, reason))
+        if (!ReadableStreamControllerError(cx, branch1, reason)) {
             return false;
+        }
 
         // Step a.ii: Perform ! ReadableStreamDefaultControllerError(pull.[[branch2]], r).
         Rooted<ReadableStreamDefaultController*> branch2(cx, teeState->branch2());
-        if (!ReadableStreamControllerError(cx, branch2, reason))
+        if (!ReadableStreamControllerError(cx, branch2, reason)) {
             return false;
+        }
 
         // Step a.iii: Set teeState.[[closedOrErrored]] to true.
         teeState->setClosedOrErrored();
     }
 
     return true;
 }
 
@@ -1193,28 +1242,30 @@ ReadableStreamTee(JSContext* cx, Handle<
                   MutableHandle<ReadableStream*> branch1Stream,
                   MutableHandle<ReadableStream*> branch2Stream)
 {
     // Step 1: Assert: ! IsReadableStream(stream) is true (implicit).
     // Step 2: Assert: Type(cloneForBranch2) is Boolean (implicit).
 
     // Step 3: Let reader be ? AcquireReadableStreamDefaultReader(stream).
     Rooted<ReadableStreamDefaultReader*> reader(cx, CreateReadableStreamDefaultReader(cx, stream));
-    if (!reader)
+    if (!reader) {
         return false;
+    }
 
     // Step 4: Let teeState be Record {[[closedOrErrored]]: false,
     //                                 [[canceled1]]: false,
     //                                 [[canceled2]]: false,
     //                                 [[reason1]]: undefined,
     //                                 [[reason2]]: undefined,
     //                                 [[promise]]: a new promise}.
     Rooted<TeeState*> teeState(cx, TeeState::create(cx, stream));
-    if (!teeState)
+    if (!teeState) {
         return false;
+    }
 
     // Steps 5-10 omitted because our implementation works differently.
 
     // Step 5: Let pull be a new ReadableStreamTee pull function.
     // Step 6: Set pull.[[reader]] to reader, pull.[[teeState]] to teeState, and
     //         pull.[[cloneForBranch2]] to cloneForBranch2.
     // Step 7: Let cancel1 be a new ReadableStreamTee branch 1 cancel function.
     // Step 8: Set cancel1.[[stream]] to stream and cancel1.[[teeState]] to
@@ -1229,52 +1280,56 @@ ReadableStreamTee(JSContext* cx, Handle<
     // Step 13: Perform ! CreateDataProperty(underlyingSource1, "cancel", cancel1).
 
     // Step 14: Let branch1Stream be ! Construct(ReadableStream, underlyingSource1).
     RootedValue hwmValue(cx, NumberValue(1));
     RootedValue underlyingSource(cx, ObjectValue(*teeState));
     branch1Stream.set(ReadableStream::createDefaultStream(cx, underlyingSource,
                                                           UndefinedHandleValue,
                                                           hwmValue));
-    if (!branch1Stream)
+    if (!branch1Stream) {
         return false;
+    }
 
     Rooted<ReadableStreamDefaultController*> branch1(cx);
     branch1 = &ControllerFromStream(branch1Stream)->as<ReadableStreamDefaultController>();
     AddControllerFlags(branch1, ControllerFlag_TeeBranch | ControllerFlag_TeeBranch1);
     teeState->setBranch1(branch1);
 
     // Step 15: Let underlyingSource2 be ! ObjectCreate(%ObjectPrototype%).
     // Step 16: Perform ! CreateDataProperty(underlyingSource2, "pull", pull).
     // Step 17: Perform ! CreateDataProperty(underlyingSource2, "cancel", cancel2).
 
     // Step 18: Let branch2Stream be ! Construct(ReadableStream, underlyingSource2).
     branch2Stream.set(ReadableStream::createDefaultStream(cx, underlyingSource,
                                                           UndefinedHandleValue,
                                                           hwmValue));
-    if (!branch2Stream)
+    if (!branch2Stream) {
         return false;
+    }
 
     Rooted<ReadableStreamDefaultController*> branch2(cx);
     branch2 = &ControllerFromStream(branch2Stream)->as<ReadableStreamDefaultController>();
     AddControllerFlags(branch2, ControllerFlag_TeeBranch | ControllerFlag_TeeBranch2);
     teeState->setBranch2(branch2);
 
     // Step 19: Set pull.[[branch1]] to branch1Stream.[[readableStreamController]].
     // Step 20: Set pull.[[branch2]] to branch2Stream.[[readableStreamController]].
 
     // Step 21: Upon rejection of reader.[[closedPromise]] with reason r,
     RootedObject closedPromise(cx, &reader->getFixedSlot(ReaderSlot_ClosedPromise).toObject());
 
     RootedObject onRejected(cx, NewHandler(cx, TeeReaderClosedHandler, teeState));
-    if (!onRejected)
+    if (!onRejected) {
         return false;
-
-    if (!JS::AddPromiseReactions(cx, closedPromise, nullptr, onRejected))
+    }
+
+    if (!JS::AddPromiseReactions(cx, closedPromise, nullptr, onRejected)) {
         return false;
+    }
 
     // Step 22: Return « branch1, branch2 ».
     return true;
 }
 
 // Streams spec, 3.4.1. ReadableStreamAddReadIntoRequest ( stream )
 static MOZ_MUST_USE PromiseObject*
 ReadableStreamAddReadIntoRequest(JSContext* cx, Handle<ReadableStream*> stream)
@@ -1283,27 +1338,29 @@ ReadableStreamAddReadIntoRequest(JSConte
     RootedValue val(cx, stream->getFixedSlot(StreamSlot_Reader));
     RootedNativeObject reader(cx, &val.toObject().as<ReadableStreamBYOBReader>());
 
     // Step 2: MOZ_ASSERT: stream.[[state]] is "readable" or "closed".
     MOZ_ASSERT(stream->readable() || stream->closed());
 
     // Step 3: Let promise be a new promise.
     Rooted<PromiseObject*> promise(cx, PromiseObject::createSkippingExecutor(cx));
-    if (!promise)
+    if (!promise) {
         return nullptr;
+    }
 
     // Step 4: Let readIntoRequest be Record {[[promise]]: promise}.
     // Step 5: Append readIntoRequest as the last element of stream.[[reader]].[[readIntoRequests]].
     val = reader->getFixedSlot(ReaderSlot_Requests);
     RootedNativeObject readIntoRequests(cx, &val.toObject().as<NativeObject>());
     // Since [[promise]] is the Record's only field, we store it directly.
     val = ObjectValue(*promise);
-    if (!AppendToList(cx, readIntoRequests, val))
+    if (!AppendToList(cx, readIntoRequests, val)) {
         return nullptr;
+    }
 
     // Step 6: Return promise.
     return promise;
 }
 
 // Streams spec, 3.4.2. ReadableStreamAddReadRequest ( stream )
 static MOZ_MUST_USE PromiseObject*
 ReadableStreamAddReadRequest(JSContext* cx, Handle<ReadableStream*> stream)
@@ -1313,28 +1370,30 @@ ReadableStreamAddReadRequest(JSContext* 
   // Step 1: Assert: ! IsReadableStreamDefaultReader(stream.[[reader]]) is true.
   RootedNativeObject reader(cx, ReaderFromStream(stream));
 
   // Step 2: Assert: stream.[[state]] is "readable".
   MOZ_ASSERT(stream->readable());
 
   // Step 3: Let promise be a new promise.
   Rooted<PromiseObject*> promise(cx, PromiseObject::createSkippingExecutor(cx));
-  if (!promise)
+  if (!promise) {
       return nullptr;
+  }
 
   // Step 4: Let readRequest be Record {[[promise]]: promise}.
   // Step 5: Append readRequest as the last element of stream.[[reader]].[[readRequests]].
   RootedValue val(cx, reader->getFixedSlot(ReaderSlot_Requests));
   RootedNativeObject readRequests(cx, &val.toObject().as<NativeObject>());
 
   // Since [[promise]] is the Record's only field, we store it directly.
   val = ObjectValue(*promise);
-  if (!AppendToList(cx, readRequests, val))
+  if (!AppendToList(cx, readRequests, val)) {
       return nullptr;
+  }
 
   // Step 6: Return promise.
   return promise;
 }
 
 static MOZ_MUST_USE JSObject*
 ReadableStreamControllerCancelSteps(JSContext* cx,
                                     HandleNativeObject controller, HandleValue reason);
@@ -1356,44 +1415,48 @@ ReadableStreamCloseInternal(JSContext* c
 ReadableStream::cancel(JSContext* cx, Handle<ReadableStream*> stream, HandleValue reason)
 {
     // Step 1: Set stream.[[disturbed]] to true.
     uint32_t state = StreamState(stream) | ReadableStream::Disturbed;
     SetStreamState(stream, state);
 
     // Step 2: If stream.[[state]] is "closed", return a new promise resolved
     //         with undefined.
-    if (stream->closed())
+    if (stream->closed()) {
         return PromiseObject::unforgeableResolve(cx, UndefinedHandleValue);
+    }
 
     // Step 3: If stream.[[state]] is "errored", return a new promise rejected
     //         with stream.[[storedError]].
     if (stream->errored()) {
         RootedValue storedError(cx, stream->getFixedSlot(StreamSlot_StoredError));
         return PromiseObject::unforgeableReject(cx, storedError);
     }
 
     // Step 4: Perform ! ReadableStreamClose(stream).
-    if (!ReadableStreamCloseInternal(cx, stream))
+    if (!ReadableStreamCloseInternal(cx, stream)) {
         return nullptr;
+    }
 
     // Step 5: Let sourceCancelPromise be
     //         ! stream.[[readableStreamController]].[[CancelSteps]](reason).
     RootedNativeObject controller(cx, ControllerFromStream(stream));
     RootedObject sourceCancelPromise(cx);
     sourceCancelPromise = ReadableStreamControllerCancelSteps(cx, controller, reason);
-    if (!sourceCancelPromise)
+    if (!sourceCancelPromise) {
         return nullptr;
+    }
 
     // Step 6: Return the result of transforming sourceCancelPromise by a
     //         fulfillment handler that returns undefined.
     RootedAtom funName(cx, cx->names().empty);
     RootedFunction returnUndefined(cx, NewNativeFunction(cx, ReturnUndefined, 0, funName));
-    if (!returnUndefined)
+    if (!returnUndefined) {
         return nullptr;
+    }
     return JS::CallOriginalPromiseThen(cx, sourceCancelPromise, returnUndefined, nullptr);
 }
 
 // Streams spec, 3.4.4. ReadableStreamClose ( stream )
 MOZ_MUST_USE bool
 ReadableStreamCloseInternal(JSContext* cx, Handle<ReadableStream*> stream)
 {
   // Step 1: Assert: stream.[[state]] is "readable".
@@ -1402,18 +1465,19 @@ ReadableStreamCloseInternal(JSContext* c
   uint32_t state = StreamState(stream);
   // Step 2: Set stream.[[state]] to "closed".
   SetStreamState(stream, (state & ReadableStream::Disturbed) | ReadableStream::Closed);
 
   // Step 3: Let reader be stream.[[reader]].
   RootedValue val(cx, stream->getFixedSlot(StreamSlot_Reader));
 
   // Step 4: If reader is undefined, return.
-  if (val.isUndefined())
+  if (val.isUndefined()) {
       return true;
+  }
 
   // Step 5: If ! IsReadableStreamDefaultReader(reader) is true,
   RootedNativeObject reader(cx, &val.toObject().as<NativeObject>());
   if (reader->is<ReadableStreamDefaultReader>()) {
       // Step a: Repeat for each readRequest that is an element of
       //         reader.[[readRequests]],
       val = reader->getFixedSlot(ReaderSlot_Requests);
       if (!val.isUndefined()) {
@@ -1422,33 +1486,36 @@ ReadableStreamCloseInternal(JSContext* c
           RootedObject readRequest(cx);
           RootedObject resultObj(cx);
           RootedValue resultVal(cx);
           for (uint32_t i = 0; i < len; i++) {
               // Step i: Resolve readRequest.[[promise]] with
               //         ! CreateIterResultObject(undefined, true).
               readRequest = &readRequests->getDenseElement(i).toObject();
               resultObj = CreateIterResultObject(cx, UndefinedHandleValue, true);
-              if (!resultObj)
+              if (!resultObj) {
                   return false;
+              }
               resultVal = ObjectValue(*resultObj);
-              if (!ResolvePromise(cx, readRequest, resultVal))
+              if (!ResolvePromise(cx, readRequest, resultVal)) {
                   return false;
+              }
           }
 
           // Step b: Set reader.[[readRequests]] to an empty List.
           reader->setFixedSlot(ReaderSlot_Requests, UndefinedValue());
       }
   }
 
   // Step 6: Resolve reader.[[closedPromise]] with undefined.
   // Step 7: Return (implicit).
   RootedObject closedPromise(cx, &reader->getFixedSlot(ReaderSlot_ClosedPromise).toObject());
-  if (!ResolvePromise(cx, closedPromise, UndefinedHandleValue))
+  if (!ResolvePromise(cx, closedPromise, UndefinedHandleValue)) {
       return false;
+  }
 
   if (stream->mode() == JS::ReadableStreamMode::ExternalSource &&
       cx->runtime()->readableStreamClosedCallback)
   {
       NativeObject* controller = ControllerFromStream(stream);
       void* source = controller->getFixedSlot(ControllerSlot_UnderlyingSource).toPrivate();
       cx->runtime()->readableStreamClosedCallback(cx, stream, source, stream->embeddingFlags());
   }
@@ -1471,44 +1538,48 @@ ReadableStreamErrorInternal(JSContext* c
 
     // Step 4: Set stream.[[storedError]] to e.
     stream->setFixedSlot(StreamSlot_StoredError, e);
 
     // Step 5: Let reader be stream.[[reader]].
     RootedValue val(cx, stream->getFixedSlot(StreamSlot_Reader));
 
     // Step 6: If reader is undefined, return.
-    if (val.isUndefined())
+    if (val.isUndefined()) {
         return true;
+    }
     RootedNativeObject reader(cx, &val.toObject().as<NativeObject>());
 
     // Steps 7,8: (Identical in our implementation.)
     // Step a: Repeat for each readRequest that is an element of
     //         reader.[[readRequests]],
     val = reader->getFixedSlot(ReaderSlot_Requests);
     RootedNativeObject readRequests(cx, &val.toObject().as<NativeObject>());
     Rooted<PromiseObject*> readRequest(cx);
     uint32_t len = readRequests->getDenseInitializedLength();
     for (uint32_t i = 0; i < len; i++) {
         // Step i: Reject readRequest.[[promise]] with e.
         val = readRequests->getDenseElement(i);
         readRequest = &val.toObject().as<PromiseObject>();
-        if (!PromiseObject::reject(cx, readRequest, e))
+        if (!PromiseObject::reject(cx, readRequest, e)) {
             return false;
+        }
     }
 
     // Step b: Set reader.[[readRequests]] to a new empty List.
-    if (!SetNewList(cx, reader, ReaderSlot_Requests))
+    if (!SetNewList(cx, reader, ReaderSlot_Requests)) {
         return false;
+    }
 
     // Step 9: Reject reader.[[closedPromise]] with e.
     val = reader->getFixedSlot(ReaderSlot_ClosedPromise);
     Rooted<PromiseObject*> closedPromise(cx, &val.toObject().as<PromiseObject>());
-    if (!PromiseObject::reject(cx, closedPromise, e))
+    if (!PromiseObject::reject(cx, closedPromise, e)) {
         return false;
+    }
 
     if (stream->mode() == JS::ReadableStreamMode::ExternalSource &&
         cx->runtime()->readableStreamErroredCallback)
     {
         NativeObject* controller = ControllerFromStream(stream);
         void* source = controller->getFixedSlot(ControllerSlot_UnderlyingSource).toPrivate();
         cx->runtime()->readableStreamErroredCallback(cx, stream, source,
                                                      stream->embeddingFlags(), e);
@@ -1537,32 +1608,34 @@ ReadableStreamFulfillReadOrReadIntoReque
     RootedNativeObject readIntoRequests(cx, &val.toObject().as<NativeObject>());
     Rooted<PromiseObject*> readIntoRequest(cx);
     readIntoRequest = ShiftFromList<PromiseObject>(cx, readIntoRequests);
     MOZ_ASSERT(readIntoRequest);
 
     // Step 4: Resolve readIntoRequest.[[promise]] with
     //         ! CreateIterResultObject(chunk, done).
     RootedObject iterResult(cx, CreateIterResultObject(cx, chunk, done));
-    if (!iterResult)
+    if (!iterResult) {
         return false;
+    }
     val = ObjectValue(*iterResult);
     return PromiseObject::resolve(cx, readIntoRequest, val);
 }
 
 // Streams spec, 3.4.8. ReadableStreamGetNumReadIntoRequests ( stream )
 // Streams spec, 3.4.9. ReadableStreamGetNumReadRequests ( stream )
 // (Identical implementation.)
 static uint32_t
 ReadableStreamGetNumReadRequests(ReadableStream* stream)
 {
     // Step 1: Return the number of elements in
     //         stream.[[reader]].[[readRequests]].
-    if (!HasReader(stream))
+    if (!HasReader(stream)) {
         return 0;
+    }
     NativeObject* reader = ReaderFromStream(stream);
     Value readRequests = reader->getFixedSlot(ReaderSlot_Requests);
     return readRequests.toObject().as<NativeObject>().getDenseInitializedLength();
 }
 
 // Stream spec 3.4.10. ReadableStreamHasBYOBReader ( stream )
 static MOZ_MUST_USE bool
 ReadableStreamHasBYOBReader(ReadableStream* stream)
@@ -1594,74 +1667,80 @@ ReadableStreamReaderGenericInitialize(JS
 
 // Stream spec, 3.5.3. new ReadableStreamDefaultReader ( stream )
 // Steps 2-4.
 static MOZ_MUST_USE ReadableStreamDefaultReader*
 CreateReadableStreamDefaultReader(JSContext* cx, Handle<ReadableStream*> stream)
 {
     Rooted<ReadableStreamDefaultReader*> reader(cx);
     reader = NewBuiltinClassInstance<ReadableStreamDefaultReader>(cx);
-    if (!reader)
+    if (!reader) {
         return nullptr;
+    }
 
     // Step 2: If ! IsReadableStreamLocked(stream) is true, throw a TypeError
     //         exception.
     if (stream->locked()) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_READABLESTREAM_LOCKED);
         return nullptr;
     }
 
     // Step 3: Perform ! ReadableStreamReaderGenericInitialize(this, stream).
-    if (!ReadableStreamReaderGenericInitialize(cx, reader, stream))
+    if (!ReadableStreamReaderGenericInitialize(cx, reader, stream)) {
         return nullptr;
+    }
 
     // Step 4: Set this.[[readRequests]] to a new empty List.
-    if (!SetNewList(cx, reader, ReaderSlot_Requests))
+    if (!SetNewList(cx, reader, ReaderSlot_Requests)) {
         return nullptr;
+    }
 
     return reader;
 }
 
 // Stream spec, 3.5.3. new ReadableStreamDefaultReader ( stream )
 bool
 ReadableStreamDefaultReader::constructor(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
-    if (!ThrowIfNotConstructing(cx, args, "ReadableStreamDefaultReader"))
+    if (!ThrowIfNotConstructing(cx, args, "ReadableStreamDefaultReader")) {
         return false;
+    }
 
     // Step 1: If ! IsReadableStream(stream) is false, throw a TypeError exception.
     if (!Is<ReadableStream>(args.get(0))) {
         ReportArgTypeError(cx, "ReadableStreamDefaultReader", "ReadableStream",
                            args.get(0));
         return false;
     }
 
     Rooted<ReadableStream*> stream(cx, &args.get(0).toObject().as<ReadableStream>());
 
     RootedObject reader(cx, CreateReadableStreamDefaultReader(cx, stream));
-    if (!reader)
+    if (!reader) {
         return false;
+    }
 
     args.rval().setObject(*reader);
     return true;
 }
 
 // Streams spec, 3.5.4.1 get closed
 static MOZ_MUST_USE bool
 ReadableStreamDefaultReader_closed(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // Step 1: If ! IsReadableStreamDefaultReader(this) is false, return a promise
     //         rejected with a TypeError exception.
-    if (!Is<ReadableStreamDefaultReader>(args.thisv()))
+    if (!Is<ReadableStreamDefaultReader>(args.thisv())) {
         return RejectNonGenericMethod(cx, args, "ReadableStreamDefaultReader", "get closed");
+    }
 
     // Step 2: Return this.[[closedPromise]].
     NativeObject* reader = &args.thisv().toObject().as<NativeObject>();
     args.rval().set(reader->getFixedSlot(ReaderSlot_ClosedPromise));
     return true;
 }
 
 static MOZ_MUST_USE JSObject*
@@ -1670,61 +1749,65 @@ ReadableStreamReaderGenericCancel(JSCont
 // Streams spec, 3.5.4.2. cancel ( reason )
 static MOZ_MUST_USE bool
 ReadableStreamDefaultReader_cancel(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // Step 1: If ! IsReadableStreamDefaultReader(this) is false, return a promise
     //         rejected with a TypeError exception.
-    if (!Is<ReadableStreamDefaultReader>(args.thisv()))
+    if (!Is<ReadableStreamDefaultReader>(args.thisv())) {
         return RejectNonGenericMethod(cx, args, "ReadableStreamDefaultReader", "cancel");
+    }
 
     // Step 2: If this.[[ownerReadableStream]] is undefined, return a promise
     //         rejected with a TypeError exception.
     RootedNativeObject reader(cx, &args.thisv().toObject().as<NativeObject>());
     if (!ReaderHasStream(reader)) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_READABLESTREAMREADER_NOT_OWNED, "cancel");
         return ReturnPromiseRejectedWithPendingError(cx, args);
     }
 
     // Step 3: Return ! ReadableStreamReaderGenericCancel(this, reason).
     JSObject* cancelPromise = ReadableStreamReaderGenericCancel(cx, reader, args.get(0));
-    if (!cancelPromise)
+    if (!cancelPromise) {
         return false;
+    }
     args.rval().setObject(*cancelPromise);
     return true;
 }
 
 // Streams spec, 3.5.4.3 read ( )
 static MOZ_MUST_USE bool
 ReadableStreamDefaultReader_read(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // Step 1: If ! IsReadableStreamDefaultReader(this) is false, return a promise
     //         rejected with a TypeError exception.
-    if (!Is<ReadableStreamDefaultReader>(args.thisv()))
+    if (!Is<ReadableStreamDefaultReader>(args.thisv())) {
         return RejectNonGenericMethod(cx, args, "ReadableStreamDefaultReader", "read");
+    }
 
     // Step 2: If this.[[ownerReadableStream]] is undefined, return a promise
     //         rejected with a TypeError exception.
     Rooted<ReadableStreamDefaultReader*> reader(cx);
     reader = &args.thisv().toObject().as<ReadableStreamDefaultReader>();
     if (!ReaderHasStream(reader)) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_READABLESTREAMREADER_NOT_OWNED, "read");
         return ReturnPromiseRejectedWithPendingError(cx, args);
     }
 
     // Step 3: Return ! ReadableStreamDefaultReaderRead(this).
     JSObject* readPromise = ReadableStreamDefaultReader::read(cx, reader);
-    if (!readPromise)
+    if (!readPromise) {
         return false;
+    }
     args.rval().setObject(*readPromise);
     return true;
 }
 
 static MOZ_MUST_USE bool
 ReadableStreamReaderGenericRelease(JSContext* cx, HandleNativeObject reader);
 
 // Streams spec, 3.5.4.4. releaseLock ( )
@@ -1801,110 +1884,119 @@ CreateReadableStreamBYOBReader(JSContext
     //         exception.
     if (stream->locked()) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_READABLESTREAM_LOCKED);
         return nullptr;
     }
 
     Rooted<ReadableStreamBYOBReader*> reader(cx);
     reader = NewBuiltinClassInstance<ReadableStreamBYOBReader>(cx);
-    if (!reader)
+    if (!reader) {
         return nullptr;
+    }
 
     // Step 4: Perform ! ReadableStreamReaderGenericInitialize(this, stream).
-    if (!ReadableStreamReaderGenericInitialize(cx, reader, stream))
+    if (!ReadableStreamReaderGenericInitialize(cx, reader, stream)) {
         return nullptr;
+    }
 
     // Step 5: Set this.[[readIntoRequests]] to a new empty List.
-    if (!SetNewList(cx, reader, ReaderSlot_Requests))
+    if (!SetNewList(cx, reader, ReaderSlot_Requests)) {
         return nullptr;
+    }
 
     return reader;
 }
 
 // Streams spec, 3.6.3 new ReadableStreamBYOBReader ( stream )
 bool
 ReadableStreamBYOBReader::constructor(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
-    if (!ThrowIfNotConstructing(cx, args, "ReadableStreamBYOBReader"))
+    if (!ThrowIfNotConstructing(cx, args, "ReadableStreamBYOBReader")) {
         return false;
+    }
 
     // Step 1: If ! IsReadableStream(stream) is false, throw a TypeError exception.
     if (!Is<ReadableStream>(args.get(0))) {
         ReportArgTypeError(cx, "ReadableStreamBYOBReader", "ReadableStream", args.get(0));
         return false;
     }
 
     Rooted<ReadableStream*> stream(cx, &args.get(0).toObject().as<ReadableStream>());
     RootedObject reader(cx, CreateReadableStreamBYOBReader(cx, stream));
-    if (!reader)
+    if (!reader) {
         return false;
+    }
 
     args.rval().setObject(*reader);
     return true;
 }
 
 // Streams spec, 3.6.4.1 get closed
 static MOZ_MUST_USE bool
 ReadableStreamBYOBReader_closed(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // Step 1: If ! IsReadableStreamBYOBReader(this) is false, return a promise
     //         rejected with a TypeError exception.
-    if (!Is<ReadableStreamBYOBReader>(args.thisv()))
+    if (!Is<ReadableStreamBYOBReader>(args.thisv())) {
         return RejectNonGenericMethod(cx, args, "ReadableStreamBYOBReader", "get closed");
+    }
 
     // Step 2: Return this.[[closedPromise]].
     NativeObject* reader = &args.thisv().toObject().as<NativeObject>();
     args.rval().set(reader->getFixedSlot(ReaderSlot_ClosedPromise));
     return true;
 }
 
 // Streams spec, 3.6.4.2. cancel ( reason )
 static MOZ_MUST_USE bool
 ReadableStreamBYOBReader_cancel(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // Step 1: If ! IsReadableStreamBYOBReader(this) is false, return a promise
     //         rejected with a TypeError exception.
-    if (!Is<ReadableStreamBYOBReader>(args.thisv()))
+    if (!Is<ReadableStreamBYOBReader>(args.thisv())) {
         return RejectNonGenericMethod(cx, args, "ReadableStreamBYOBReader", "cancel");
+    }
 
     // Step 2: If this.[[ownerReadableStream]] is undefined, return a promise
     //         rejected with a TypeError exception.
     RootedNativeObject reader(cx, &args.thisv().toObject().as<NativeObject>());
     if (!ReaderHasStream(reader)) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_READABLESTREAMREADER_NOT_OWNED, "cancel");
         return ReturnPromiseRejectedWithPendingError(cx, args);
     }
 
     // Step 3: Return ! ReadableStreamReaderGenericCancel(this, reason).
     JSObject* cancelPromise = ReadableStreamReaderGenericCancel(cx, reader, args.get(0));
-    if (!cancelPromise)
+    if (!cancelPromise) {
         return false;
+    }
     args.rval().setObject(*cancelPromise);
     return true;
 }
 
 // Streams spec, 3.6.4.3 read ( )
 static MOZ_MUST_USE bool
 ReadableStreamBYOBReader_read(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     HandleValue viewVal = args.get(0);
 
     // Step 1: If ! IsReadableStreamBYOBReader(this) is false, return a promise
     //         rejected with a TypeError exception.
-    if (!Is<ReadableStreamBYOBReader>(args.thisv()))
+    if (!Is<ReadableStreamBYOBReader>(args.thisv())) {
         return RejectNonGenericMethod(cx, args, "ReadableStreamBYOBReader", "read");
+    }
 
     // Step 2: If this.[[ownerReadableStream]] is undefined, return a promise
     //         rejected with a TypeError exception.
     Rooted<ReadableStreamBYOBReader*> reader(cx);
     reader = &args.thisv().toObject().as<ReadableStreamBYOBReader>();
     if (!ReaderHasStream(reader)) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_READABLESTREAMREADER_NOT_OWNED, "read");
@@ -1929,18 +2021,19 @@ ReadableStreamBYOBReader_read(JSContext*
     if (JS_GetArrayBufferViewByteLength(view) == 0) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_READABLESTREAMBYOBREADER_READ_EMPTY_VIEW);
         return ReturnPromiseRejectedWithPendingError(cx, args);
     }
 
     // Step 6: Return ! ReadableStreamBYOBReaderRead(this, view).
     JSObject* readPromise = ReadableStreamBYOBReader::read(cx, reader, view);
-    if (!readPromise)
+    if (!readPromise) {
         return false;
+    }
     args.rval().setObject(*readPromise);
     return true;
 }
 
 static MOZ_MUST_USE bool
 ReadableStreamReaderGenericRelease(JSContext* cx, HandleNativeObject reader);
 
 // Streams spec, 3.6.4.4. releaseLock ( )
@@ -2046,18 +2139,19 @@ ReadableStreamReaderGenericInitialize(JS
         MOZ_ASSERT(stream->errored());
 
         // Step ii: Set reader.[[closedPromise]] to a new promise rejected with
         //          stream.[[storedError]].
         RootedValue storedError(cx, stream->getFixedSlot(StreamSlot_StoredError));
         promise = PromiseObject::unforgeableReject(cx, storedError);
     }
 
-    if (!promise)
+    if (!promise) {
         return false;
+    }
 
     reader->setFixedSlot(ReaderSlot_ClosedPromise, ObjectValue(*promise));
     return true;
 }
 
 // Streams spec, 3.7.5. ReadableStreamReaderGenericRelease ( reader )
 static MOZ_MUST_USE bool
 ReadableStreamReaderGenericRelease(JSContext* cx, HandleNativeObject reader)
@@ -2068,32 +2162,35 @@ ReadableStreamReaderGenericRelease(JSCon
     // Step 2: Assert: reader.[[ownerReadableStream]].[[reader]] is reader.
     MOZ_ASSERT(&stream->getFixedSlot(StreamSlot_Reader).toObject() == reader);
 
     // Create an exception to reject promises with below. We don't have a
     // clean way to do this, unfortunately.
     JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_READABLESTREAMREADER_RELEASED);
     RootedValue exn(cx);
     // Not much we can do about uncatchable exceptions, just bail.
-    if (!GetAndClearException(cx, &exn))
+    if (!GetAndClearException(cx, &exn)) {
         return false;
+    }
 
     // Step 3: If reader.[[ownerReadableStream]].[[state]] is "readable", reject
     //         reader.[[closedPromise]] with a TypeError exception.
     if (stream->readable()) {
             Value val = reader->getFixedSlot(ReaderSlot_ClosedPromise);
             Rooted<PromiseObject*> closedPromise(cx, &val.toObject().as<PromiseObject>());
-            if (!PromiseObject::reject(cx, closedPromise, exn))
+            if (!PromiseObject::reject(cx, closedPromise, exn)) {
                 return false;
+            }
     } else {
         // Step 4: Otherwise, set reader.[[closedPromise]] to a new promise rejected
         //         with a TypeError exception.
         RootedObject closedPromise(cx, PromiseObject::unforgeableReject(cx, exn));
-        if (!closedPromise)
+        if (!closedPromise) {
             return false;
+        }
         reader->setFixedSlot(ReaderSlot_ClosedPromise, ObjectValue(*closedPromise));
     }
 
     // Step 5: Set reader.[[ownerReadableStream]].[[reader]] to undefined.
     stream->setFixedSlot(StreamSlot_Reader, UndefinedValue());
 
     // Step 6: Set reader.[[ownerReadableStream]] to undefined.
     reader->setFixedSlot(ReaderSlot_Stream, UndefinedValue());
@@ -2146,18 +2243,19 @@ ReadableStreamDefaultReader::read(JSCont
 
     // Step 3: Set stream.[[disturbed]] to true.
     SetStreamState(stream, StreamState(stream) | ReadableStream::Disturbed);
 
     // Step 4: If stream.[[state]] is "closed", return a new promise resolved with
     //         ! CreateIterResultObject(undefined, true).
     if (stream->closed()) {
         RootedObject iterResult(cx, CreateIterResultObject(cx, UndefinedHandleValue, true));
-        if (!iterResult)
+        if (!iterResult) {
             return nullptr;
+        }
         RootedValue iterResultVal(cx, ObjectValue(*iterResult));
         return PromiseObject::unforgeableResolve(cx, iterResultVal);
     }
 
     // Step 5: If stream.[[state]] is "errored", return a new promise rejected with
     //         stream.[[storedError]].
     if (stream->errored()) {
         RootedValue storedError(cx, stream->getFixedSlot(StreamSlot_StoredError));
@@ -2187,18 +2285,19 @@ ControllerStartHandler(JSContext* cx, un
     // Step ii: Assert: controller.[[pulling]] is false.
     // Step iii: Assert: controller.[[pullAgain]] is false.
     MOZ_ASSERT(!(ControllerFlags(controller) &
                  (ControllerFlag_Pulling | ControllerFlag_PullAgain)));
 
     // Step iv: Perform ! ReadableStreamDefaultControllerCallPullIfNeeded(controller).
     // or
     // Step iv: Perform ! ReadableByteStreamControllerCallPullIfNeeded((controller).
-    if (!ReadableStreamControllerCallPullIfNeeded(cx, controller))
+    if (!ReadableStreamControllerCallPullIfNeeded(cx, controller)) {
         return false;
+    }
     args.rval().setUndefined();
     return true;
 }
 
 static MOZ_MUST_USE bool
 ReadableStreamDefaultControllerErrorIfNeeded(JSContext* cx,
                                              Handle<ReadableStreamDefaultController*> controller,
                                              HandleValue e);
@@ -2220,18 +2319,19 @@ ControllerStartFailedHandler(JSContext* 
     if (controllerObj->is<ReadableStreamDefaultController>()) {
         Rooted<ReadableStreamDefaultController*> controller(cx);
         controller = &controllerObj->as<ReadableStreamDefaultController>();
         return ReadableStreamDefaultControllerErrorIfNeeded(cx, controller, args.get(0));
     }
 
     // 3.10.3, Step 16.b.i: If stream.[[state]] is "readable", perform
     //                      ! ReadableByteStreamControllerError(controller, r).
-    if (StreamFromController(controllerObj)->readable())
+    if (StreamFromController(controllerObj)->readable()) {
         return ReadableStreamControllerError(cx, controllerObj, args.get(0));
+    }
 
     args.rval().setUndefined();
     return true;
 }
 
 static MOZ_MUST_USE bool
 ValidateAndNormalizeHighWaterMark(JSContext* cx,
                                   HandleValue highWaterMarkVal,
@@ -2248,82 +2348,91 @@ ValidateAndNormalizeQueuingStrategy(JSCo
 // Steps 3 - 11.
 static MOZ_MUST_USE ReadableStreamDefaultController*
 CreateReadableStreamDefaultController(JSContext* cx, Handle<ReadableStream*> stream,
                                       HandleValue underlyingSource, HandleValue size,
                                       HandleValue highWaterMarkVal)
 {
     Rooted<ReadableStreamDefaultController*> controller(cx);
     controller = NewBuiltinClassInstance<ReadableStreamDefaultController>(cx);
-    if (!controller)
+    if (!controller) {
         return nullptr;
+    }
 
     // Step 3: Set this.[[controlledReadableStream]] to stream.
     controller->setFixedSlot(ControllerSlot_Stream, ObjectValue(*stream));
 
     // Step 4: Set this.[[underlyingSource]] to underlyingSource.
     controller->setFixedSlot(ControllerSlot_UnderlyingSource, underlyingSource);
 
     // Step 5: Perform ! ResetQueue(this).
-    if (!ResetQueue(cx, controller))
+    if (!ResetQueue(cx, controller)) {
         return nullptr;
+    }
 
     // Step 6: Set this.[[started]], this.[[closeRequested]], this.[[pullAgain]],
     //         and this.[[pulling]] to false.
     controller->setFixedSlot(ControllerSlot_Flags, Int32Value(0));
 
     // Step 7: Let normalizedStrategy be
     //         ? ValidateAndNormalizeQueuingStrategy(size, highWaterMark).
     double highWaterMark;
-    if (!ValidateAndNormalizeQueuingStrategy(cx, size, highWaterMarkVal, &highWaterMark))
+    if (!ValidateAndNormalizeQueuingStrategy(cx, size, highWaterMarkVal, &highWaterMark)) {
         return nullptr;
+    }
 
     // Step 8: Set this.[[strategySize]] to normalizedStrategy.[[size]] and
     //         this.[[strategyHWM]] to normalizedStrategy.[[highWaterMark]].
     controller->setFixedSlot(DefaultControllerSlot_StrategySize, size);
     controller->setFixedSlot(ControllerSlot_StrategyHWM, NumberValue(highWaterMark));
 
     // Step 9: Let controller be this (implicit).
 
     // Step 10: Let startResult be
     //          ? InvokeOrNoop(underlyingSource, "start", « this »).
     RootedValue startResult(cx);
     RootedValue controllerVal(cx, ObjectValue(*controller));
-    if (!InvokeOrNoop(cx, underlyingSource, cx->names().start, controllerVal, &startResult))
+    if (!InvokeOrNoop(cx, underlyingSource, cx->names().start, controllerVal, &startResult)) {
         return nullptr;
+    }
 
     // Step 11: Let startPromise be a promise resolved with startResult:
     RootedObject startPromise(cx, PromiseObject::unforgeableResolve(cx, startResult));
-    if (!startPromise)
+    if (!startPromise) {
         return nullptr;
+    }
 
     RootedObject onStartFulfilled(cx, NewHandler(cx, ControllerStartHandler, controller));
-    if (!onStartFulfilled)
+    if (!onStartFulfilled) {
         return nullptr;
+    }
 
     RootedObject onStartRejected(cx, NewHandler(cx, ControllerStartFailedHandler, controller));
-    if (!onStartRejected)
+    if (!onStartRejected) {
         return nullptr;
-
-    if (!JS::AddPromiseReactions(cx, startPromise, onStartFulfilled, onStartRejected))
+    }
+
+    if (!JS::AddPromiseReactions(cx, startPromise, onStartFulfilled, onStartRejected)) {
         return nullptr;
+    }
 
     return controller;
 }
 
 // Streams spec, 3.8.3.
 // new ReadableStreamDefaultController( stream, underlyingSource, size,
 //                                      highWaterMark )
 bool
 ReadableStreamDefaultController::constructor(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
-    if (!ThrowIfNotConstructing(cx, args, "ReadableStreamDefaultController"))
+    if (!ThrowIfNotConstructing(cx, args, "ReadableStreamDefaultController")) {
         return false;
+    }
 
     // Step 1: If ! IsReadableStream(stream) is false, throw a TypeError exception.
     HandleValue streamVal = args.get(0);
     if (!Is<ReadableStream>(streamVal)) {
         ReportArgTypeError(cx, "ReadableStreamDefaultController", "ReadableStream",
                            args.get(0));
         return false;
     }
@@ -2336,18 +2445,19 @@ ReadableStreamDefaultController::constru
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_READABLESTREAM_CONTROLLER_SET);
         return false;
     }
 
     // Steps 3-11.
     RootedObject controller(cx, CreateReadableStreamDefaultController(cx, stream, args.get(1),
                                                                       args.get(2), args.get(3)));
-    if (!controller)
+    if (!controller) {
         return false;
+    }
 
     args.rval().setObject(*controller);
     return true;
 }
 
 static MOZ_MUST_USE double
 ReadableStreamControllerGetDesiredSizeUnchecked(NativeObject* controller);
 
@@ -2422,22 +2532,24 @@ VerifyControllerStateForClosing(JSContex
 // Streams spec, 3.8.4.2 close()
 static MOZ_MUST_USE bool
 ReadableStreamDefaultController_close_impl(JSContext* cx, const CallArgs& args)
 {
     Rooted<ReadableStreamDefaultController*> controller(cx);
     controller = &args.thisv().toObject().as<ReadableStreamDefaultController>();
 
     // Steps 2-3.
-    if (!VerifyControllerStateForClosing(cx, controller))
+    if (!VerifyControllerStateForClosing(cx, controller)) {
         return false;
+    }
 
     // Step 4: Perform ! ReadableStreamDefaultControllerClose(this).
-    if (!ReadableStreamDefaultControllerClose(cx, controller))
+    if (!ReadableStreamDefaultControllerClose(cx, controller)) {
         return false;
+    }
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 ReadableStreamDefaultController_close(JSContext* cx, unsigned argc, Value* vp)
 {
     // Step 1: If ! IsReadableStreamDefaultController(this) is false, throw a
@@ -2472,18 +2584,19 @@ ReadableStreamDefaultController_enqueue_
     ReadableStream* stream = StreamFromController(controller);
     if (!stream->readable()) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_READABLESTREAMCONTROLLER_NOT_READABLE, "close");
         return false;
     }
 
     // Step 4: Return ! ReadableStreamDefaultControllerEnqueue(this, chunk).
-    if (!ReadableStreamDefaultControllerEnqueue(cx, controller, args.get(0)))
+    if (!ReadableStreamDefaultControllerEnqueue(cx, controller, args.get(0))) {
         return false;
+    }
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 ReadableStreamDefaultController_enqueue(JSContext* cx, unsigned argc, Value* vp)
 {
     // Step 1: If ! IsReadableStreamDefaultController(this) is false, throw a
@@ -2505,18 +2618,19 @@ ReadableStreamDefaultController_error_im
     // Step 3: If stream.[[state]] is not "readable", throw a TypeError exception.
     if (!StreamFromController(controller)->readable()) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_READABLESTREAMCONTROLLER_NOT_READABLE, "error");
         return false;
     }
 
     // Step 4: Perform ! ReadableStreamDefaultControllerError(this, e).
-    if (!ReadableStreamControllerError(cx, controller, args.get(0)))
+    if (!ReadableStreamControllerError(cx, controller, args.get(0))) {
         return false;
+    }
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 ReadableStreamDefaultController_error(JSContext* cx, unsigned argc, Value* vp)
 {
     // Step 1: If ! IsReadableStreamDefaultController(this) is false, throw a
@@ -2566,18 +2680,19 @@ ReadableStreamControllerCancelSteps(JSCo
             // Step b: Set firstDescriptor.[[bytesFilled]] to 0.
             Rooted<PullIntoDescriptor*> firstDescriptor(cx);
             firstDescriptor = PeekList<PullIntoDescriptor>(pendingPullIntos);
             firstDescriptor->setBytesFilled(0);
         }
     }
 
     // Step 1 of 3.8.5.1, step 2 of 3.10.5.1: Perform ! ResetQueue(this).
-    if (!ResetQueue(cx, controller))
+    if (!ResetQueue(cx, controller)) {
         return nullptr;
+    }
 
     // Step 2 of 3.8.5.1, step 3 of 3.10.5.1:
     // Return ! PromiseInvokeOrNoop(this.[[underlying(Byte)Source]],
     //                              "cancel", « reason »)
     RootedValue underlyingSource(cx);
     underlyingSource = controller->getFixedSlot(ControllerSlot_UnderlyingSource);
 
     if (Is<TeeState>(underlyingSource)) {
@@ -2609,55 +2724,62 @@ ReadableStreamDefaultControllerPullSteps
     MOZ_ASSERT(controller->is<ReadableStreamDefaultController>());
 
     // Step 1: Let stream be this.[[controlledReadableStream]].
     Rooted<ReadableStream*> stream(cx, StreamFromController(controller));
 
     // Step 2: If this.[[queue]] is not empty,
     RootedNativeObject queue(cx);
     RootedValue val(cx, controller->getFixedSlot(QueueContainerSlot_Queue));
-    if (val.isObject())
+    if (val.isObject()) {
         queue = &val.toObject().as<NativeObject>();
+    }
 
     if (queue && queue->getDenseInitializedLength() != 0) {
         // Step a: Let chunk be ! DequeueValue(this.[[queue]]).
         RootedValue chunk(cx);
-        if (!DequeueValue(cx, controller, &chunk))
+        if (!DequeueValue(cx, controller, &chunk)) {
             return nullptr;
+        }
 
         // Step b: If this.[[closeRequested]] is true and this.[[queue]] is empty,
         //         perform ! ReadableStreamClose(stream).
         bool closeRequested = ControllerFlags(controller) & ControllerFlag_CloseRequested;
         if (closeRequested && queue->getDenseInitializedLength() == 0) {
-            if (!ReadableStreamCloseInternal(cx, stream))
+            if (!ReadableStreamCloseInternal(cx, stream)) {
                 return nullptr;
+            }
         }
 
         // Step c: Otherwise, perform ! ReadableStreamDefaultControllerCallPullIfNeeded(this).
         else {
-        if (!ReadableStreamControllerCallPullIfNeeded(cx, controller))
+        if (!ReadableStreamControllerCallPullIfNeeded(cx, controller)) {
             return nullptr;
         }
+        }
 
         // Step d: Return a promise resolved with ! CreateIterResultObject(chunk, false).
         RootedObject iterResultObj(cx, CreateIterResultObject(cx, chunk, false));
-        if (!iterResultObj)
+        if (!iterResultObj) {
           return nullptr;
+        }
         RootedValue iterResult(cx, ObjectValue(*iterResultObj));
         return PromiseObject::unforgeableResolve(cx, iterResult);
     }
 
     // Step 3: Let pendingPromise be ! ReadableStreamAddReadRequest(stream).
     Rooted<PromiseObject*> pendingPromise(cx, ReadableStreamAddReadRequest(cx, stream));
-    if (!pendingPromise)
+    if (!pendingPromise) {
         return nullptr;
+    }
 
     // Step 4: Perform ! ReadableStreamDefaultControllerCallPullIfNeeded(this).
-    if (!ReadableStreamControllerCallPullIfNeeded(cx, controller))
+    if (!ReadableStreamControllerCallPullIfNeeded(cx, controller)) {
         return nullptr;
+    }
 
     // Step 5: Return pendingPromise.
     return pendingPromise;
 }
 
 // Streams spec, 3.9.2 and 3.12.3. step 7:
 // Upon fulfillment of pullPromise,
 static bool
@@ -2669,18 +2791,19 @@ ControllerPullHandler(JSContext* cx, uns
 
     // Step a: Set controller.[[pulling]] to false.
     // Step b.i: Set controller.[[pullAgain]] to false.
     RemoveControllerFlags(controller, ControllerFlag_Pulling | ControllerFlag_PullAgain);
 
     // Step b: If controller.[[pullAgain]] is true,
     if (flags & ControllerFlag_PullAgain) {
         // Step ii: Perform ! ReadableByteStreamControllerCallPullIfNeeded(controller).
-        if (!ReadableStreamControllerCallPullIfNeeded(cx, controller))
+        if (!ReadableStreamControllerCallPullIfNeeded(cx, controller)) {
             return false;
+        }
     }
 
     args.rval().setUndefined();
     return true;
 }
 
 // Streams spec, 3.9.2 and 3.12.3. step 8:
 // Upon rejection of pullPromise with reason e,
@@ -2689,18 +2812,19 @@ ControllerPullFailedHandler(JSContext* c
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     RootedNativeObject controller(cx, TargetFromHandler<NativeObject>(args.callee()));
     HandleValue e = args.get(0);
 
     // Step a: If controller.[[controlledReadableStream]].[[state]] is "readable",
     //         perform ! ReadableByteStreamControllerError(controller, e).
     if (StreamFromController(controller)->readable()) {
-        if (!ReadableStreamControllerError(cx, controller, e))
+        if (!ReadableStreamControllerError(cx, controller, e)) {
             return false;
+        }
     }
 
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 ReadableStreamControllerShouldCallPull(NativeObject* controller);
@@ -2714,18 +2838,19 @@ ReadableStreamControllerGetDesiredSizeUn
 inline static MOZ_MUST_USE bool
 ReadableStreamControllerCallPullIfNeeded(JSContext* cx, HandleNativeObject controller)
 {
     // Step 1: Let shouldPull be
     //         ! ReadableByteStreamControllerShouldCallPull(controller).
     bool shouldPull = ReadableStreamControllerShouldCallPull(controller);
 
     // Step 2: If shouldPull is false, return.
-    if (!shouldPull)
+    if (!shouldPull) {
         return true;
+    }
 
     // Step 3: If controller.[[pulling]] is true,
     if (ControllerFlags(controller) & ControllerFlag_Pulling) {
         // Step a: Set controller.[[pullAgain]] to true.
         AddControllerFlags(controller, ControllerFlag_PullAgain);
 
         // Step b: Return.
         return true;
@@ -2753,26 +2878,29 @@ ReadableStreamControllerCallPullIfNeeded
         Rooted<ReadableStream*> stream(cx, StreamFromController(controller));
         double desiredSize = ReadableStreamControllerGetDesiredSizeUnchecked(controller);
         cx->runtime()->readableStreamDataRequestCallback(cx, stream, source,
                                                          stream->embeddingFlags(), desiredSize);
         pullPromise = PromiseObject::unforgeableResolve(cx, UndefinedHandleValue);
     } else {
         pullPromise = PromiseInvokeOrNoop(cx, underlyingSource, cx->names().pull, controllerVal);
     }
-    if (!pullPromise)
+    if (!pullPromise) {
         return false;
+    }
 
     RootedObject onPullFulfilled(cx, NewHandler(cx, ControllerPullHandler, controller));
-    if (!onPullFulfilled)
+    if (!onPullFulfilled) {
         return false;
+    }
 
     RootedObject onPullRejected(cx, NewHandler(cx, ControllerPullFailedHandler, controller));
-    if (!onPullRejected)
+    if (!onPullRejected) {
         return false;
+    }
 
     return JS::AddPromiseReactions(cx, pullPromise, onPullFulfilled, onPullRejected);
 
     // Steps 7-8 implemented in functions above.
 }
 
 // Streams spec, 3.9.3. ReadableStreamDefaultControllerShouldCallPull ( controller )
 // and
@@ -2782,33 +2910,37 @@ ReadableStreamControllerShouldCallPull(N
 {
     // Step 1: Let stream be controller.[[controlledReadableStream]].
     ReadableStream* stream = StreamFromController(controller);
 
     // Step 2: If stream.[[state]] is "closed" or stream.[[state]] is "errored",
     //         return false.
     // or, equivalently
     // Step 2: If stream.[[state]] is not "readable", return false.
-    if (!stream->readable())
+    if (!stream->readable()) {
         return false;
+    }
 
     // Step 3: If controller.[[closeRequested]] is true, return false.
     uint32_t flags = ControllerFlags(controller);
-    if (flags & ControllerFlag_CloseRequested)
+    if (flags & ControllerFlag_CloseRequested) {
         return false;
+    }
 
     // Step 4: If controller.[[started]] is false, return false.
-    if (!(flags & ControllerFlag_Started))
+    if (!(flags & ControllerFlag_Started)) {
         return false;
+    }
 
     // Step 5: If ! IsReadableStreamLocked(stream) is true and
     //         ! ReadableStreamGetNumReadRequests(stream) > 0, return true.
     // Steps 5-6 of 3.12.24 are equivalent in our implementation.
-    if (stream->locked() && ReadableStreamGetNumReadRequests(stream) > 0)
+    if (stream->locked() && ReadableStreamGetNumReadRequests(stream) > 0) {
         return true;
+    }
 
     // Step 6: Let desiredSize be ReadableStreamDefaultControllerGetDesiredSize(controller).
     double desiredSize = ReadableStreamControllerGetDesiredSizeUnchecked(controller);
 
     // Step 7: If desiredSize > 0, return true.
     // Step 8: Return false.
     // Steps 7-8 of 3.12.24 are equivalent in our implementation.
     return desiredSize > 0;
@@ -2829,18 +2961,19 @@ ReadableStreamDefaultControllerClose(JSC
     MOZ_ASSERT(stream->readable());
 
     // Step 4: Set controller.[[closeRequested]] to true.
     AddControllerFlags(controller, ControllerFlag_CloseRequested);
 
     // Step 5: If controller.[[queue]] is empty, perform ! ReadableStreamClose(stream).
     RootedNativeObject queue(cx);
     queue = &controller->getFixedSlot(QueueContainerSlot_Queue).toObject().as<NativeObject>();
-    if (queue->getDenseInitializedLength() == 0)
+    if (queue->getDenseInitializedLength() == 0) {
         return ReadableStreamCloseInternal(cx, stream);
+    }
 
     return true;
 }
 
 static MOZ_MUST_USE bool
 EnqueueValueWithSize(JSContext* cx, HandleNativeObject container, HandleValue value,
                      HandleValue sizeVal);
 
@@ -2858,59 +2991,64 @@ ReadableStreamDefaultControllerEnqueue(J
 
     // Step 3: Assert: stream.[[state]] is "readable".
     MOZ_ASSERT(stream->readable());
 
     // Step 4: If ! IsReadableStreamLocked(stream) is true and
     //         ! ReadableStreamGetNumReadRequests(stream) > 0, perform
     //         ! ReadableStreamFulfillReadRequest(stream, chunk, false).
     if (stream->locked() && ReadableStreamGetNumReadRequests(stream) > 0) {
-        if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, stream, chunk, false))
+        if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, stream, chunk, false)) {
             return false;
+        }
     } else {
         // Step 5: Otherwise,
         // Step a: Let chunkSize be 1.
         RootedValue chunkSize(cx, NumberValue(1));
         bool success = true;
 
         // Step b: If controller.[[strategySize]] is not undefined,
         RootedValue strategySize(cx);
         strategySize = controller->getFixedSlot(DefaultControllerSlot_StrategySize);
         if (!strategySize.isUndefined()) {
             // Step i: Set chunkSize to Call(stream.[[strategySize]], undefined, chunk).
             success = Call(cx, strategySize, UndefinedHandleValue, chunk, &chunkSize);
         }
 
         // Step c: Let enqueueResult be
         //         EnqueueValueWithSize(controller, chunk, chunkSize).
-        if (success)
+        if (success) {
             success = EnqueueValueWithSize(cx, controller, chunk, chunkSize);
+        }
 
         if (!success) {
             // Step b.ii: If chunkSize is an abrupt completion,
             // and
             // Step d: If enqueueResult is an abrupt completion,
             RootedValue exn(cx);
-            if (!cx->getPendingException(&exn))
+            if (!cx->getPendingException(&exn)) {
                 return false;
+            }
 
             // Step b.ii.1: Perform
             //         ! ReadableStreamDefaultControllerErrorIfNeeded(controller,
             //                                                        chunkSize.[[Value]]).
-            if (!ReadableStreamDefaultControllerErrorIfNeeded(cx, controller, exn))
+            if (!ReadableStreamDefaultControllerErrorIfNeeded(cx, controller, exn)) {
                 return false;
+            }
 
             // Step b.ii.2: Return chunkSize.
             return false;
         }
     }
 
     // Step 6: Perform ! ReadableStreamDefaultControllerCallPullIfNeeded(controller).
-    if (!ReadableStreamControllerCallPullIfNeeded(cx, controller))
+    if (!ReadableStreamControllerCallPullIfNeeded(cx, controller)) {
         return false;
+    }
 
     // Step 7: Return.
     return true;
 }
 
 static MOZ_MUST_USE bool
 ReadableByteStreamControllerClearPendingPullIntos(JSContext* cx, HandleNativeObject controller);
 
@@ -2928,39 +3066,42 @@ ReadableStreamControllerError(JSContext*
     // Step 2: Assert: stream.[[state]] is "readable".
     MOZ_ASSERT(stream->readable());
 
     // Step 3 of 3.12.10:
     // Perform ! ReadableByteStreamControllerClearPendingPullIntos(controller).
     if (controller->is<ReadableByteStreamController>()) {
         Rooted<ReadableByteStreamController*> byteStreamController(cx);
         byteStreamController = &controller->as<ReadableByteStreamController>();
-        if (!ReadableByteStreamControllerClearPendingPullIntos(cx, byteStreamController))
+        if (!ReadableByteStreamControllerClearPendingPullIntos(cx, byteStreamController)) {
             return false;
+        }
     }
 
     // Step 3 (or 4): Perform ! ResetQueue(controller).
-    if (!ResetQueue(cx, controller))
+    if (!ResetQueue(cx, controller)) {
         return false;
+    }
 
     // Step 4 (or 5): Perform ! ReadableStreamError(stream, e).
     return ReadableStreamErrorInternal(cx, stream, e);
 }
 
 // Streams spec, 3.9.7. ReadableStreamDefaultControllerErrorIfNeeded ( controller, e ) nothrow
 static MOZ_MUST_USE bool
 ReadableStreamDefaultControllerErrorIfNeeded(JSContext* cx,
                                              Handle<ReadableStreamDefaultController*> controller,
                                              HandleValue e)
 {
     // Step 1: If controller.[[controlledReadableStream]].[[state]] is "readable",
     //         perform ! ReadableStreamDefaultControllerError(controller, e).
     Rooted<ReadableStream*> stream(cx, StreamFromController(controller));
-    if (stream->readable())
+    if (stream->readable()) {
         return ReadableStreamControllerError(cx, controller, e);
+    }
     return true;
 }
 
 // Streams spec, 3.9.8. ReadableStreamDefaultControllerGetDesiredSize ( controller )
 // and
 // Streams spec 3.12.13. ReadableByteStreamControllerGetDesiredSize ( controller )
 static MOZ_MUST_USE double
 ReadableStreamControllerGetDesiredSizeUnchecked(NativeObject* controller)
@@ -2982,45 +3123,49 @@ ReadableStreamControllerGetDesiredSizeUn
 // Steps 3 - 16.
 static MOZ_MUST_USE ReadableByteStreamController*
 CreateReadableByteStreamController(JSContext* cx, Handle<ReadableStream*> stream,
                                    HandleValue underlyingByteSource,
                                    HandleValue highWaterMarkVal)
 {
     Rooted<ReadableByteStreamController*> controller(cx);
     controller = NewBuiltinClassInstance<ReadableByteStreamController>(cx);
-    if (!controller)
+    if (!controller) {
         return nullptr;
+    }
 
     // Step 3: Set this.[[controlledReadableStream]] to stream.
     controller->setFixedSlot(ControllerSlot_Stream, ObjectValue(*stream));
 
     // Step 4: Set this.[[underlyingByteSource]] to underlyingByteSource.
     controller->setFixedSlot(ControllerSlot_UnderlyingSource, underlyingByteSource);
 
     // Step 5: Set this.[[pullAgain]], and this.[[pulling]] to false.
     controller->setFixedSlot(ControllerSlot_Flags, Int32Value(0));
 
     // Step 6: Perform ! ReadableByteStreamControllerClearPendingPullIntos(this).
-    if (!ReadableByteStreamControllerClearPendingPullIntos(cx, controller))
+    if (!ReadableByteStreamControllerClearPendingPullIntos(cx, controller)) {
         return nullptr;
+    }
 
     // Step 7: Perform ! ResetQueue(this).
-    if (!ResetQueue(cx, controller))
+    if (!ResetQueue(cx, controller)) {
         return nullptr;
+    }
 
     // Step 8: Set this.[[started]] and this.[[closeRequested]] to false.
     // These should be false by default, unchanged since step 5.
     MOZ_ASSERT(ControllerFlags(controller) == 0);
 
     // Step 9: Set this.[[strategyHWM]] to
     //         ? ValidateAndNormalizeHighWaterMark(highWaterMark).
     double highWaterMark;
-    if (!ValidateAndNormalizeHighWaterMark(cx, highWaterMarkVal, &highWaterMark))
+    if (!ValidateAndNormalizeHighWaterMark(cx, highWaterMarkVal, &highWaterMark)) {
         return nullptr;
+    }
     controller->setFixedSlot(ControllerSlot_StrategyHWM, NumberValue(highWaterMark));
 
     // Step 10: Let autoAllocateChunkSize be
     //          ? GetV(underlyingByteSource, "autoAllocateChunkSize").
     RootedValue autoAllocateChunkSize(cx);
     if (!GetProperty(cx, underlyingByteSource, cx->names().autoAllocateChunkSize,
                      &autoAllocateChunkSize))
     {
@@ -3037,43 +3182,49 @@ CreateReadableByteStreamController(JSCon
             return nullptr;
     }
     }
 
     // Step 12: Set this.[[autoAllocateChunkSize]] to autoAllocateChunkSize.
     controller->setFixedSlot(ByteControllerSlot_AutoAllocateSize, autoAllocateChunkSize);
 
     // Step 13: Set this.[[pendingPullIntos]] to a new empty List.
-    if (!SetNewList(cx, controller, ByteControllerSlot_PendingPullIntos))
+    if (!SetNewList(cx, controller, ByteControllerSlot_PendingPullIntos)) {
         return nullptr;
+    }
 
     // Step 14: Let controller be this (implicit).
 
     // Step 15: Let startResult be
     //          ? InvokeOrNoop(underlyingSource, "start", « this »).
     RootedValue startResult(cx);
     RootedValue controllerVal(cx, ObjectValue(*controller));
-    if (!InvokeOrNoop(cx, underlyingByteSource, cx->names().start, controllerVal, &startResult))
+    if (!InvokeOrNoop(cx, underlyingByteSource, cx->names().start, controllerVal, &startResult)) {
         return nullptr;
+    }
 
     // Step 16: Let startPromise be a promise resolved with startResult:
     RootedObject startPromise(cx, PromiseObject::unforgeableResolve(cx, startResult));
-    if (!startPromise)
+    if (!startPromise) {
         return nullptr;
+    }
 
     RootedObject onStartFulfilled(cx, NewHandler(cx, ControllerStartHandler, controller));
-    if (!onStartFulfilled)
+    if (!onStartFulfilled) {
         return nullptr;
+    }
 
     RootedObject onStartRejected(cx, NewHandler(cx, ControllerStartFailedHandler, controller));
-    if (!onStartRejected)
+    if (!onStartRejected) {
         return nullptr;
-
-    if (!JS::AddPromiseReactions(cx, startPromise, onStartFulfilled, onStartRejected))
+    }
+
+    if (!JS::AddPromiseReactions(cx, startPromise, onStartFulfilled, onStartRejected)) {
         return nullptr;
+    }
 
     return controller;
 }
 
 bool
 ReadableByteStreamController::hasExternalSource() {
     return ControllerFlags(this) & ControllerFlag_ExternalSource;
 }
@@ -3081,18 +3232,19 @@ ReadableByteStreamController::hasExterna
 // Streams spec, 3.10.3.
 // new ReadableByteStreamController ( stream, underlyingByteSource,
 //                                    highWaterMark )
 bool
 ReadableByteStreamController::constructor(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
-    if (!ThrowIfNotConstructing(cx, args, "ReadableByteStreamController"))
+    if (!ThrowIfNotConstructing(cx, args, "ReadableByteStreamController")) {
         return false;
+    }
 
     // Step 1: If ! IsReadableStream(stream) is false, throw a TypeError exception.
     HandleValue streamVal = args.get(0);
     if (!Is<ReadableStream>(streamVal)) {
         ReportArgTypeError(cx, "ReadableStreamDefaultController", "ReadableStream",
                            args.get(0));
         return false;
     }
@@ -3104,33 +3256,35 @@ ReadableByteStreamController::constructo
     if (HasController(stream)) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_READABLESTREAM_CONTROLLER_SET);
         return false;
     }
 
     RootedObject controller(cx, CreateReadableByteStreamController(cx, stream, args.get(1),
                                                                    args.get(2)));
-    if (!controller)
+    if (!controller) {
         return false;
+    }
 
     args.rval().setObject(*controller);
     return true;
 }
 
 // Version of the ReadableByteStreamConstructor that's specialized for
 // handling external, embedding-provided, underlying sources.
 static MOZ_MUST_USE ReadableByteStreamController*
 CreateReadableByteStreamController(JSContext* cx, Handle<ReadableStream*> stream,
                                    void* underlyingSource)
 {
     Rooted<ReadableByteStreamController*> controller(cx);
     controller = NewBuiltinClassInstance<ReadableByteStreamController>(cx);
-    if (!controller)
+    if (!controller) {
         return nullptr;
+    }
 
     // Step 3: Set this.[[controlledReadableStream]] to stream.
     controller->setFixedSlot(ControllerSlot_Stream, ObjectValue(*stream));
 
     // Step 4: Set this.[[underlyingByteSource]] to underlyingByteSource.
     controller->setFixedSlot(ControllerSlot_UnderlyingSource, PrivateValue(underlyingSource));
 
     // Step 5: Set this.[[pullAgain]], and this.[[pulling]] to false.
@@ -3149,39 +3303,44 @@ CreateReadableByteStreamController(JSCon
 
     // Step 10: Let autoAllocateChunkSize be
     //          ? GetV(underlyingByteSource, "autoAllocateChunkSize").
     // Step 11: If autoAllocateChunkSize is not undefined,
     // Step 12: Set this.[[autoAllocateChunkSize]] to autoAllocateChunkSize.
     // Omitted.
 
     // Step 13: Set this.[[pendingPullIntos]] to a new empty List.
-    if (!SetNewList(cx, controller, ByteControllerSlot_PendingPullIntos))
+    if (!SetNewList(cx, controller, ByteControllerSlot_PendingPullIntos)) {
         return nullptr;
+    }
 
     // Step 14: Let controller be this (implicit).
     // Step 15: Let startResult be
     //          ? InvokeOrNoop(underlyingSource, "start", « this »).
     // Omitted.
 
     // Step 16: Let startPromise be a promise resolved with startResult:
     RootedObject startPromise(cx, PromiseObject::unforgeableResolve(cx, UndefinedHandleValue));
-    if (!startPromise)
+    if (!startPromise) {
         return nullptr;
+    }
 
     RootedObject onStartFulfilled(cx, NewHandler(cx, ControllerStartHandler, controller));
-    if (!onStartFulfilled)
+    if (!onStartFulfilled) {
         return nullptr;
+    }
 
     RootedObject onStartRejected(cx, NewHandler(cx, ControllerStartFailedHandler, controller));
-    if (!onStartRejected)
+    if (!onStartRejected) {
         return nullptr;
-
-    if (!JS::AddPromiseReactions(cx, startPromise, onStartFulfilled, onStartRejected))
+    }
+
+    if (!JS::AddPromiseReactions(cx, startPromise, onStartFulfilled, onStartRejected)) {
         return nullptr;
+    }
 
     return controller;
 }
 
 static MOZ_MUST_USE ReadableStreamBYOBRequest*
 CreateReadableStreamBYOBRequest(JSContext* cx, Handle<ReadableByteStreamController*> controller,
                                 HandleObject view);
 
@@ -3208,24 +3367,26 @@ ReadableByteStreamController_byobRequest
         //  « firstDescriptor.[[buffer]],
         //  firstDescriptor.[[byteOffset]] + firstDescriptor.[[bytesFilled]],
         //  firstDescriptor.[[byteLength]] − firstDescriptor.[[bytesFilled]] »).
         RootedArrayBufferObject buffer(cx, firstDescriptor->buffer());
         uint32_t bytesFilled = firstDescriptor->bytesFilled();
         RootedObject view(cx, JS_NewUint8ArrayWithBuffer(cx, buffer,
                                                          firstDescriptor->byteOffset() + bytesFilled,
                                                          firstDescriptor->byteLength() - bytesFilled));
-        if (!view)
+        if (!view) {
             return false;
+        }
 
         // Step c: Set this.[[byobRequest]] to
         //         ! Construct(ReadableStreamBYOBRequest, « this, view »).
         RootedObject request(cx, CreateReadableStreamBYOBRequest(cx, controller, view));
-        if (!request)
+        if (!request) {
             return false;
+        }
         byobRequest = ObjectValue(*request);
         controller->setFixedSlot(ByteControllerSlot_BYOBRequest, byobRequest);
     }
 
     // Step 3: Return this.[[byobRequest]].
     args.rval().set(byobRequest);
     return true;
 }
@@ -3259,22 +3420,24 @@ ReadableByteStreamControllerClose(JSCont
 // Streams spec, 3.10.4.3. close()
 static MOZ_MUST_USE bool
 ReadableByteStreamController_close_impl(JSContext* cx, const CallArgs& args)
 {
     Rooted<ReadableByteStreamController*> controller(cx);
     controller = &args.thisv().toObject().as<ReadableByteStreamController>();
 
     // Steps 2-3.
-    if (!VerifyControllerStateForClosing(cx, controller))
+    if (!VerifyControllerStateForClosing(cx, controller)) {
         return false;
+    }
 
     // Step 4: Perform ? ReadableByteStreamControllerClose(this).
-    if (!ReadableByteStreamControllerClose(cx, controller))
+    if (!ReadableByteStreamControllerClose(cx, controller)) {
         return false;
+    }
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 ReadableByteStreamController_close(JSContext* cx, unsigned argc, Value* vp)
 {
     // Step 1: If ! IsReadableByteStreamController(this) is false, throw a
@@ -3319,18 +3482,19 @@ ReadableByteStreamController_enqueue_imp
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_READABLEBYTESTREAMCONTROLLER_BAD_CHUNK,
                                   "ReadableByteStreamController#enqueue");
         return false;
     }
     RootedObject chunk(cx, &chunkVal.toObject());
 
     // Step 6: Return ! ReadableByteStreamControllerEnqueue(this, chunk).
-    if (!ReadableByteStreamControllerEnqueue(cx, controller, chunk))
+    if (!ReadableByteStreamControllerEnqueue(cx, controller, chunk)) {
         return false;
+    }
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 ReadableByteStreamController_enqueue(JSContext* cx, unsigned argc, Value* vp)
 {
     // Step 1: If ! IsReadableByteStreamController(this) is false, throw a
@@ -3352,18 +3516,19 @@ ReadableByteStreamController_error_impl(
     // Step 3: If stream.[[state]] is not "readable", throw a TypeError exception.
     if (!StreamFromController(controller)->readable()) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_READABLESTREAMCONTROLLER_NOT_READABLE, "error");
         return false;
     }
 
     // Step 4: Perform ! ReadableByteStreamControllerError(this, e).
-    if (!ReadableStreamControllerError(cx, controller, e))
+    if (!ReadableStreamControllerError(cx, controller, e)) {
         return false;
+    }
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 ReadableByteStreamController_error(JSContext* cx, unsigned argc, Value* vp)
 {
     // Step 1: If ! IsReadableByteStreamController(this) is false, throw a
@@ -3386,22 +3551,24 @@ static const JSFunctionSpec ReadableByte
     JS_FS_END
 };
 
 static void
 ReadableByteStreamControllerFinalize(FreeOp* fop, JSObject* obj)
 {
     ReadableByteStreamController& controller = obj->as<ReadableByteStreamController>();
 
-    if (controller.getFixedSlot(ControllerSlot_Flags).isUndefined())
+    if (controller.getFixedSlot(ControllerSlot_Flags).isUndefined()) {
         return;
+    }
 
     uint32_t flags = ControllerFlags(&controller);
-    if (!(flags & ControllerFlag_ExternalSource))
+    if (!(flags & ControllerFlag_ExternalSource)) {
         return;
+    }
 
     uint8_t embeddingFlags = flags >> ControllerEmbeddingFlagsOffset;
 
     void* underlyingSource = controller.getFixedSlot(ControllerSlot_UnderlyingSource).toPrivate();
     obj->runtimeFromAnyThread()->readableStreamFinalizeCallback(underlyingSource, embeddingFlags);
 }
 
 static const ClassOps ReadableByteStreamControllerClassOps = {
@@ -3446,18 +3613,19 @@ ReadableByteStreamControllerPullSteps(JS
 
         RootedObject view(cx);
 
         if (stream->mode() == JS::ReadableStreamMode::ExternalSource) {
             val = controller->getFixedSlot(ControllerSlot_UnderlyingSource);
             void* underlyingSource = val.toPrivate();
 
             view = JS_NewUint8Array(cx, queueTotalSize);
-            if (!view)
+            if (!view) {
                 return nullptr;
+            }
 
             size_t bytesWritten;
             {
                 JS::AutoSuppressGCAnalysis suppressGC(cx);
                 JS::AutoCheckCannotGC noGC;
                 bool dummy;
                 void* buffer = JS_GetArrayBufferViewData(view, &dummy, noGC);
                 auto cb = cx->runtime()->readableStreamWriteIntoReadRequestCallback;
@@ -3481,35 +3649,38 @@ ReadableByteStreamControllerPullSteps(JS
 
             // Step 3.f: Let view be ! Construct(%Uint8Array%, « entry.[[buffer]],
             //                                   entry.[[byteOffset]], entry.[[byteLength]] »).
             // (reordered)
             RootedObject buffer(cx, entry->buffer());
 
             uint32_t byteOffset = entry->byteOffset();
             view = JS_NewUint8ArrayWithBuffer(cx, buffer, byteOffset, entry->byteLength());
-            if (!view)
+            if (!view) {
                 return nullptr;
+            }
         }
 
         // Step 3.d: Set this.[[queueTotalSize]] to
         //           this.[[queueTotalSize]] − entry.[[byteLength]].
         // (reordered)
         controller->setFixedSlot(QueueContainerSlot_TotalSize, Int32Value(queueTotalSize));
 
         // Step 3.e: Perform ! ReadableByteStreamControllerHandleQueueDrain(this).
         // (reordered)
-        if (!ReadableByteStreamControllerHandleQueueDrain(cx, controller))
+        if (!ReadableByteStreamControllerHandleQueueDrain(cx, controller)) {
             return nullptr;
+        }
 
         // Step 3.g: Return a promise resolved with ! CreateIterResultObject(view, false).
         val.setObject(*view);
         RootedObject iterResult(cx, CreateIterResultObject(cx, val, false));
-        if (!iterResult)
+        if (!iterResult) {
             return nullptr;
+        }
         val.setObject(*iterResult);
 
         return PromiseObject::unforgeableResolve(cx, val);
     }
 
     // Step 4: Let autoAllocateChunkSize be this.[[autoAllocateChunkSize]].
     val = controller->getFixedSlot(ByteControllerSlot_AutoAllocateSize);
 
@@ -3517,51 +3688,56 @@ ReadableByteStreamControllerPullSteps(JS
     if (!val.isUndefined()) {
         double autoAllocateChunkSize = val.toNumber();
 
         // Step 5.a: Let buffer be Construct(%ArrayBuffer%, « autoAllocateChunkSize »).
         RootedObject bufferObj(cx, JS_NewArrayBuffer(cx, autoAllocateChunkSize));
 
         // Step 5.b: If buffer is an abrupt completion,
         //           return a promise rejected with buffer.[[Value]].
-        if (!bufferObj)
+        if (!bufferObj) {
             return PromiseRejectedWithPendingError(cx);
+        }
 
         RootedArrayBufferObject buffer(cx, &bufferObj->as<ArrayBufferObject>());
 
         // Step 5.c: Let pullIntoDescriptor be Record {[[buffer]]: buffer.[[Value]],
         //                                             [[byteOffset]]: 0,
         //                                             [[byteLength]]: autoAllocateChunkSize,
         //                                             [[bytesFilled]]: 0, [[elementSize]]: 1,
         //                                             [[ctor]]: %Uint8Array%,
         //                                             [[readerType]]: `"default"`}.
         RootedObject pullIntoDescriptor(cx);
         pullIntoDescriptor = PullIntoDescriptor::create(cx, buffer, 0,
                                                         autoAllocateChunkSize, 0, 1,
                                                         nullptr,
                                                         ReaderType_Default);
-        if (!pullIntoDescriptor)
+        if (!pullIntoDescriptor) {
             return PromiseRejectedWithPendingError(cx);
+        }
 
         // Step 5.d: Append pullIntoDescriptor as the last element of this.[[pendingPullIntos]].
         val = controller->getFixedSlot(ByteControllerSlot_PendingPullIntos);
         RootedNativeObject pendingPullIntos(cx, &val.toObject().as<NativeObject>());
         val = ObjectValue(*pullIntoDescriptor);
-        if (!AppendToList(cx, pendingPullIntos, val))
+        if (!AppendToList(cx, pendingPullIntos, val)) {
             return nullptr;
+        }
     }
 
     // Step 6: Let promise be ! ReadableStreamAddReadRequest(stream).
     Rooted<PromiseObject*> promise(cx, ReadableStreamAddReadRequest(cx, stream));
-    if (!promise)
+    if (!promise) {
         return nullptr;
+    }
 
     // Step 7: Perform ! ReadableByteStreamControllerCallPullIfNeeded(this).
-    if (!ReadableStreamControllerCallPullIfNeeded(cx, controller))
+    if (!ReadableStreamControllerCallPullIfNeeded(cx, controller)) {
         return nullptr;
+    }
 
     // Step 8: Return promise.
     return promise;
 }
 
 /**
  * Unified implementation of ReadableStream controllers' [[PullSteps]] internal
  * methods.
@@ -3569,34 +3745,36 @@ ReadableByteStreamControllerPullSteps(JS
  * and
  * Streams spec, 3.10.5.2. [[PullSteps]] ()
  */
 static MOZ_MUST_USE JSObject*
 ReadableStreamControllerPullSteps(JSContext* cx, HandleNativeObject controller)
 {
     MOZ_ASSERT(IsReadableStreamController(controller));
 
-    if (controller->is<ReadableStreamDefaultController>())
+    if (controller->is<ReadableStreamDefaultController>()) {
         return ReadableStreamDefaultControllerPullSteps(cx, controller);
+    }
 
     return ReadableByteStreamControllerPullSteps(cx, controller);
 }
 
 
 static MOZ_MUST_USE ReadableStreamBYOBRequest*
 CreateReadableStreamBYOBRequest(JSContext* cx, Handle<ReadableByteStreamController*> controller,
                                 HandleObject view)
 {
     MOZ_ASSERT(controller);
     MOZ_ASSERT(JS_IsArrayBufferViewObject(view));
 
     Rooted<ReadableStreamBYOBRequest*> request(cx);
     request = NewBuiltinClassInstance<ReadableStreamBYOBRequest>(cx);
-    if (!request)
+    if (!request) {
         return nullptr;
+    }
 
   // Step 1: Set this.[[associatedReadableByteStreamController]] to controller.
   request->setFixedSlot(BYOBRequestSlot_Controller, ObjectValue(*controller));
 
   // Step 2: Set this.[[view]] to view.
   request->setFixedSlot(BYOBRequestSlot_View, ObjectValue(*view));
 
   return request;
@@ -3605,18 +3783,19 @@ CreateReadableStreamBYOBRequest(JSContex
 // Streams spec, 3.11.3. new ReadableStreamBYOBRequest ( controller, view )
 bool
 ReadableStreamBYOBRequest::constructor(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     HandleValue controllerVal = args.get(0);
     HandleValue viewVal = args.get(1);
 
-    if (!ThrowIfNotConstructing(cx, args, "ReadableStreamBYOBRequest"))
+    if (!ThrowIfNotConstructing(cx, args, "ReadableStreamBYOBRequest")) {
         return false;
+    }
 
     // TODO: open PR against spec to add these checks.
     // They're expected to have happened in code using requests.
     if (!Is<ReadableByteStreamController>(controllerVal)) {
         ReportArgTypeError(cx, "ReadableStreamBYOBRequest",
                            "ReadableByteStreamController", args.get(0));
         return false;
     }
@@ -3628,18 +3807,19 @@ ReadableStreamBYOBRequest::constructor(J
         ReportArgTypeError(cx, "ReadableStreamBYOBRequest", "ArrayBuffer view",
                            args.get(1));
         return false;
     }
 
     Rooted<ArrayBufferViewObject*> view(cx, &viewVal.toObject().as<ArrayBufferViewObject>());
 
     RootedObject request(cx, CreateReadableStreamBYOBRequest(cx, controller, view));
-    if (!request)
+    if (!request) {
         return false;
+    }
 
     args.rval().setObject(*request);
     return true;
 }
 
 // Streams spec, 3.11.4.1 get view
 static MOZ_MUST_USE bool
 ReadableStreamBYOBRequest_view_impl(JSContext* cx, const CallArgs& args)
@@ -3683,18 +3863,19 @@ ReadableStreamBYOBRequest_respond_impl(J
     }
 
     // Step 3: Return ?
     // ReadableByteStreamControllerRespond(this.[[associatedReadableByteStreamController]],
     //                                     bytesWritten).
     Rooted<ReadableByteStreamController*> controller(cx);
     controller = &controllerVal.toObject().as<ReadableByteStreamController>();
 
-    if (!ReadableByteStreamControllerRespond(cx, controller, bytesWritten))
+    if (!ReadableByteStreamControllerRespond(cx, controller, bytesWritten)) {
         return false;
+    }
 
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 ReadableStreamBYOBRequest_respond(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -3739,18 +3920,19 @@ ReadableStreamBYOBRequest_respondWithNew
 
     // Step 5: Return ?
     // ReadableByteStreamControllerRespondWithNewView(this.[[associatedReadableByteStreamController]],
     //                                                view).
     Rooted<ReadableByteStreamController*> controller(cx);
     controller = &controllerVal.toObject().as<ReadableByteStreamController>();
     RootedObject view(cx, &viewVal.toObject());
 
-    if (!ReadableByteStreamControllerRespondWithNewView(cx, controller, view))
+    if (!ReadableByteStreamControllerRespondWithNewView(cx, controller, view)) {
         return false;
+    }
 
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 ReadableStreamBYOBRequest_respondWithNewView(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -3834,21 +4016,23 @@ ReadableByteStreamControllerClose(JSCont
 
         // Step b: If firstPendingPullInto.[[bytesFilled]] > 0,
         if (firstPendingPullInto->bytesFilled() > 0) {
             // Step i: Let e be a new TypeError exception. {
             JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                       JSMSG_READABLEBYTESTREAMCONTROLLER_CLOSE_PENDING_PULL);
             RootedValue e(cx);
             // Not much we can do about uncatchable exceptions, just bail.
-            if (!cx->getPendingException(&e))
+            if (!cx->getPendingException(&e)) {
                 return false;
+            }
             // Step ii: Perform ! ReadableByteStreamControllerError(controller, e).
-            if (!ReadableStreamControllerError(cx, controller, e))
+            if (!ReadableStreamControllerError(cx, controller, e)) {
                 return false;
+            }
 
             // Step iii: Throw e.
             return false;
         }
     }
 
     // Step 6: Perform ! ReadableStreamClose(stream).
     return ReadableStreamCloseInternal(cx, stream);
@@ -3877,34 +4061,37 @@ ReadableByteStreamControllerCommitPullIn
         // Step b: Set done to true.
         done = true;
     }
 
     // Step 4: Let filledView be
     //         ! ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor).
     RootedObject filledView(cx);
     filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(cx, pullIntoDescriptor);
-    if (!filledView)
+    if (!filledView) {
         return false;
+    }
 
     // Step 5: If pullIntoDescriptor.[[readerType]] is "default",
     uint32_t readerType = pullIntoDescriptor->readerType();
     RootedValue filledViewVal(cx, ObjectValue(*filledView));
     if (readerType == ReaderType_Default) {
         // Step a: Perform ! ReadableStreamFulfillReadRequest(stream, filledView, done).
-        if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, stream, filledViewVal, done))
+        if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, stream, filledViewVal, done)) {
             return false;
+        }
     } else {
         // Step 6: Otherwise,
         // Step a: MOZ_ASSERT: pullIntoDescriptor.[[readerType]] is "byob".
         MOZ_ASSERT(readerType == ReaderType_BYOB);
 
         // Step b: Perform ! ReadableStreamFulfillReadIntoRequest(stream, filledView, done).
-        if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, stream, filledViewVal, done))
+        if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, stream, filledViewVal, done)) {
             return false;
+        }
     }
 
     return true;
 }
 
 // Streams spec, 3.12.7. ReadableByteStreamControllerConvertPullIntoDescriptor ( pullIntoDescriptor )
 static MOZ_MUST_USE JSObject*
 ReadableByteStreamControllerConvertPullIntoDescriptor(JSContext* cx,
@@ -3924,18 +4111,19 @@ ReadableByteStreamControllerConvertPullI
 
     // Step 5: Return ! Construct(pullIntoDescriptor.[[ctor]],
     //                            pullIntoDescriptor.[[buffer]],
     //                            pullIntoDescriptor.[[byteOffset]],
     //                            bytesFilled / elementSize).
     RootedObject ctor(cx, pullIntoDescriptor->ctor());
     if (!ctor) {
         ctor = GlobalObject::getOrCreateConstructor(cx, JSProto_Uint8Array);
-        if (!ctor)
+        if (!ctor) {
             return nullptr;
+        }
     }
     RootedObject buffer(cx, pullIntoDescriptor->buffer());
     uint32_t byteOffset = pullIntoDescriptor->byteOffset();
     FixedConstructArgs<3> args(cx);
     args[0].setObject(*buffer);
     args[1].setInt32(byteOffset);
     args[2].setInt32(bytesFilled / elementSize);
     return JS_New(cx, ctor, args);
@@ -3983,31 +4171,33 @@ ReadableByteStreamControllerEnqueue(JSCo
         // Steps 4-6 for ArrayBuffer objects.
         buffer = &chunk->as<ArrayBufferObject>();
         byteOffset = 0;
         byteLength = buffer->byteLength();
     } else {
         // Step 4: Let buffer be chunk.[[ViewedArrayBuffer]].
         bool dummy;
         JSObject* bufferObj = JS_GetArrayBufferViewBuffer(cx, chunk, &dummy);
-        if (!bufferObj)
+        if (!bufferObj) {
             return false;
+        }
         buffer = &bufferObj->as<ArrayBufferObject>();
 
         // Step 5: Let byteOffset be chunk.[[ByteOffset]].
         byteOffset = JS_GetArrayBufferViewByteOffset(chunk);
 
         // Step 6: Let byteLength be chunk.[[ByteLength]].
         byteLength = JS_GetArrayBufferViewByteLength(chunk);
     }
 
     // Step 7: Let transferredBuffer be ! TransferArrayBuffer(buffer).
     RootedArrayBufferObject transferredBuffer(cx, TransferArrayBuffer(cx, buffer));
-    if (!transferredBuffer)
+    if (!transferredBuffer) {
         return false;
+    }
 
     // Step 8: If ! ReadableStreamHasDefaultReader(stream) is true
     if (ReadableStreamHasDefaultReader(stream)) {
         // Step a: If ! ReadableStreamGetNumReadRequests(stream) is 0,
         if (ReadableStreamGetNumReadRequests(stream) == 0) {
             // Step i: Perform
             //         ! ReadableByteStreamControllerEnqueueChunkToQueue(controller,
             //                                                           transferredBuffer,
@@ -4026,41 +4216,44 @@ ReadableByteStreamControllerEnqueue(JSCo
             RootedNativeObject queue(cx, &val.toObject().as<NativeObject>());
             MOZ_ASSERT(queue->getDenseInitializedLength() == 0);
 #endif // DEBUG
 
             // Step ii: Let transferredView be
             //          ! Construct(%Uint8Array%, transferredBuffer, byteOffset, byteLength).
             RootedObject transferredView(cx, JS_NewUint8ArrayWithBuffer(cx, transferredBuffer,
                                                                         byteOffset, byteLength));
-            if (!transferredView)
+            if (!transferredView) {
                 return false;
+            }
 
             // Step iii: Perform ! ReadableStreamFulfillReadRequest(stream, transferredView, false).
             RootedValue chunk(cx, ObjectValue(*transferredView));
-            if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, stream, chunk, false))
+            if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, stream, chunk, false)) {
                 return false;
+            }
         }
     } else if (ReadableStreamHasBYOBReader(stream)) {
         // Step 9: Otherwise,
         // Step a: If ! ReadableStreamHasBYOBReader(stream) is true,
         // Step i: Perform
         //         ! ReadableByteStreamControllerEnqueueChunkToQueue(controller,
         //                                                           transferredBuffer,
         //                                                           byteOffset,
         //                                                           byteLength).
         if (!ReadableByteStreamControllerEnqueueChunkToQueue(cx, controller, transferredBuffer,
                                                              byteOffset, byteLength))
         {
             return false;
         }
 
         // Step ii: Perform ! ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller).
-        if (!ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(cx, controller))
+        if (!ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(cx, controller)) {
             return false;
+        }
     } else {
         // Step b: Otherwise,
         // Step i: Assert: ! IsReadableStreamLocked(stream) is false.
         MOZ_ASSERT(!stream->locked());
 
         // Step ii: Perform
         //          ! ReadableByteStreamControllerEnqueueChunkToQueue(controller,
         //                                                            transferredBuffer,
@@ -4091,22 +4284,24 @@ ReadableByteStreamControllerEnqueueChunk
     //                        [[byteOffset]]: byteOffset,
     //                        [[byteLength]]: byteLength}
     //         as the last element of controller.[[queue]].
     RootedValue val(cx, controller->getFixedSlot(QueueContainerSlot_Queue));
     RootedNativeObject queue(cx, &val.toObject().as<NativeObject>());
 
     Rooted<ByteStreamChunk*> chunk(cx);
     chunk = ByteStreamChunk::create(cx, buffer, byteOffset, byteLength);
-    if (!chunk)
+    if (!chunk) {
         return false;
+    }
 
     RootedValue chunkVal(cx, ObjectValue(*chunk));
-    if (!AppendToList(cx, queue, chunkVal))
+    if (!AppendToList(cx, queue, chunkVal)) {
         return false;
+    }
 
     // Step 2: Add byteLength to controller.[[queueTotalSize]].
     double queueTotalSize = controller->getFixedSlot(QueueContainerSlot_TotalSize).toNumber();
     controller->setFixedSlot(QueueContainerSlot_TotalSize,
                              NumberValue(queueTotalSize + byteLength));
 
     return true;
 }
@@ -4184,18 +4379,19 @@ ReadableByteStreamControllerFillPullInto
         *ready = true;
     }
 
     if (ControllerFlags(controller) & ControllerFlag_ExternalSource) {
         // TODO: it probably makes sense to eagerly drain the underlying source.
         // We have a buffer lying around anyway, whereas the source might be
         // able to free or reuse buffers once their content is copied into
         // our buffer.
-        if (!ready)
+        if (!ready) {
             return true;
+        }
 
         Value val = controller->getFixedSlot(ControllerSlot_UnderlyingSource);
         void* underlyingSource = val.toPrivate();
 
         RootedArrayBufferObject targetBuffer(cx, pullIntoDescriptor->buffer());
         Rooted<ReadableStream*> stream(cx, StreamFromController(controller));
 
         size_t bytesWritten;
@@ -4332,18 +4528,19 @@ ReadableByteStreamControllerHandleQueueD
 // Streams spec 3.12.15. ReadableByteStreamControllerInvalidateBYOBRequest ( controller )
 static void
 ReadableByteStreamControllerInvalidateBYOBRequest(NativeObject* controller)
 {
     MOZ_ASSERT(controller->is<ReadableByteStreamController>());
 
     // Step 1: If controller.[[byobRequest]] is undefined, return.
     Value byobRequestVal = controller->getFixedSlot(ByteControllerSlot_BYOBRequest);
-    if (byobRequestVal.isUndefined())
+    if (byobRequestVal.isUndefined()) {
         return;
+    }
 
     NativeObject* byobRequest = &byobRequestVal.toObject().as<NativeObject>();
     // Step 2: Set controller.[[byobRequest]].[[associatedReadableByteStreamController]]
     //         to undefined.
     byobRequest->setFixedSlot(BYOBRequestSlot_Controller, UndefinedValue());
 
     // Step 3: Set controller.[[byobRequest]].[[view]] to undefined.
     byobRequest->setFixedSlot(BYOBRequestSlot_View, UndefinedValue());
@@ -4368,36 +4565,38 @@ ReadableByteStreamControllerProcessPullI
     // Step 2: Repeat the following steps while controller.[[pendingPullIntos]]
     //         is not empty,
     RootedValue val(cx, controller->getFixedSlot(ByteControllerSlot_PendingPullIntos));
     RootedNativeObject pendingPullIntos(cx, &val.toObject().as<NativeObject>());
     Rooted<PullIntoDescriptor*> pullIntoDescriptor(cx);
     while (pendingPullIntos->getDenseInitializedLength() != 0) {
         // Step a: If controller.[[queueTotalSize]] is 0, return.
         double queueTotalSize = controller->getFixedSlot(QueueContainerSlot_TotalSize).toNumber();
-        if (queueTotalSize == 0)
+        if (queueTotalSize == 0) {
             return true;
+        }
 
         // Step b: Let pullIntoDescriptor be the first element of
         //         controller.[[pendingPullIntos]].
         pullIntoDescriptor = PeekList<PullIntoDescriptor>(pendingPullIntos);
 
         // Step c: If ! ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor)
         //         is true,
         bool ready;
         if (!ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(cx, controller,
                                                                          pullIntoDescriptor,
                                                                          &ready))
         {
             return false;
         }
         if (ready) {
             // Step i: Perform ! ReadableByteStreamControllerShiftPendingPullInto(controller).
-            if (!ReadableByteStreamControllerShiftPendingPullInto(cx, controller))
+            if (!ReadableByteStreamControllerShiftPendingPullInto(cx, controller)) {
                 return false;
+            }
 
             // Step ii: Perform ! ReadableByteStreamControllerCommitPullIntoDescriptor(controller.[[controlledReadableStream]],
             //                                                                         pullIntoDescriptor).
             if (!ReadableByteStreamControllerCommitPullIntoDescriptor(cx, stream,
                                                                       pullIntoDescriptor))
             {
                 return false;
             }
@@ -4424,87 +4623,95 @@ ReadableByteStreamControllerPullInto(JSC
     RootedObject ctor(cx);
     // Step 4: If view has a [[TypedArrayName]] internal slot (i.e., it is not a
     //         DataView),
     if (view->is<TypedArrayObject>()) {
         JSProtoKey protoKey = StandardProtoKeyOrNull(view);
         MOZ_ASSERT(protoKey);
 
         ctor = GlobalObject::getOrCreateConstructor(cx, protoKey);
-        if (!ctor)
+        if (!ctor) {
             return nullptr;
+        }
         elementSize = 1 << TypedArrayShift(view->as<TypedArrayObject>().type());
     } else {
         // Step 3: Let ctor be %DataView% (reordered).
         ctor = GlobalObject::getOrCreateConstructor(cx, JSProto_DataView);
-        if (!ctor)
+        if (!ctor) {
             return nullptr;
+        }
     }
 
     // Step 5: Let pullIntoDescriptor be Record {[[buffer]]: view.[[ViewedArrayBuffer]],
     //                                           [[byteOffset]]: view.[[ByteOffset]],
     //                                           [[byteLength]]: view.[[ByteLength]],
     //                                           [[bytesFilled]]: 0,
     //                                           [[elementSize]]: elementSize,
     //                                           [[ctor]]: ctor,
     //                                           [[readerType]]: "byob"}.
     bool dummy;
     RootedArrayBufferObject buffer(cx, &JS_GetArrayBufferViewBuffer(cx, view, &dummy)
                                        ->as<ArrayBufferObject>());
-    if (!buffer)
+    if (!buffer) {
         return nullptr;
+    }
 
     uint32_t byteOffset = JS_GetArrayBufferViewByteOffset(view);
     uint32_t byteLength = JS_GetArrayBufferViewByteLength(view);
     Rooted<PullIntoDescriptor*> pullIntoDescriptor(cx);
     pullIntoDescriptor = PullIntoDescriptor::create(cx, buffer, byteOffset, byteLength, 0,
                                                     elementSize, ctor,
                                                     ReaderType_BYOB);
-    if (!pullIntoDescriptor)
+    if (!pullIntoDescriptor) {
         return nullptr;
+    }
 
     // Step 6: If controller.[[pendingPullIntos]] is not empty,
     RootedValue val(cx, controller->getFixedSlot(ByteControllerSlot_PendingPullIntos));
     RootedNativeObject pendingPullIntos(cx, &val.toObject().as<NativeObject>());
     if (pendingPullIntos->getDenseInitializedLength() != 0) {
         // Step a: Set pullIntoDescriptor.[[buffer]] to
         //         ! TransferArrayBuffer(pullIntoDescriptor.[[buffer]]).
         RootedArrayBufferObject transferredBuffer(cx, TransferArrayBuffer(cx, buffer));
-        if (!transferredBuffer)
+        if (!transferredBuffer) {
             return nullptr;
+        }
         pullIntoDescriptor->setBuffer(transferredBuffer);
 
         // Step b: Append pullIntoDescriptor as the last element of
         //         controller.[[pendingPullIntos]].
         val = ObjectValue(*pullIntoDescriptor);
-        if (!AppendToList(cx, pendingPullIntos, val))
+        if (!AppendToList(cx, pendingPullIntos, val)) {
             return nullptr;
+        }
 
         // Step c: Return ! ReadableStreamAddReadIntoRequest(stream).
         return ReadableStreamAddReadIntoRequest(cx, stream);
     }
 
     // Step 7: If stream.[[state]] is "closed",
     if (stream->closed()) {
         // Step a: Let emptyView be ! Construct(ctor, pullIntoDescriptor.[[buffer]],
         //                                            pullIntoDescriptor.[[byteOffset]], 0).
         FixedConstructArgs<3> args(cx);
         args[0].setObject(*buffer);
         args[1].setInt32(byteOffset);
         args[2].setInt32(0);
         RootedObject emptyView(cx, JS_New(cx, ctor, args));
-        if (!emptyView)
+        if (!emptyView) {
             return nullptr;
+        }
 
         // Step b: Return a promise resolved with
         //         ! CreateIterResultObject(emptyView, true).
         RootedValue val(cx, ObjectValue(*emptyView));
         RootedObject iterResult(cx, CreateIterResultObject(cx, val, true));
-        if (!iterResult)
+        if (!iterResult) {
             return nullptr;
+        }
         val = ObjectValue(*iterResult);
         return PromiseObject::unforgeableResolve(cx, val);
     }
 
     // Step 8: If controller.[[queueTotalSize]] > 0,
     double queueTotalSize = controller->getFixedSlot(QueueContainerSlot_TotalSize).toNumber();
     if (queueTotalSize > 0) {
         // Step a: If ! ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller,
@@ -4518,74 +4725,83 @@ ReadableByteStreamControllerPullInto(JSC
         }
 
         if (ready) {
             // Step i: Let filledView be
             //         ! ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor).
             RootedObject filledView(cx);
             filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(cx,
                                                                                pullIntoDescriptor);
-            if (!filledView)
+            if (!filledView) {
                 return nullptr;
+            }
 
             // Step ii: Perform ! ReadableByteStreamControllerHandleQueueDrain(controller).
-            if (!ReadableByteStreamControllerHandleQueueDrain(cx, controller))
+            if (!ReadableByteStreamControllerHandleQueueDrain(cx, controller)) {
                 return nullptr;
+            }
 
             // Step iii: Return a promise resolved with
             //           ! CreateIterResultObject(filledView, false).
             val = ObjectValue(*filledView);
             RootedObject iterResult(cx, CreateIterResultObject(cx, val, false));
-            if (!iterResult)
+            if (!iterResult) {
                 return nullptr;
+            }
             val = ObjectValue(*iterResult);
             return PromiseObject::unforgeableResolve(cx, val);
         }
 
         // Step b: If controller.[[closeRequested]] is true,
         if (ControllerFlags(controller) & ControllerFlag_CloseRequested) {
             // Step i: Let e be a TypeError exception.
             JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                       JSMSG_READABLESTREAMCONTROLLER_CLOSED, "read");
 
             // Not much we can do about uncatchable exceptions, just bail.
             RootedValue e(cx);
-            if (!GetAndClearException(cx, &e))
+            if (!GetAndClearException(cx, &e)) {
                 return nullptr;
+            }
 
             // Step ii: Perform ! ReadableByteStreamControllerError(controller, e).
-            if (!ReadableStreamControllerError(cx, controller, e))
+            if (!ReadableStreamControllerError(cx, controller, e)) {
                 return nullptr;
+            }
 
             // Step iii: Return a promise rejected with e.
             return PromiseObject::unforgeableReject(cx, e);
         }
     }
 
     // Step 9: Set pullIntoDescriptor.[[buffer]] to
     //         ! TransferArrayBuffer(pullIntoDescriptor.[[buffer]]).
     RootedArrayBufferObject transferredBuffer(cx, TransferArrayBuffer(cx, buffer));
-    if (!transferredBuffer)
+    if (!transferredBuffer) {
         return nullptr;
+    }
     pullIntoDescriptor->setBuffer(transferredBuffer);
 
     // Step 10: Append pullIntoDescriptor as the last element of
     //          controller.[[pendingPullIntos]].
     val = ObjectValue(*pullIntoDescriptor);
-    if (!AppendToList(cx, pendingPullIntos, val))
+    if (!AppendToList(cx, pendingPullIntos, val)) {
         return nullptr;
+    }
 
     // Step 11: Let promise be ! ReadableStreamAddReadIntoRequest(stream).
     Rooted<PromiseObject*> promise(cx, ReadableStreamAddReadIntoRequest(cx, stream));
-    if (!promise)
+    if (!promise) {
         return nullptr;
+    }
 
     // Step 12: Perform ! ReadableByteStreamControllerCallPullIfNeeded(controller).
-    if (!ReadableStreamControllerCallPullIfNeeded(cx, controller))
+    if (!ReadableStreamControllerCallPullIfNeeded(cx, controller)) {
         return nullptr;
+    }
 
     // Step 13: Return promise.
     return promise;
 }
 
 static MOZ_MUST_USE bool
 ReadableByteStreamControllerRespondInternal(JSContext* cx,
                                             Handle<ReadableByteStreamController*> controller,
@@ -4596,18 +4812,19 @@ static MOZ_MUST_USE bool
 ReadableByteStreamControllerRespond(JSContext* cx,
                                     Handle<ReadableByteStreamController*> controller,
                                     HandleValue bytesWrittenVal)
 {
     MOZ_ASSERT(controller->is<ReadableByteStreamController>());
 
     // Step 1: Let bytesWritten be ? ToNumber(bytesWritten).
     double bytesWritten;
-    if (!ToNumber(cx, bytesWrittenVal, &bytesWritten))
+    if (!ToNumber(cx, bytesWrittenVal, &bytesWritten)) {
         return false;
+    }
 
     // Step 2: If ! IsFiniteNonNegativeNumber(bytesWritten) is false,
     if (bytesWritten < 0 || mozilla::IsNaN(bytesWritten) || mozilla::IsInfinite(bytesWritten)) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_NUMBER_MUST_BE_FINITE_NON_NEGATIVE, "bytesWritten");
         return false;
     }
 
@@ -4627,18 +4844,19 @@ static MOZ_MUST_USE bool
 ReadableByteStreamControllerRespondInClosedState(JSContext* cx,
                                                    Handle<ReadableByteStreamController*> controller,
                                                    Handle<PullIntoDescriptor*> firstDescriptor)
 {
     // Step 1: Set firstDescriptor.[[buffer]] to
     //         ! TransferArrayBuffer(firstDescriptor.[[buffer]]).
     RootedArrayBufferObject buffer(cx, firstDescriptor->buffer());
     RootedArrayBufferObject transferredBuffer(cx, TransferArrayBuffer(cx, buffer));
-    if (!transferredBuffer)
+    if (!transferredBuffer) {
         return false;
+    }
     firstDescriptor->setBuffer(transferredBuffer);
 
     // Step 2: Assert: firstDescriptor.[[bytesFilled]] is 0.
     MOZ_ASSERT(firstDescriptor->bytesFilled() == 0);
 
     // Step 3: Let stream be controller.[[controlledReadableStream]].
     Rooted<ReadableStream*> stream(cx, StreamFromController(controller));
 
@@ -4646,24 +4864,26 @@ ReadableByteStreamControllerRespondInClo
     if (ReadableStreamHasBYOBReader(stream)) {
         // Step a: Repeat the following steps while
         //         ! ReadableStreamGetNumReadIntoRequests(stream) > 0,
         Rooted<PullIntoDescriptor*> descriptor(cx);
         while (ReadableStreamGetNumReadRequests(stream) > 0) {
             // Step i: Let pullIntoDescriptor be
             //         ! ReadableByteStreamControllerShiftPendingPullInto(controller).
             descriptor = ReadableByteStreamControllerShiftPendingPullInto(cx, controller);
-            if (!descriptor)
+            if (!descriptor) {
                 return false;
+            }
 
             // Step ii: Perform !
             //          ReadableByteStreamControllerCommitPullIntoDescriptor(stream,
             //                                                               pullIntoDescriptor).
-            if (!ReadableByteStreamControllerCommitPullIntoDescriptor(cx, stream, descriptor))
+            if (!ReadableByteStreamControllerCommitPullIntoDescriptor(cx, stream, descriptor)) {
                 return false;
+            }
         }
     }
 
     return true;
 }
 
 // Streams spec 3.12.20.
 // ReadableByteStreamControllerRespondInReadableState( controller, bytesWritten, pullIntoDescriptor )
@@ -4688,22 +4908,24 @@ ReadableByteStreamControllerRespondInRea
     //                                                                          pullIntoDescriptor).
     ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten,
                                                            pullIntoDescriptor);
     bytesFilled += bytesWritten;
 
     // Step 3: If pullIntoDescriptor.[[bytesFilled]] <
     //         pullIntoDescriptor.[[elementSize]], return.
     uint32_t elementSize = pullIntoDescriptor->elementSize();
-    if (bytesFilled < elementSize)
+    if (bytesFilled < elementSize) {
         return true;
+    }
 
     // Step 4: Perform ! ReadableByteStreamControllerShiftPendingPullInto(controller).
-    if (!ReadableByteStreamControllerShiftPendingPullInto(cx, controller))
+    if (!ReadableByteStreamControllerShiftPendingPullInto(cx, controller)) {
         return false;
+    }
 
     // Step 5: Let remainderSize be pullIntoDescriptor.[[bytesFilled]] mod
     //         pullIntoDescriptor.[[elementSize]].
     uint32_t remainderSize = bytesFilled % elementSize;
 
     // Step 6: If remainderSize > 0,
     RootedArrayBufferObject buffer(cx, pullIntoDescriptor->buffer());
     if (remainderSize > 0) {
@@ -4711,18 +4933,19 @@ ReadableByteStreamControllerRespondInRea
         //         pullIntoDescriptor.[[bytesFilled]].
         uint32_t end = pullIntoDescriptor->byteOffset() + bytesFilled;
 
         // Step b: Let remainder be ? CloneArrayBuffer(pullIntoDescriptor.[[buffer]],
         //                                             end − remainderSize,
         //                                             remainderSize, %ArrayBuffer%).
         // TODO: this really, really should just use a slot to store the remainder.
         RootedObject remainderObj(cx, JS_NewArrayBuffer(cx, remainderSize));
-        if (!remainderObj)
+        if (!remainderObj) {
             return false;
+        }
         RootedArrayBufferObject remainder(cx, &remainderObj->as<ArrayBufferObject>());
         ArrayBufferObject::copyData(remainder, 0, buffer, end - remainderSize, remainderSize);
 
         // Step c: Perform ! ReadableByteStreamControllerEnqueueChunkToQueue(controller,
         //                                                                   remainder, 0,
         //                                                                   remainder.[[ByteLength]]).
         // Note: `remainderSize` is equivalent to remainder.[[ByteLength]].
         if (!ReadableByteStreamControllerEnqueueChunkToQueue(cx, controller, remainder, 0,
@@ -4730,29 +4953,31 @@ ReadableByteStreamControllerRespondInRea
         {
             return false;
         }
     }
 
     // Step 7: Set pullIntoDescriptor.[[buffer]] to
     //         ! TransferArrayBuffer(pullIntoDescriptor.[[buffer]]).
     RootedArrayBufferObject transferredBuffer(cx, TransferArrayBuffer(cx, buffer));
-    if (!transferredBuffer)
+    if (!transferredBuffer) {
         return false;
+    }
     pullIntoDescriptor->setBuffer(transferredBuffer);
 
     // Step 8: Set pullIntoDescriptor.[[bytesFilled]] to pullIntoDescriptor.[[bytesFilled]] −
     //         remainderSize.
     pullIntoDescriptor->setBytesFilled(bytesFilled - remainderSize);
 
     // Step 9: Perform ! ReadableByteStreamControllerCommitPullIntoDescriptor(controller.[[controlledReadableStream]],
     //                                                                        pullIntoDescriptor).
     Rooted<ReadableStream*> stream(cx, StreamFromController(controller));
-    if (!ReadableByteStreamControllerCommitPullIntoDescriptor(cx, stream, pullIntoDescriptor))
+    if (!ReadableByteStreamControllerCommitPullIntoDescriptor(cx, stream, pullIntoDescriptor)) {
         return false;
+    }
 
     // Step 10: Perform ! ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller).
     return ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(cx, controller);
 }
 
 // Streams spec, 3.12.21. ReadableByteStreamControllerRespondInternal ( controller, bytesWritten )
 static MOZ_MUST_USE bool
 ReadableByteStreamControllerRespondInternal(JSContext* cx,
@@ -4825,18 +5050,19 @@ ReadableByteStreamControllerRespondWithN
                                   JSMSG_READABLEBYTESTREAMCONTROLLER_INVALID_VIEW_SIZE);
         return false;
     }
 
     // Step 5: Set firstDescriptor.[[buffer]] to view.[[ViewedArrayBuffer]].
     bool dummy;
     RootedArrayBufferObject buffer(cx,
                                    &AsArrayBuffer(JS_GetArrayBufferViewBuffer(cx, view, &dummy)));
-    if (!buffer)
+    if (!buffer) {
         return false;
+    }
     firstDescriptor->setBuffer(buffer);
 
     // Step 6: Perform ? ReadableByteStreamControllerRespondInternal(controller,
     //                                                               view.[[ByteLength]]).
     return ReadableByteStreamControllerRespondInternal(cx, controller, byteLength);
 }
 
 // Streams spec, 3.12.23. ReadableByteStreamControllerShiftPendingPullInto ( controller )
@@ -4867,29 +5093,33 @@ ReadableByteStreamControllerShiftPending
 
 // Streams spec, 6.1.2. new ByteLengthQueuingStrategy({ highWaterMark })
 bool
 js::ByteLengthQueuingStrategy::constructor(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     RootedObject strategy(cx, NewBuiltinClassInstance<ByteLengthQueuingStrategy>(cx));
-    if (!strategy)
+    if (!strategy) {
         return false;
+    }
 
     RootedObject argObj(cx, ToObject(cx, args.get(0)));
-    if (!argObj)
+    if (!argObj) {
       return false;
+    }
 
     RootedValue highWaterMark(cx);
-    if (!GetProperty(cx, argObj, argObj, cx->names().highWaterMark, &highWaterMark))
+    if (!GetProperty(cx, argObj, argObj, cx->names().highWaterMark, &highWaterMark)) {
       return false;
-
-    if (!SetProperty(cx, strategy, cx->names().highWaterMark, highWaterMark))
+    }
+
+    if (!SetProperty(cx, strategy, cx->names().highWaterMark, highWaterMark)) {
       return false;
+    }
 
     args.rval().setObject(*strategy);
     return true;
 }
 
 // Streams spec 6.1.3.1. size ( chunk )
 bool
 ByteLengthQueuingStrategy_size(JSContext* cx, unsigned argc, Value* vp)
@@ -4913,29 +5143,33 @@ CLASS_SPEC(ByteLengthQueuingStrategy, 1,
 
 // Streams spec, 6.2.2. new CountQueuingStrategy({ highWaterMark })
 bool
 js::CountQueuingStrategy::constructor(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     Rooted<CountQueuingStrategy*> strategy(cx, NewBuiltinClassInstance<CountQueuingStrategy>(cx));
-    if (!strategy)
+    if (!strategy) {
         return false;
+    }
 
     RootedObject argObj(cx, ToObject(cx, args.get(0)));
-    if (!argObj)
+    if (!argObj) {
       return false;
+    }
 
     RootedValue highWaterMark(cx);
-    if (!GetProperty(cx, argObj, argObj, cx->names().highWaterMark, &highWaterMark))
+    if (!GetProperty(cx, argObj, argObj, cx->names().highWaterMark, &highWaterMark)) {
       return false;
-
-    if (!SetProperty(cx, strategy, cx->names().highWaterMark, highWaterMark))
+    }
+
+    if (!SetProperty(cx, strategy, cx->names().highWaterMark, highWaterMark)) {
       return false;
+    }
 
     args.rval().setObject(*strategy);
     return true;
 }
 
 // Streams spec 6.2.3.1. size ( chunk )
 bool
 CountQueuingStrategy_size(JSContext* cx, unsigned argc, Value* vp)
@@ -4982,18 +5216,19 @@ DequeueValue(JSContext* cx, HandleNative
     // Step 5: Set container.[[queueTotalSize]] to
     //         container.[[queueTotalSize]] − pair.[[size]].
     // Step 6: If container.[[queueTotalSize]] < 0, set
     //         container.[[queueTotalSize]] to 0.
     //         (This can occur due to rounding errors.)
     double totalSize = container->getFixedSlot(QueueContainerSlot_TotalSize).toNumber();
 
     totalSize -= pair->size();
-    if (totalSize < 0)
+    if (totalSize < 0) {
         totalSize = 0;
+    }
     container->setFixedSlot(QueueContainerSlot_TotalSize, NumberValue(totalSize));
 
     // Step 7: Return pair.[[value]].
     chunk.set(pair->value());
     return true;
 }
 
 // Streams spec, 6.3.2. EnqueueValueWithSize ( container, value, size ) throws
@@ -5002,38 +5237,41 @@ EnqueueValueWithSize(JSContext* cx, Hand
                      HandleValue sizeVal)
 {
     // Step 1: Assert: container has [[queue]] and [[queueTotalSize]] internal
     //         slots.
     MOZ_ASSERT(IsReadableStreamController(container));
 
     // Step 2: Let size be ? ToNumber(size).
     double size;
-    if (!ToNumber(cx, sizeVal, &size))
+    if (!ToNumber(cx, sizeVal, &size)) {
         return false;
+    }
 
     // Step 3: If ! IsFiniteNonNegativeNumber(size) is false, throw a RangeError
     //         exception.
     if (size < 0 || mozilla::IsNaN(size) || mozilla::IsInfinite(size)) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
                                   JSMSG_NUMBER_MUST_BE_FINITE_NON_NEGATIVE, "size");
         return false;
     }
 
     // Step 4: Append Record {[[value]]: value, [[size]]: size} as the last element
     //         of container.[[queue]].
     RootedValue val(cx, container->getFixedSlot(QueueContainerSlot_Queue));
     RootedNativeObject queue(cx, &val.toObject().as<NativeObject>());
 
     QueueEntry* entry = QueueEntry::create(cx, value, size);
-    if (!entry)
+    if (!entry) {
         return false;
+    }
     val = ObjectValue(*entry);
-    if (!AppendToList(cx, queue, val))
+    if (!AppendToList(cx, queue, val)) {
         return false;
+    }
 
     // Step 5: Set container.[[queueTotalSize]] to
     //         container.[[queueTotalSize]] + size.
     double totalSize = container->getFixedSlot(QueueContainerSlot_TotalSize).toNumber();
     container->setFixedSlot(QueueContainerSlot_TotalSize, NumberValue(totalSize + size));
 
     return true;
 }
@@ -5065,18 +5303,19 @@ EnqueueValueWithSize(JSContext* cx, Hand
 inline static MOZ_MUST_USE bool
 ResetQueue(JSContext* cx, HandleNativeObject container)
 {
     // Step 1: Assert: container has [[queue]] and [[queueTotalSize]] internal
     //         slots.
     MOZ_ASSERT(IsReadableStreamController(container));
 
     // Step 2: Set container.[[queue]] to a new empty List.
-    if (!SetNewList(cx, container, QueueContainerSlot_Queue))
+    if (!SetNewList(cx, container, QueueContainerSlot_Queue)) {
         return false;
+    }
 
     // Step 3: Set container.[[queueTotalSize]] to 0.
     container->setFixedSlot(QueueContainerSlot_TotalSize, NumberValue(0));
 
     return true;
 }
 
 
@@ -5086,22 +5325,24 @@ ResetQueue(JSContext* cx, HandleNativeOb
 inline static MOZ_MUST_USE bool
 InvokeOrNoop(JSContext* cx, HandleValue O, HandlePropertyName P, HandleValue arg,
              MutableHandleValue rval)
 {
     // Step 1: Assert: P is a valid property key (omitted).
     // Step 2: If args was not passed, let args be a new empty List (omitted).
     // Step 3: Let method be ? GetV(O, P).
     RootedValue method(cx);
-    if (!GetProperty(cx, O, P, &method))
+    if (!GetProperty(cx, O, P, &method)) {
         return false;
+    }
 
     // Step 4: If method is undefined, return.
-    if (method.isUndefined())
+    if (method.isUndefined()) {
         return true;
+    }
 
     // Step 5: Return ? Call(method, O, args).
     return Call(cx, method, O, arg, rval);
 }
 
 /**
  * Streams spec, 6.4.3. PromiseInvokeOrNoop ( O, P, args )
  * Specialized to one arg, because that's what all stream related callers use.
@@ -5114,18 +5355,19 @@ PromiseInvokeOrNoop(JSContext* cx, Handl
 
     // Step 2: Assert: ! IsPropertyKey(P) is true (implicit).
     // Step 3: Assert: args is a List (omitted).
 
     // Step 4: Let returnValue be InvokeOrNoop(O, P, args).
     // Step 5: If returnValue is an abrupt completion, return a promise
     //         rejected with returnValue.[[Value]].
     RootedValue returnValue(cx);
-    if (!InvokeOrNoop(cx, O, P, arg, &returnValue))
+    if (!InvokeOrNoop(cx, O, P, arg, &returnValue)) {
         return PromiseRejectedWithPendingError(cx);
+    }
 
     // Step 6: Otherwise, return a promise resolved with returnValue.[[Value]].
     return PromiseObject::unforgeableResolve(cx, returnValue);
 }
 
 /**
  * Streams spec, 6.4.4 TransferArrayBuffer ( O )
  */
@@ -5140,34 +5382,37 @@ TransferArrayBuffer(JSContext* cx, Handl
     // Step 3.
     MOZ_ASSERT(!JS_IsDetachedArrayBufferObject(buffer));
 
     // Step 5 (reordered).
     uint32_t size = buffer->as<ArrayBufferObject>().byteLength();
 
     // Steps 4, 6.
     void* contents = JS_StealArrayBufferContents(cx, buffer);
-    if (!contents)
+    if (!contents) {
         return nullptr;
+    }
     MOZ_ASSERT(JS_IsDetachedArrayBufferObject(buffer));
 
     // Step 7.
     RootedObject transferredBuffer(cx, JS_NewArrayBufferWithContents(cx, size, contents));
-    if (!transferredBuffer)
+    if (!transferredBuffer) {
         return nullptr;
+    }
     return &transferredBuffer->as<ArrayBufferObject>();
 }
 
 // Streams spec, 6.4.5. ValidateAndNormalizeHighWaterMark ( highWaterMark )
 static MOZ_MUST_USE bool
 ValidateAndNormalizeHighWaterMark(JSContext* cx, HandleValue highWaterMarkVal, double* highWaterMark)
 {
     // Step 1: Set highWaterMark to ? ToNumber(highWaterMark).
-    if (!ToNumber(cx, highWaterMarkVal, highWaterMark))
+    if (!ToNumber(cx, highWaterMarkVal, highWaterMark)) {
         return false;
+    }
 
     // Step 2: If highWaterMark is NaN, throw a TypeError exception.
     // Step 3: If highWaterMark < 0, throw a RangeError exception.
     if (mozilla::IsNaN(*highWaterMark) || *highWaterMark < 0) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_STREAM_INVALID_HIGHWATERMARK);
         return false;
     }
 
@@ -5184,18 +5429,19 @@ ValidateAndNormalizeQueuingStrategy(JSCo
     //         TypeError exception.
     if (!size.isUndefined() && !IsCallable(size)) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_NOT_FUNCTION,
                                   "ReadableStream argument options.size");
         return false;
     }
 
     // Step 2: Let highWaterMark be ? ValidateAndNormalizeHighWaterMark(highWaterMark).
-    if (!ValidateAndNormalizeHighWaterMark(cx, highWaterMarkVal, highWaterMark))
+    if (!ValidateAndNormalizeHighWaterMark(cx, highWaterMarkVal, highWaterMark)) {
         return false;
+    }
 
     // Step 3: Return Record {[[size]]: size, [[highWaterMark]]: highWaterMark}.
     return true;
 }
 
 MOZ_MUST_USE bool
 js::ReadableStreamReaderCancel(JSContext* cx, HandleObject readerObj, HandleValue reason)
 {
@@ -5333,31 +5579,33 @@ ReadableStream::updateDataAvailableFromS
 #if DEBUG
     uint32_t oldAvailableData = controller->getFixedSlot(QueueContainerSlot_TotalSize).toInt32();
 #endif // DEBUG
     controller->setFixedSlot(QueueContainerSlot_TotalSize, Int32Value(availableData));
 
     // Step 8.a: If ! ReadableStreamGetNumReadRequests(stream) is 0,
     // Reordered because for externally-sourced streams it applies regardless
     // of reader type.
-    if (ReadableStreamGetNumReadRequests(stream) == 0)
+    if (ReadableStreamGetNumReadRequests(stream) == 0) {
         return true;
+    }
 
     // Step 8: If ! ReadableStreamHasDefaultReader(stream) is true
     if (ReadableStreamHasDefaultReader(stream)) {
         // Step b: Otherwise,
         // Step i: Assert: controller.[[queue]] is empty.
         MOZ_ASSERT(oldAvailableData == 0);
 
         // Step ii: Let transferredView be
         //          ! Construct(%Uint8Array%, transferredBuffer, byteOffset, byteLength).
         JSObject* viewObj = JS_NewUint8Array(cx, availableData);
         Rooted<ArrayBufferViewObject*> transferredView(cx, &viewObj->as<ArrayBufferViewObject>());
-        if (!transferredView)
+        if (!transferredView) {
             return false;
+        }
 
         Value val = controller->getFixedSlot(ControllerSlot_UnderlyingSource);
         void* underlyingSource = val.toPrivate();
 
         size_t bytesWritten;
         {
             JS::AutoSuppressGCAnalysis suppressGC(cx);
             JS::AutoCheckCannotGC noGC;
@@ -5367,30 +5615,32 @@ ReadableStream::updateDataAvailableFromS
             MOZ_ASSERT(cb);
             // TODO: use bytesWritten to correctly update the request's state.
             cb(cx, stream, underlyingSource, stream->embeddingFlags(), buffer,
                availableData, &bytesWritten);
         }
 
         // Step iii: Perform ! ReadableStreamFulfillReadRequest(stream, transferredView, false).
         RootedValue chunk(cx, ObjectValue(*transferredView));
-        if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, stream, chunk, false))
+        if (!ReadableStreamFulfillReadOrReadIntoRequest(cx, stream, chunk, false)) {
             return false;
+        }
 
         controller->setFixedSlot(QueueContainerSlot_TotalSize,
                                  Int32Value(availableData - bytesWritten));
     } else if (ReadableStreamHasBYOBReader(stream)) {
         // Step 9: Otherwise,
         // Step a: If ! ReadableStreamHasBYOBReader(stream) is true,
         // Step i: Perform
         // (Not needed for external underlying sources.)
 
         // Step ii: Perform ! ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller).
-        if (!ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(cx, controller))
+        if (!ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(cx, controller)) {
             return false;
+        }
     } else {
         // Step b: Otherwise,
         // Step i: Assert: ! IsReadableStreamLocked(stream) is false.
         MOZ_ASSERT(!stream->locked());
 
         // Step ii: Perform
         //          ! ReadableByteStreamControllerEnqueueChunkToQueue(controller,
         //                                                            transferredBuffer,
@@ -5401,18 +5651,19 @@ ReadableStream::updateDataAvailableFromS
 
     return true;
 }
 
 MOZ_MUST_USE bool
 ReadableStream::close(JSContext* cx, Handle<ReadableStream*> stream)
 {
     RootedNativeObject controllerObj(cx, ControllerFromStream(stream));
-    if (!VerifyControllerStateForClosing(cx, controllerObj))
+    if (!VerifyControllerStateForClosing(cx, controllerObj)) {
         return false;
+    }
 
     if (controllerObj->is<ReadableStreamDefaultController>()) {
         Rooted<ReadableStreamDefaultController*> controller(cx);
         controller = &controllerObj->as<ReadableStreamDefaultController>();
         return ReadableStreamDefaultControllerClose(cx, controller);
     }
 
     Rooted<ReadableByteStreamController*> controller(cx);
@@ -5442,20 +5693,22 @@ ReadableStream::tee(JSContext* cx, Handl
 {
     return ReadableStreamTee(cx, stream, false, branch1Stream, branch2Stream);
 }
 
 MOZ_MUST_USE NativeObject*
 ReadableStream::getReader(JSContext* cx, Handle<ReadableStream*> stream,
                           JS::ReadableStreamReaderMode mode)
 {
-    if (mode == JS::ReadableStreamReaderMode::Default)
+    if (mode == JS::ReadableStreamReaderMode::Default) {
         return CreateReadableStreamDefaultReader(cx, stream);
+    }
     return CreateReadableStreamBYOBReader(cx, stream);
 }
 
 JS_FRIEND_API(JSObject*)
 js::UnwrapReadableStream(JSObject* obj)
 {
-    if (JSObject* unwrapped = CheckedUnwrap(obj))
+    if (JSObject* unwrapped = CheckedUnwrap(obj)) {
         return unwrapped->is<ReadableStream>() ? unwrapped : nullptr;
+    }
     return nullptr;
 }
--- a/js/src/builtin/String.cpp
+++ b/js/src/builtin/String.cpp
@@ -71,22 +71,24 @@ using mozilla::PodCopy;
 using mozilla::RangedPtr;
 
 using JS::AutoCheckCannotGC;
 using JS::AutoStableStringChars;
 
 static JSLinearString*
 ArgToLinearString(JSContext* cx, const CallArgs& args, unsigned argno)
 {
-    if (argno >= args.length())
+    if (argno >= args.length()) {
         return cx->names().undefined;
+    }
 
     JSString* str = ToString<CanGC>(cx, args[argno]);
-    if (!str)
+    if (!str) {
         return nullptr;
+    }
 
     return str->ensureLinear(cx);
 }
 
 template <typename CharT> struct MaximumInlineLength;
 
 template<> struct MaximumInlineLength<Latin1Char> {
     static constexpr size_t value = JSFatInlineString::MAX_LENGTH_LATIN1;
@@ -141,35 +143,38 @@ class MOZ_NON_PARAM InlineCharBuffer
     {
         return heapStorage ? heapStorage.get() : inlineStorage;
     }
 
     bool maybeAlloc(JSContext* cx, size_t length)
     {
         assertValidRequest(0, length);
 
-        if (length <= InlineCapacity)
+        if (length <= InlineCapacity) {
             return true;
+        }
 
         MOZ_ASSERT(!heapStorage, "heap storage already allocated");
         heapStorage = cx->make_pod_array<CharT>(length + 1);
         return !!heapStorage;
     }
 
     bool maybeRealloc(JSContext* cx, size_t oldLength, size_t newLength)
     {
         assertValidRequest(oldLength, newLength);
 
-        if (newLength <= InlineCapacity)
+        if (newLength <= InlineCapacity) {
             return true;
+        }
 
         if (!heapStorage) {
             heapStorage = cx->make_pod_array<CharT>(newLength + 1);
-            if (!heapStorage)
+            if (!heapStorage) {
                 return false;
+            }
 
             MOZ_ASSERT(oldLength <= InlineCapacity);
             PodCopy(heapStorage.get(), inlineStorage, oldLength);
             return true;
         }
 
         CharT* oldChars = heapStorage.release();
         CharT* newChars = cx->pod_realloc(oldChars, oldLength + 1, newLength + 1);
@@ -253,18 +258,19 @@ Escape(JSContext* cx, const CharT* chars
          0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,       /*   `abcdefghijklmno  */
          1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,       /*   pqrstuvwxyz{\}~  DEL */
     };
 
     /* Take a first pass and see how big the result string will need to be. */
     uint32_t newLength = length;
     for (size_t i = 0; i < length; i++) {
         char16_t ch = chars[i];
-        if (ch < 128 && shouldPassThrough[ch])
+        if (ch < 128 && shouldPassThrough[ch]) {
             continue;
+        }
 
         /* The character will be encoded as %XX or %uXXXX. */
         newLength += (ch < 256) ? 2 : 5;
 
         /*
          * newlength is incremented by at most 5 on each iteration, so worst
          * case newlength == length * 6. This can't overflow.
          */
@@ -272,18 +278,19 @@ Escape(JSContext* cx, const CharT* chars
                       "newlength must not overflow");
     }
 
     if (newLength == length) {
         *newLengthOut = newLength;
         return true;
     }
 
-    if (!newChars.maybeAlloc(cx, newLength))
+    if (!newChars.maybeAlloc(cx, newLength)) {
         return false;
+    }
 
     static const char digits[] = "0123456789ABCDEF";
 
     Latin1Char* rawNewChars = newChars.get();
     size_t i, ni;
     for (i = 0, ni = 0; i < length; i++) {
         char16_t ch = chars[i];
         if (ch < 128 && shouldPassThrough[ch]) {
@@ -308,70 +315,76 @@ Escape(JSContext* cx, const CharT* chars
 }
 
 static bool
 str_escape(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     RootedLinearString str(cx, ArgToLinearString(cx, args, 0));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     InlineCharBuffer<Latin1Char> newChars;
     uint32_t newLength = 0;  // initialize to silence GCC warning
     if (str->hasLatin1Chars()) {
         AutoCheckCannotGC nogc;
-        if (!Escape(cx, str->latin1Chars(nogc), str->length(), newChars, &newLength))
+        if (!Escape(cx, str->latin1Chars(nogc), str->length(), newChars, &newLength)) {
             return false;
+        }
     } else {
         AutoCheckCannotGC nogc;
-        if (!Escape(cx, str->twoByteChars(nogc), str->length(), newChars, &newLength))
+        if (!Escape(cx, str->twoByteChars(nogc), str->length(), newChars, &newLength)) {
             return false;
+        }
     }
 
     // Return input if no characters need to be escaped.
     if (newLength == str->length()) {
         args.rval().setString(str);
         return true;
     }
 
     JSString* res = newChars.toString(cx, newLength);
-    if (!res)
+    if (!res) {
         return false;
+    }
 
     args.rval().setString(res);
     return true;
 }
 
 template <typename CharT>
 static inline bool
 Unhex4(const RangedPtr<const CharT> chars, char16_t* result)
 {
     char16_t a = chars[0],
              b = chars[1],
              c = chars[2],
              d = chars[3];
 
-    if (!(JS7_ISHEX(a) && JS7_ISHEX(b) && JS7_ISHEX(c) && JS7_ISHEX(d)))
+    if (!(JS7_ISHEX(a) && JS7_ISHEX(b) && JS7_ISHEX(c) && JS7_ISHEX(d))) {
         return false;
+    }
 
     *result = (((((JS7_UNHEX(a) << 4) + JS7_UNHEX(b)) << 4) + JS7_UNHEX(c)) << 4) + JS7_UNHEX(d);
     return true;
 }
 
 template <typename CharT>
 static inline bool
 Unhex2(const RangedPtr<const CharT> chars, char16_t* result)
 {
     char16_t a = chars[0],
              b = chars[1];
 
-    if (!(JS7_ISHEX(a) && JS7_ISHEX(b)))
+    if (!(JS7_ISHEX(a) && JS7_ISHEX(b))) {
         return false;
+    }
 
     *result = (JS7_UNHEX(a) << 4) + JS7_UNHEX(b);
     return true;
 }
 
 template <typename CharT>
 static bool
 Unescape(StringBuffer& sb, const mozilla::Range<const CharT> chars)
@@ -418,18 +431,19 @@ Unescape(StringBuffer& sb, const mozilla
                 if (Unhex2(chars.begin() + k + 1, &c)) {
                     ENSURE_BUILDING
                     k += 2;
                 }
             }
         }
 
         // Step 5.c.
-        if (building && !sb.append(c))
+        if (building && !sb.append(c)) {
             return false;
+        }
 
         // Step 5.d.
         k += 1;
     }
 
     return true;
 #undef ENSURE_BUILDING
 }
@@ -438,56 +452,62 @@ Unescape(StringBuffer& sb, const mozilla
 // B.2.1.2 unescape ( string )
 static bool
 str_unescape(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // Step 1.
     RootedLinearString str(cx, ArgToLinearString(cx, args, 0));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     // Step 3.
     StringBuffer sb(cx);
-    if (str->hasTwoByteChars() && !sb.ensureTwoByteChars())
+    if (str->hasTwoByteChars() && !sb.ensureTwoByteChars()) {
         return false;
+    }
 
     // Steps 2, 4-5.
     if (str->hasLatin1Chars()) {
         AutoCheckCannotGC nogc;
-        if (!Unescape(sb, str->latin1Range(nogc)))
+        if (!Unescape(sb, str->latin1Range(nogc))) {
             return false;
+        }
     } else {
         AutoCheckCannotGC nogc;
-        if (!Unescape(sb, str->twoByteRange(nogc)))
+        if (!Unescape(sb, str->twoByteRange(nogc))) {
             return false;
+        }
     }
 
     // Step 6.
     JSLinearString* result;
     if (!sb.empty()) {
         result = sb.finishString();
-        if (!result)
+        if (!result) {
             return false;
+        }
     } else {
         result = str;
     }
 
     args.rval().setString(result);
     return true;
 }
 
 static bool
 str_uneval(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     JSString* str = ValueToSource(cx, args.get(0));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     args.rval().setString(str);
     return true;
 }
 
 static const JSFunctionSpec string_functions[] = {
     JS_FN(js_escape_str,             str_escape,                1, JSPROP_RESOLVING),
     JS_FN(js_unescape_str,           str_unescape,              1, JSPROP_RESOLVING),
@@ -506,46 +526,50 @@ static bool
 str_enumerate(JSContext* cx, HandleObject obj)
 {
     RootedString str(cx, obj->as<StringObject>().unbox());
     js::StaticStrings& staticStrings = cx->staticStrings();
 
     RootedValue value(cx);
     for (size_t i = 0, length = str->length(); i < length; i++) {
         JSString* str1 = staticStrings.getUnitStringForElement(cx, str, i);
-        if (!str1)
+        if (!str1) {
             return false;
+        }
         value.setString(str1);
-        if (!DefineDataElement(cx, obj, i, value, STRING_ELEMENT_ATTRS | JSPROP_RESOLVING))
+        if (!DefineDataElement(cx, obj, i, value, STRING_ELEMENT_ATTRS | JSPROP_RESOLVING)) {
             return false;
+        }
     }
 
     return true;
 }
 
 static bool
 str_mayResolve(const JSAtomState&, jsid id, JSObject*)
 {
     // str_resolve ignores non-integer ids.
     return JSID_IS_INT(id);
 }
 
 static bool
 str_resolve(JSContext* cx, HandleObject obj, HandleId id, bool* resolvedp)
 {
-    if (!JSID_IS_INT(id))
+    if (!JSID_IS_INT(id)) {
         return true;
+    }
 
     RootedString str(cx, obj->as<StringObject>().unbox());
 
     int32_t slot = JSID_TO_INT(id);
     if ((size_t)slot < str->length()) {
         JSString* str1 = cx->staticStrings().getUnitStringForElement(cx, str, size_t(slot));
-        if (!str1)
+        if (!str1) {
             return false;
+        }
         RootedValue value(cx, StringValue(str1));
         if (!DefineDataElement(cx, obj, uint32_t(slot), value,
                                STRING_ELEMENT_ATTRS | JSPROP_RESOLVING))
         {
             return false;
         }
         *resolvedp = true;
     }
@@ -570,21 +594,23 @@ const Class StringObject::class_ = {
 
 /*
  * Perform the initial |RequireObjectCoercible(thisv)| and |ToString(thisv)|
  * from nearly all String.prototype.* functions.
  */
 static MOZ_ALWAYS_INLINE JSString*
 ToStringForStringFunction(JSContext* cx, HandleValue thisv)
 {
-    if (!CheckRecursionLimit(cx))
+    if (!CheckRecursionLimit(cx)) {
         return nullptr;
-
-    if (thisv.isString())
+    }
+
+    if (thisv.isString()) {
         return thisv.toString();
+    }
 
     if (thisv.isObject()) {
         RootedObject obj(cx, &thisv.toObject());
         if (obj->is<StringObject>()) {
             StringObject* nobj = &obj->as<StringObject>();
             // We have to make sure that the ToPrimitive call from ToString
             // would be unobservable.
             if (HasNoToPrimitiveMethodPure(nobj, cx) &&
@@ -609,34 +635,37 @@ IsString(HandleValue v)
 }
 
 MOZ_ALWAYS_INLINE bool
 str_toSource_impl(JSContext* cx, const CallArgs& args)
 {
     MOZ_ASSERT(IsString(args.thisv()));
 
     JSString* str = ToString<CanGC>(cx, args.thisv());
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     UniqueChars quoted = QuoteString(cx, str, '"');
-    if (!quoted)
+    if (!quoted) {
         return false;
+    }
 
     StringBuffer sb(cx);
     if (!sb.append("(new String(") ||
         !sb.append(quoted.get(), strlen(quoted.get())) ||
         !sb.append("))"))
     {
         return false;
     }
 
     JSString* result = sb.finishString();
-    if (!result)
+    if (!result) {
         return false;
+    }
     args.rval().setString(result);
     return true;
 }
 
 static bool
 str_toSource(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
@@ -684,18 +713,19 @@ js::SubstringKernel(JSContext* cx, Handl
      *   text = text.substr(0, x) + "bla" + text.substr(x)
      *   test.charCodeAt(x + 1)
      * }
      */
     if (str->isRope()) {
         JSRope* rope = &str->asRope();
 
         /* Substring is totally in leftChild of rope. */
-        if (begin + len <= rope->leftChild()->length())
+        if (begin + len <= rope->leftChild()->length()) {
             return NewDependentString(cx, rope->leftChild(), begin, len);
+        }
 
         /* Substring is totally in rightChild of rope. */
         if (begin >= rope->leftChild()->length()) {
             begin -= rope->leftChild()->length();
             return NewDependentString(cx, rope->rightChild(), begin, len);
         }
 
         /*
@@ -705,22 +735,24 @@ js::SubstringKernel(JSContext* cx, Handl
         MOZ_ASSERT(begin < rope->leftChild()->length() &&
                    begin + len > rope->leftChild()->length());
 
         size_t lhsLength = rope->leftChild()->length() - begin;
         size_t rhsLength = begin + len - rope->leftChild()->length();
 
         Rooted<JSRope*> ropeRoot(cx, rope);
         RootedString lhs(cx, NewDependentString(cx, ropeRoot->leftChild(), begin, lhsLength));
-        if (!lhs)
+        if (!lhs) {
             return nullptr;
+        }
 
         RootedString rhs(cx, NewDependentString(cx, ropeRoot->rightChild(), 0, rhsLength));
-        if (!rhs)
+        if (!rhs) {
             return nullptr;
+        }
 
         return JSRope::new_<CanGC>(cx, lhs, rhs, len);
     }
 
     return NewDependentString(cx, str, begin, len);
 }
 
 /**
@@ -755,48 +787,52 @@ Final_Sigma(const char16_t* chars, size_
                 codePoint = unicode::UTF16Decode(lead, c);
                 i--;
             }
         }
 
         // Ignore any characters with the property Case_Ignorable.
         // NB: We need to skip over all Case_Ignorable characters, even when
         // they also have the Cased binary property.
-        if (u_hasBinaryProperty(codePoint, UCHAR_CASE_IGNORABLE))
+        if (u_hasBinaryProperty(codePoint, UCHAR_CASE_IGNORABLE)) {
             continue;
+        }
 
         precededByCased = u_hasBinaryProperty(codePoint, UCHAR_CASED);
         break;
     }
-    if (!precededByCased)
+    if (!precededByCased) {
         return unicode::GREEK_SMALL_LETTER_SIGMA;
+    }
 
     bool followedByCased = false;
     for (size_t i = index + 1; i < length; ) {
         char16_t c = chars[i++];
         uint32_t codePoint = c;
         if (unicode::IsLeadSurrogate(c) && i < length) {
             char16_t trail = chars[i];
             if (unicode::IsTrailSurrogate(trail)) {
                 codePoint = unicode::UTF16Decode(c, trail);
                 i++;
             }
         }
 
         // Ignore any characters with the property Case_Ignorable.
         // NB: We need to skip over all Case_Ignorable characters, even when
         // they also have the Cased binary property.
-        if (u_hasBinaryProperty(codePoint, UCHAR_CASE_IGNORABLE))
+        if (u_hasBinaryProperty(codePoint, UCHAR_CASE_IGNORABLE)) {
             continue;
+        }
 
         followedByCased = u_hasBinaryProperty(codePoint, UCHAR_CASED);
         break;
     }
-    if (!followedByCased)
+    if (!followedByCased) {
         return unicode::GREEK_SMALL_LETTER_FINAL_SIGMA;
+    }
 #endif
 
     return unicode::GREEK_SMALL_LETTER_SIGMA;
 }
 
 static Latin1Char
 Final_Sigma(const Latin1Char* chars, size_t length, size_t index)
 {
@@ -834,18 +870,19 @@ ToLowerCaseImpl(CharT* destChars, const 
                     continue;
                 }
             }
 
             // Special case: U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE
             // lowercases to <U+0069 U+0307>.
             if (c == unicode::LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE) {
                 // Return if the output buffer is too small.
-                if (srcLength == destLength)
+                if (srcLength == destLength) {
                     return i;
+                }
 
                 destChars[j++] = CharT('i');
                 destChars[j++] = CharT(unicode::COMBINING_DOT_ABOVE);
                 continue;
             }
 
             // Special case: U+03A3 GREEK CAPITAL LETTER SIGMA lowercases to
             // one of two codepoints depending on context.
@@ -867,18 +904,19 @@ ToLowerCaseImpl(CharT* destChars, const 
 static size_t
 ToLowerCaseLength(const char16_t* chars, size_t startIndex, size_t length)
 {
     size_t lowerLength = length;
     for (size_t i = startIndex; i < length; i++) {
         char16_t c = chars[i];
 
         // U+0130 is lowercased to the two-element sequence <U+0069 U+0307>.
-        if (c == unicode::LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE)
+        if (c == unicode::LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE) {
             lowerLength += 1;
+        }
     }
     return lowerLength;
 }
 
 static size_t
 ToLowerCaseLength(const Latin1Char* chars, size_t startIndex, size_t length)
 {
     MOZ_ASSERT_UNREACHABLE("never called for Latin-1 strings");
@@ -923,90 +961,100 @@ ToLowerCase(JSContext* cx, JSLinearStrin
         // Look for the first character that changes when lowercased.
         size_t i = 0;
         for (; i < length; i++) {
             CharT c = chars[i];
             if (!IsSame<CharT, Latin1Char>::value) {
                 if (unicode::IsLeadSurrogate(c) && i + 1 < length) {
                     CharT trail = chars[i + 1];
                     if (unicode::IsTrailSurrogate(trail)) {
-                        if (unicode::ChangesWhenLowerCasedNonBMP(c, trail))
+                        if (unicode::ChangesWhenLowerCasedNonBMP(c, trail)) {
                             break;
+                        }
 
                         i++;
                         continue;
                     }
                 }
             }
-            if (unicode::ChangesWhenLowerCased(c))
+            if (unicode::ChangesWhenLowerCased(c)) {
                 break;
+            }
         }
 
         // If no character needs to change, return the input string.
-        if (i == length)
+        if (i == length) {
             return str;
+        }
 
         resultLength = length;
-        if (!newChars.maybeAlloc(cx, resultLength))
+        if (!newChars.maybeAlloc(cx, resultLength)) {
             return nullptr;
+        }
 
         PodCopy(newChars.get(), chars, i);
 
         size_t readChars = ToLowerCaseImpl(newChars.get(), chars, i, length, resultLength);
         if (readChars < length) {
             MOZ_ASSERT((!IsSame<CharT, Latin1Char>::value),
                        "Latin-1 strings don't have special lower case mappings");
             resultLength = ToLowerCaseLength(chars, readChars, length);
 
-            if (!newChars.maybeRealloc(cx, length, resultLength))
+            if (!newChars.maybeRealloc(cx, length, resultLength)) {
                 return nullptr;
+            }
 
             MOZ_ALWAYS_TRUE(length ==
                 ToLowerCaseImpl(newChars.get(), chars, readChars, length, resultLength));
         }
     }
 
     return newChars.toStringDontDeflate(cx, resultLength);
 }
 
 JSString*
 js::StringToLowerCase(JSContext* cx, HandleString string)
 {
     JSLinearString* linear = string->ensureLinear(cx);
-    if (!linear)
+    if (!linear) {
         return nullptr;
-
-    if (linear->hasLatin1Chars())
+    }
+
+    if (linear->hasLatin1Chars()) {
         return ToLowerCase<Latin1Char>(cx, linear);
+    }
     return ToLowerCase<char16_t>(cx, linear);
 }
 
 bool
 js::str_toLowerCase(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     RootedString str(cx, ToStringForStringFunction(cx, args.thisv()));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     JSString* result = StringToLowerCase(cx, str);
-    if (!result)
+    if (!result) {
         return false;
+    }
 
     args.rval().setString(result);
     return true;
 }
 
 static const char*
 CaseMappingLocale(JSContext* cx, JSString* str)
 {
     JSLinearString* locale = str->ensureLinear(cx);
-    if (!locale)
+    if (!locale) {
         return nullptr;
+    }
 
     MOZ_ASSERT(locale->length() >= 2, "locale is a valid language tag");
 
     // Lithuanian, Turkish, and Azeri have language dependent case mappings.
     static const char languagesWithSpecialCasing[][3] = { "lt", "tr", "az" };
 
     // All strings in |languagesWithSpecialCasing| are of length two, so we
     // only need to compare the first two characters to find a matching locale.
@@ -1030,54 +1078,60 @@ js::intl_toLocaleLowerCase(JSContext* cx
     CallArgs args = CallArgsFromVp(argc, vp);
     MOZ_ASSERT(args.length() == 2);
     MOZ_ASSERT(args[0].isString());
     MOZ_ASSERT(args[1].isString());
 
     RootedString string(cx, args[0].toString());
 
     const char* locale = CaseMappingLocale(cx, args[1].toString());
-    if (!locale)
+    if (!locale) {
         return false;
+    }
 
     // Call String.prototype.toLowerCase() for language independent casing.
     if (intl::StringsAreEqual(locale, "")) {
         JSString* str = StringToLowerCase(cx, string);
-        if (!str)
+        if (!str) {
             return false;
+        }
 
         args.rval().setString(str);
         return true;
     }
 
     AutoStableStringChars inputChars(cx);
-    if (!inputChars.initTwoByte(cx, string))
+    if (!inputChars.initTwoByte(cx, string)) {
         return false;
+    }
     mozilla::Range<const char16_t> input = inputChars.twoByteRange();
 
     // Maximum case mapping length is three characters.
     static_assert(JSString::MAX_LENGTH < INT32_MAX / 3,
                   "Case conversion doesn't overflow int32_t indices");
 
     static const size_t INLINE_CAPACITY = js::intl::INITIAL_CHAR_BUFFER_SIZE;
 
     Vector<char16_t, INLINE_CAPACITY> chars(cx);
-    if (!chars.resize(Max(INLINE_CAPACITY, input.length())))
+    if (!chars.resize(Max(INLINE_CAPACITY, input.length()))) {
         return false;
+    }
 
     int32_t size =
         intl::CallICU(cx, [&input, locale](UChar* chars, int32_t size, UErrorCode* status) {
             return u_strToLower(chars, size, input.begin().get(), input.length(), locale, status);
         }, chars);
-    if (size < 0)
+    if (size < 0) {
         return false;
+    }
 
     JSString* result = NewStringCopyN<CanGC>(cx, chars.begin(), size);
-    if (!result)
+    if (!result) {
         return false;
+    }
 
     args.rval().setString(result);
     return true;
 }
 
 #if EXPOSE_INTL_API
 
 // String.prototype.toLocaleLowerCase is self-hosted when Intl is exposed,
@@ -1086,39 +1140,43 @@ js::intl_toLocaleLowerCase(JSContext* cx
 #else
 
 bool
 js::str_toLocaleLowerCase(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     RootedString str(cx, ToStringForStringFunction(cx, args.thisv()));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     /*
      * Forcefully ignore the first (or any) argument and return toLowerCase(),
      * ECMA has reserved that argument, presumably for defining the locale.
      */
     if (cx->runtime()->localeCallbacks && cx->runtime()->localeCallbacks->localeToLowerCase) {
         RootedValue result(cx);
-        if (!cx->runtime()->localeCallbacks->localeToLowerCase(cx, str, &result))
+        if (!cx->runtime()->localeCallbacks->localeToLowerCase(cx, str, &result)) {
             return false;
+        }
 
         args.rval().set(result);
         return true;
     }
 
     RootedLinearString linear(cx, str->ensureLinear(cx));
-    if (!linear)
+    if (!linear) {
         return false;
+    }
 
     JSString* result = StringToLowerCase(cx, linear);
-    if (!result)
+    if (!result) {
         return false;
+    }
 
     args.rval().setString(result);
     return true;
 }
 
 #endif // EXPOSE_INTL_API
 
 static inline bool
@@ -1196,18 +1254,19 @@ ToUpperCaseImpl(DestChar* destChars, con
                     i++;
                     continue;
                 }
             }
         }
 
         if (MOZ_UNLIKELY(c > 0x7f && ToUpperCaseHasSpecialCasing(static_cast<SrcChar>(c)))) {
             // Return if the output buffer is too small.
-            if (srcLength == destLength)
+            if (srcLength == destLength) {
                 return i;
+            }
 
             ToUpperCaseAppendUpperCaseSpecialCasing(c, destChars, &j);
             continue;
         }
 
         c = unicode::ToUpperCase(c);
         MOZ_ASSERT_IF((IsSame<DestChar, Latin1Char>::value), c <= JSString::MAX_LATIN1_CHAR);
         destChars[j++] = c;
@@ -1229,29 +1288,31 @@ ToUpperCaseImpl(Latin1Char* destChars, c
 template <typename CharT>
 static size_t
 ToUpperCaseLength(const CharT* chars, size_t startIndex, size_t length)
 {
     size_t upperLength = length;
     for (size_t i = startIndex; i < length; i++) {
         char16_t c = chars[i];
 
-        if (c > 0x7f && ToUpperCaseHasSpecialCasing(static_cast<CharT>(c)))
+        if (c > 0x7f && ToUpperCaseHasSpecialCasing(static_cast<CharT>(c))) {
             upperLength += ToUpperCaseLengthSpecialCasing(static_cast<CharT>(c)) - 1;
+        }
     }
     return upperLength;
 }
 
 template <typename DestChar, typename SrcChar>
 static inline void
 CopyChars(DestChar* destChars, const SrcChar* srcChars, size_t length)
 {
     static_assert(!IsSame<DestChar, SrcChar>::value, "PodCopy is used for the same type case");
-    for (size_t i = 0; i < length; i++)
+    for (size_t i = 0; i < length; i++) {
         destChars[i] = srcChars[i];
+    }
 }
 
 template <typename CharT>
 static inline void
 CopyChars(CharT* destChars, const CharT* srcChars, size_t length)
 {
     PodCopy(destChars, srcChars, length);
 }
@@ -1259,28 +1320,30 @@ CopyChars(CharT* destChars, const CharT*
 template <typename DestChar, typename SrcChar>
 static inline bool
 ToUpperCase(JSContext* cx, InlineCharBuffer<DestChar>& newChars, const SrcChar* chars,
             size_t startIndex, size_t length, size_t* resultLength)
 {
     MOZ_ASSERT(startIndex < length);
 
     *resultLength = length;
-    if (!newChars.maybeAlloc(cx, length))
+    if (!newChars.maybeAlloc(cx, length)) {
         return false;
+    }
 
     CopyChars(newChars.get(), chars, startIndex);
 
     size_t readChars = ToUpperCaseImpl(newChars.get(), chars, startIndex, length, length);
     if (readChars < length) {
         size_t actualLength = ToUpperCaseLength(chars, readChars, length);
 
         *resultLength = actualLength;
-        if (!newChars.maybeRealloc(cx, length, actualLength))
+        if (!newChars.maybeRealloc(cx, length, actualLength)) {
             return false;
+        }
 
         MOZ_ALWAYS_TRUE(length ==
             ToUpperCaseImpl(newChars.get(), chars, readChars, length, actualLength));
     }
 
     return true;
 }
 
@@ -1322,33 +1385,37 @@ ToUpperCase(JSContext* cx, JSLinearStrin
         // Look for the first character that changes when uppercased.
         size_t i = 0;
         for (; i < length; i++) {
             CharT c = chars[i];
             if (!IsSame<CharT, Latin1Char>::value) {
                 if (unicode::IsLeadSurrogate(c) && i + 1 < length) {
                     CharT trail = chars[i + 1];
                     if (unicode::IsTrailSurrogate(trail)) {
-                        if (unicode::ChangesWhenUpperCasedNonBMP(c, trail))
+                        if (unicode::ChangesWhenUpperCasedNonBMP(c, trail)) {
                             break;
+                        }
 
                         i++;
                         continue;
                     }
                 }
             }
-            if (unicode::ChangesWhenUpperCased(c))
+            if (unicode::ChangesWhenUpperCased(c)) {
                 break;
-            if (MOZ_UNLIKELY(c > 0x7f && ToUpperCaseHasSpecialCasing(c)))
+            }
+            if (MOZ_UNLIKELY(c > 0x7f && ToUpperCaseHasSpecialCasing(c))) {
                 break;
+            }
         }
 
         // If no character needs to change, return the input string.
-        if (i == length)
+        if (i == length) {
             return str;
+        }
 
         // The string changes when uppercased, so we must create a new string.
         // Can it be Latin-1?
         //
         // If the original string is Latin-1, it can -- unless the string
         // contains U+00B5 MICRO SIGN or U+00FF SMALL LETTER Y WITH DIAERESIS,
         // the only Latin-1 codepoints that don't uppercase within Latin-1.
         // Search for those codepoints to decide whether the new string can be
@@ -1373,109 +1440,121 @@ ToUpperCase(JSContext* cx, JSLinearStrin
             }
         } else {
             resultIsLatin1 = false;
         }
 
         if (resultIsLatin1) {
             newChars.construct<Latin1Buffer>();
 
-            if (!ToUpperCase(cx, newChars.ref<Latin1Buffer>(), chars, i, length, &resultLength))
+            if (!ToUpperCase(cx, newChars.ref<Latin1Buffer>(), chars, i, length, &resultLength)) {
                 return nullptr;
+            }
         } else {
             newChars.construct<TwoByteBuffer>();
 
-            if (!ToUpperCase(cx, newChars.ref<TwoByteBuffer>(), chars, i, length, &resultLength))
+            if (!ToUpperCase(cx, newChars.ref<TwoByteBuffer>(), chars, i, length, &resultLength)) {
                 return nullptr;
+            }
         }
     }
 
     return newChars.constructed<Latin1Buffer>()
            ? newChars.ref<Latin1Buffer>().toStringDontDeflate(cx, resultLength)
            : newChars.ref<TwoByteBuffer>().toStringDontDeflate(cx, resultLength);
 }
 
 JSString*
 js::StringToUpperCase(JSContext* cx, HandleString string)
 {
     JSLinearString* linear = string->ensureLinear(cx);
-    if (!linear)
+    if (!linear) {
         return nullptr;
-
-    if (linear->hasLatin1Chars())
+    }
+
+    if (linear->hasLatin1Chars()) {
         return ToUpperCase<Latin1Char>(cx, linear);
+    }
     return ToUpperCase<char16_t>(cx, linear);
 }
 
 bool
 js::str_toUpperCase(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     RootedString str(cx, ToStringForStringFunction(cx, args.thisv()));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     JSString* result = StringToUpperCase(cx, str);
-    if (!result)
+    if (!result) {
         return false;
+    }
 
     args.rval().setString(result);
     return true;
 }
 
 bool
 js::intl_toLocaleUpperCase(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     MOZ_ASSERT(args.length() == 2);
     MOZ_ASSERT(args[0].isString());
     MOZ_ASSERT(args[1].isString());
 
     RootedString string(cx, args[0].toString());
 
     const char* locale = CaseMappingLocale(cx, args[1].toString());
-    if (!locale)
+    if (!locale) {
         return false;
+    }
 
     // Call String.prototype.toUpperCase() for language independent casing.
     if (intl::StringsAreEqual(locale, "")) {
         JSString* str = js::StringToUpperCase(cx, string);
-        if (!str)
+        if (!str) {
             return false;
+        }
 
         args.rval().setString(str);
         return true;
     }
 
     AutoStableStringChars inputChars(cx);
-    if (!inputChars.initTwoByte(cx, string))
+    if (!inputChars.initTwoByte(cx, string)) {
         return false;
+    }
     mozilla::Range<const char16_t> input = inputChars.twoByteRange();
 
     // Maximum case mapping length is three characters.
     static_assert(JSString::MAX_LENGTH < INT32_MAX / 3,
                   "Case conversion doesn't overflow int32_t indices");
 
     static const size_t INLINE_CAPACITY = js::intl::INITIAL_CHAR_BUFFER_SIZE;
 
     Vector<char16_t, INLINE_CAPACITY> chars(cx);
-    if (!chars.resize(Max(INLINE_CAPACITY, input.length())))
+    if (!chars.resize(Max(INLINE_CAPACITY, input.length()))) {
         return false;
+    }
 
     int32_t size =
         intl::CallICU(cx, [&input, locale](UChar* chars, int32_t size, UErrorCode* status) {
             return u_strToUpper(chars, size, input.begin().get(), input.length(), locale, status);
         }, chars);
-    if (size < 0)
+    if (size < 0) {
         return false;
+    }
 
     JSString* result = NewStringCopyN<CanGC>(cx, chars.begin(), size);
-    if (!result)
+    if (!result) {
         return false;
+    }
 
     args.rval().setString(result);
     return true;
 }
 
 #if EXPOSE_INTL_API
 
 // String.prototype.toLocaleLowerCase is self-hosted when Intl is exposed,
@@ -1484,39 +1563,43 @@ js::intl_toLocaleUpperCase(JSContext* cx
 #else
 
 bool
 js::str_toLocaleUpperCase(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     RootedString str(cx, ToStringForStringFunction(cx, args.thisv()));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     /*
      * Forcefully ignore the first (or any) argument and return toUpperCase(),
      * ECMA has reserved that argument, presumably for defining the locale.
      */
     if (cx->runtime()->localeCallbacks && cx->runtime()->localeCallbacks->localeToUpperCase) {
         RootedValue result(cx);
-        if (!cx->runtime()->localeCallbacks->localeToUpperCase(cx, str, &result))
+        if (!cx->runtime()->localeCallbacks->localeToUpperCase(cx, str, &result)) {
             return false;
+        }
 
         args.rval().set(result);
         return true;
     }
 
     RootedLinearString linear(cx, str->ensureLinear(cx));
-    if (!linear)
+    if (!linear) {
         return false;
+    }
 
     JSString* result = StringToUpperCase(cx, linear);
-    if (!result)
+    if (!result) {
         return false;
+    }
 
     args.rval().setString(result);
     return true;
 }
 
 #endif // EXPOSE_INTL_API
 
 #if EXPOSE_INTL_API
@@ -1525,35 +1608,39 @@ js::str_toLocaleUpperCase(JSContext* cx,
 
 #else
 
 bool
 js::str_localeCompare(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     RootedString str(cx, ToStringForStringFunction(cx, args.thisv()));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     RootedString thatStr(cx, ToString<CanGC>(cx, args.get(0)));
-    if (!thatStr)
+    if (!thatStr) {
         return false;
+    }
 
     if (cx->runtime()->localeCallbacks && cx->runtime()->localeCallbacks->localeCompare) {
         RootedValue result(cx);
-        if (!cx->runtime()->localeCallbacks->localeCompare(cx, str, thatStr, &result))
+        if (!cx->runtime()->localeCallbacks->localeCompare(cx, str, thatStr, &result)) {
             return false;
+        }
 
         args.rval().set(result);
         return true;
     }
 
     int32_t result;
-    if (!CompareStrings(cx, str, thatStr, &result))
+    if (!CompareStrings(cx, str, thatStr, &result)) {
         return false;
+    }
 
     args.rval().setInt32(result);
     return true;
 }
 
 #endif // EXPOSE_INTL_API
 
 #if EXPOSE_INTL_API
@@ -1562,32 +1649,34 @@ js::str_localeCompare(JSContext* cx, uns
 // 21.1.3.12 String.prototype.normalize ( [ form ] )
 bool
 js::str_normalize(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // Steps 1-2.
     RootedString str(cx, ToStringForStringFunction(cx, args.thisv()));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     enum NormalizationForm {
         NFC, NFD, NFKC, NFKD
     };
 
     NormalizationForm form;
     if (!args.hasDefined(0)) {
         // Step 3.
         form = NFC;
     } else {
         // Step 4.
         JSLinearString* formStr = ArgToLinearString(cx, args, 0);
-        if (!formStr)
+        if (!formStr) {
             return false;
+        }
 
         // Step 5.
         if (EqualStrings(formStr, cx->names().NFC)) {
             form = NFC;
         } else if (EqualStrings(formStr, cx->names().NFD)) {
             form = NFD;
         } else if (EqualStrings(formStr, cx->names().NFKC)) {
             form = NFKC;
@@ -1603,18 +1692,19 @@ js::str_normalize(JSContext* cx, unsigne
     if (form == NFC && str->hasLatin1Chars()) {
         // Step 7.
         args.rval().setString(str);
         return true;
     }
 
     // Step 6.
     AutoStableStringChars stableChars(cx);
-    if (!stableChars.initTwoByte(cx, str))
+    if (!stableChars.initTwoByte(cx, str)) {
         return false;
+    }
 
     mozilla::Range<const char16_t> srcChars = stableChars.twoByteRange();
 
     // The unorm2_getXXXInstance() methods return a shared instance which must
     // not be deleted.
     UErrorCode status = U_ZERO_ERROR;
     const UNormalizer2* normalizer;
     if (form == NFC) {
@@ -1647,39 +1737,43 @@ js::str_normalize(JSContext* cx, unsigne
         // Step 7.
         args.rval().setString(str);
         return true;
     }
 
     static const size_t INLINE_CAPACITY = js::intl::INITIAL_CHAR_BUFFER_SIZE;
 
     Vector<char16_t, INLINE_CAPACITY> chars(cx);
-    if (!chars.resize(Max(INLINE_CAPACITY, srcChars.length())))
+    if (!chars.resize(Max(INLINE_CAPACITY, srcChars.length()))) {
         return false;
+    }
 
     // Copy the already normalized prefix.
-    if (spanLength > 0)
+    if (spanLength > 0) {
         PodCopy(chars.begin(), srcChars.begin().get(), spanLength);
+    }
 
     int32_t size =
         intl::CallICU(cx, [normalizer, &srcChars, spanLength](UChar* chars, uint32_t size,
                                                               UErrorCode* status)
         {
             mozilla::RangedPtr<const char16_t> remainingStart = srcChars.begin() + spanLength;
             size_t remainingLength = srcChars.length() - spanLength;
 
             return unorm2_normalizeSecondAndAppend(normalizer, chars, spanLength, size,
                                                    remainingStart.get(), remainingLength, status);
         }, chars);
-    if (size < 0)
+    if (size < 0) {
         return false;
+    }
 
     JSString* ns = NewStringCopyN<CanGC>(cx, chars.begin(), size);
-    if (!ns)
+    if (!ns) {
         return false;
+    }
 
     // Step 7.
     args.rval().setString(ns);
     return true;
 }
 
 #endif // EXPOSE_INTL_API
 
@@ -1688,63 +1782,72 @@ js::str_charAt(JSContext* cx, unsigned a
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     RootedString str(cx);
     size_t i;
     if (args.thisv().isString() && args.length() != 0 && args[0].isInt32()) {
         str = args.thisv().toString();
         i = size_t(args[0].toInt32());
-        if (i >= str->length())
+        if (i >= str->length()) {
             goto out_of_range;
+        }
     } else {
         str = ToStringForStringFunction(cx, args.thisv());
-        if (!str)
+        if (!str) {
             return false;
+        }
 
         double d = 0.0;
-        if (args.length() > 0 && !ToInteger(cx, args[0], &d))
+        if (args.length() > 0 && !ToInteger(cx, args[0], &d)) {
             return false;
-
-        if (d < 0 || str->length() <= d)
+        }
+
+        if (d < 0 || str->length() <= d) {
             goto out_of_range;
+        }
         i = size_t(d);
     }
 
     str = cx->staticStrings().getUnitStringForElement(cx, str, i);
-    if (!str)
+    if (!str) {
         return false;
+    }
     args.rval().setString(str);
     return true;
 
   out_of_range:
     args.rval().setString(cx->runtime()->emptyString);
     return true;
 }
 
 bool
 js::str_charCodeAt_impl(JSContext* cx, HandleString string, HandleValue index, MutableHandleValue res)
 {
     size_t i;
     if (index.isInt32()) {
         i = index.toInt32();
-        if (i >= string->length())
+        if (i >= string->length()) {
             goto out_of_range;
+        }
     } else {
         double d = 0.0;
-        if (!ToInteger(cx, index, &d))
+        if (!ToInteger(cx, index, &d)) {
             return false;
+        }
         // check whether d is negative as size_t is unsigned
-        if (d < 0 || string->length() <= d )
+        if (d < 0 || string->length() <= d ) {
             goto out_of_range;
+        }
         i = size_t(d);
     }
     char16_t c;
-    if (!string->getChar(cx, i , &c))
+    if (!string->getChar(cx, i , &c)) {
         return false;
+    }
     res.setInt32(c);
     return true;
 
 out_of_range:
     res.setNaN();
     return true;
 }
 
@@ -1753,23 +1856,25 @@ js::str_charCodeAt(JSContext* cx, unsign
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     RootedString str(cx);
     RootedValue index(cx);
     if (args.thisv().isString()) {
         str = args.thisv().toString();
     } else {
         str = ToStringForStringFunction(cx, args.thisv());
-        if (!str)
+        if (!str) {
             return false;
-    }
-    if (args.length() != 0)
+        }
+    }
+    if (args.length() != 0) {
         index = args[0];
-    else
+    } else {
         index.setInt32(0);
+    }
 
     return js::str_charCodeAt_impl(cx, str, index, args.rval());
 }
 
 /*
  * Boyer-Moore-Horspool superlinear search for pat:patlen in text:textlen.
  * The patlen argument must be positive and no greater than sBMHPatLenMax.
  *
@@ -1781,33 +1886,37 @@ static const int      sBMHBadPattern  = 
 
 template <typename TextChar, typename PatChar>
 static int
 BoyerMooreHorspool(const TextChar* text, uint32_t textLen, const PatChar* pat, uint32_t patLen)
 {
     MOZ_ASSERT(0 < patLen && patLen <= sBMHPatLenMax);
 
     uint8_t skip[sBMHCharSetSize];
-    for (uint32_t i = 0; i < sBMHCharSetSize; i++)
+    for (uint32_t i = 0; i < sBMHCharSetSize; i++) {
         skip[i] = uint8_t(patLen);
+    }
 
     uint32_t patLast = patLen - 1;
     for (uint32_t i = 0; i < patLast; i++) {
         char16_t c = pat[i];
-        if (c >= sBMHCharSetSize)
+        if (c >= sBMHCharSetSize) {
             return sBMHBadPattern;
+        }
         skip[c] = uint8_t(patLast - i);
     }
 
     for (uint32_t k = patLast; k < textLen; ) {
         for (uint32_t i = k, j = patLast; ; i--, j--) {
-            if (text[i] != pat[j])
+            if (text[i] != pat[j]) {
                 break;
-            if (j == 0)
+            }
+            if (j == 0) {
                 return static_cast<int>(i);  /* safe: max string size */
+            }
         }
 
         char16_t c = text[k];
         k += (c >= sBMHCharSetSize) ? patLen : skip[c];
     }
     return -1;
 }
 
@@ -1826,18 +1935,19 @@ struct MemCmp {
 template <typename TextChar, typename PatChar>
 struct ManualCmp {
     typedef const PatChar* Extent;
     static MOZ_ALWAYS_INLINE Extent computeExtent(const PatChar* pat, uint32_t patLen) {
         return pat + patLen;
     }
     static MOZ_ALWAYS_INLINE bool match(const PatChar* p, const TextChar* t, Extent extent) {
         for (; p != extent; ++p, ++t) {
-            if (*p != *t)
+            if (*p != *t) {
                 return false;
+            }
         }
         return true;
     }
 };
 
 template <typename TextChar, typename PatChar>
 static const TextChar*
 FirstCharMatcherUnrolled(const TextChar* text, uint32_t n, const PatChar pat)
@@ -1876,66 +1986,72 @@ FirstCharMatcher8bit(const char* text, u
 }
 
 template <class InnerMatch, typename TextChar, typename PatChar>
 static int
 Matcher(const TextChar* text, uint32_t textlen, const PatChar* pat, uint32_t patlen)
 {
     MOZ_ASSERT(patlen > 0);
 
-    if (sizeof(TextChar) == 1 && sizeof(PatChar) > 1 && pat[0] > 0xff)
+    if (sizeof(TextChar) == 1 && sizeof(PatChar) > 1 && pat[0] > 0xff) {
         return -1;
+    }
 
     const typename InnerMatch::Extent extent = InnerMatch::computeExtent(pat, patlen);
 
     uint32_t i = 0;
     uint32_t n = textlen - patlen + 1;
     while (i < n) {
         const TextChar* pos;
 
         if (sizeof(TextChar) == 1) {
             MOZ_ASSERT(pat[0] <= 0xff);
             pos = (TextChar*) FirstCharMatcher8bit((char*) text + i, n - i, pat[0]);
         } else {
             pos = FirstCharMatcherUnrolled(text + i, n - i, char16_t(pat[0]));
         }
 
-        if (pos == nullptr)
+        if (pos == nullptr) {
             return -1;
+        }
 
         i = static_cast<uint32_t>(pos - text);
-        if (InnerMatch::match(pat + 1, text + i + 1, extent))
+        if (InnerMatch::match(pat + 1, text + i + 1, extent)) {
             return i;
+        }
 
         i += 1;
      }
      return -1;
  }
 
 
 template <typename TextChar, typename PatChar>
 static MOZ_ALWAYS_INLINE int
 StringMatch(const TextChar* text, uint32_t textLen, const PatChar* pat, uint32_t patLen)
 {
-    if (patLen == 0)
+    if (patLen == 0) {
         return 0;
-    if (textLen < patLen)
+    }
+    if (textLen < patLen) {
         return -1;
+    }
 
 #if defined(__i386__) || defined(_M_IX86) || defined(__i386)
     /*
      * Given enough registers, the unrolled loop below is faster than the
      * following loop. 32-bit x86 does not have enough registers.
      */
     if (patLen == 1) {
         const PatChar p0 = *pat;
         const TextChar* end = text + textLen;
         for (const TextChar* c = text; c != end; ++c) {
-            if (*c == p0)
+            if (*c == p0) {
                 return c - text;
+            }
         }
         return -1;
     }
 #endif
 
     /*
      * If the text or pattern string is short, BMH will be more expensive than
      * the basic linear scan due to initialization cost and a more complex loop
@@ -1946,18 +2062,19 @@ StringMatch(const TextChar* text, uint32
      *  - When |patLen| is "too small", even the best case for BMH will be
      *    slower than a simple scan for large |textLen| due to the more complex
      *    loop body of BMH.
      * From this, the values for "big enough" and "too small" are determined
      * empirically. See bug 526348.
      */
     if (textLen >= 512 && patLen >= 11 && patLen <= sBMHPatLenMax) {
         int index = BoyerMooreHorspool(text, textLen, pat, patLen);
-        if (index != sBMHBadPattern)
+        if (index != sBMHBadPattern) {
             return index;
+        }
     }
 
     /*
      * For big patterns with large potential overlap we want the SIMD-optimized
      * speed of memcmp. For small patterns, a simple loop is faster. We also can't
      * use memcmp if one of the strings is TwoByte and the other is Latin-1.
      */
     return (patLen > 128 && IsSame<TextChar, PatChar>::value)
@@ -1971,26 +2088,28 @@ StringMatch(JSLinearString* text, JSLine
     MOZ_ASSERT(start <= text->length());
     uint32_t textLen = text->length() - start;
     uint32_t patLen = pat->length();
 
     int match;
     AutoCheckCannotGC nogc;
     if (text->hasLatin1Chars()) {
         const Latin1Char* textChars = text->latin1Chars(nogc) + start;
-        if (pat->hasLatin1Chars())
+        if (pat->hasLatin1Chars()) {
             match = StringMatch(textChars, textLen, pat->latin1Chars(nogc), patLen);
-        else
+        } else {
             match = StringMatch(textChars, textLen, pat->twoByteChars(nogc), patLen);
+        }
     } else {
         const char16_t* textChars = text->twoByteChars(nogc) + start;
-        if (pat->hasLatin1Chars())
+        if (pat->hasLatin1Chars()) {
             match = StringMatch(textChars, textLen, pat->latin1Chars(nogc), patLen);
-        else
+        } else {
             match = StringMatch(textChars, textLen, pat->twoByteChars(nogc), patLen);
+        }
     }
 
     return (match == -1) ? -1 : start + match;
 }
 
 static const size_t sRopeMatchThresholdRatioLog2 = 4;
 
 int
@@ -2008,18 +2127,19 @@ class StringSegmentRange
     // StackAllocPolicy which stashes a reusable freed-at-gc buffer in the cx.
     using StackVector = JS::GCVector<JSString*, 16>;
     Rooted<StackVector> stack;
     RootedLinearString cur;
 
     bool settle(JSString* str) {
         while (str->isRope()) {
             JSRope& rope = str->asRope();
-            if (!stack.append(rope.rightChild()))
+            if (!stack.append(rope.rightChild())) {
                 return false;
+            }
             str = rope.leftChild();
         }
         cur = &str->asLinear();
         return true;
     }
 
   public:
     explicit StringSegmentRange(JSContext* cx)
@@ -2073,33 +2193,36 @@ RopeMatchImpl(const AutoCheckCannotGC& n
 
         /* Try to find a match starting in 'outer' and running into other nodes. */
         const TextChar* const text = chars + (patLen > len ? 0 : len - patLen + 1);
         const TextChar* const textend = chars + len;
         const PatChar p0 = *pat;
         const PatChar* const p1 = pat + 1;
         const PatChar* const patend = pat + patLen;
         for (const TextChar* t = text; t != textend; ) {
-            if (*t++ != p0)
+            if (*t++ != p0) {
                 continue;
+            }
 
             JSLinearString** innerp = outerp;
             const TextChar* ttend = textend;
             const TextChar* tt = t;
             for (const PatChar* pp = p1; pp != patend; ++pp, ++tt) {
                 while (tt == ttend) {
-                    if (++innerp == strings.end())
+                    if (++innerp == strings.end()) {
                         return -1;
+                    }
 
                     JSLinearString* inner = *innerp;
                     tt = inner->chars<TextChar>(nogc);
                     ttend = tt + inner->length();
                 }
-                if (*pp != *tt)
+                if (*pp != *tt) {
                     goto break_continue;
+                }
             }
 
             /* Matched! */
             return pos + (t - chars) - 1;  /* -1 because of *t++ above */
 
           break_continue:;
         }
 
@@ -2141,64 +2264,71 @@ RopeMatch(JSContext* cx, JSRope* text, J
      * nodes so long as there are not too many.
      *
      * We also don't use rope matching if the rope contains both Latin-1 and
      * TwoByte nodes, to simplify the match algorithm.
      */
     {
         size_t threshold = text->length() >> sRopeMatchThresholdRatioLog2;
         StringSegmentRange r(cx);
-        if (!r.init(text))
+        if (!r.init(text)) {
             return false;
+        }
 
         bool textIsLatin1 = text->hasLatin1Chars();
         while (!r.empty()) {
             if (threshold-- == 0 ||
                 r.front()->hasLatin1Chars() != textIsLatin1 ||
                 !strings.append(r.front()))
             {
                 JSLinearString* linear = text->ensureLinear(cx);
-                if (!linear)
+                if (!linear) {
                     return false;
+                }
 
                 *match = StringMatch(linear, pat);
                 return true;
             }
-            if (!r.popFront())
+            if (!r.popFront()) {
                 return false;
+            }
         }
     }
 
     AutoCheckCannotGC nogc;
     if (text->hasLatin1Chars()) {
-        if (pat->hasLatin1Chars())
+        if (pat->hasLatin1Chars()) {
             *match = RopeMatchImpl<Latin1Char>(nogc, strings, pat->latin1Chars(nogc), patLen);
-        else
+        } else {
             *match = RopeMatchImpl<Latin1Char>(nogc, strings, pat->twoByteChars(nogc), patLen);
+        }
     } else {
-        if (pat->hasLatin1Chars())
+        if (pat->hasLatin1Chars()) {
             *match = RopeMatchImpl<char16_t>(nogc, strings, pat->latin1Chars(nogc), patLen);
-        else
+        } else {
             *match = RopeMatchImpl<char16_t>(nogc, strings, pat->twoByteChars(nogc), patLen);
+        }
     }
 
     return true;
 }
 
 static MOZ_ALWAYS_INLINE bool
 ReportErrorIfFirstArgIsRegExp(JSContext* cx, const CallArgs& args)
 {
     // Only call IsRegExp if the first argument is definitely an object, so we
     // don't pay the cost of an additional function call in the common case.
-    if (args.length() == 0 || !args[0].isObject())
+    if (args.length() == 0 || !args[0].isObject()) {
         return true;
+    }
 
     bool isRegExp;
-    if (!IsRegExp(cx, args[0], &isRegExp))
+    if (!IsRegExp(cx, args[0], &isRegExp)) {
         return false;
+    }
 
     if (isRegExp) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_INVALID_ARG_TYPE,
                                   "first", "", "Regular Expression");
         return false;
     }
     return true;
 }
@@ -2207,83 +2337,91 @@ ReportErrorIfFirstArgIsRegExp(JSContext*
 // 21.1.3.7 String.prototype.includes ( searchString [ , position ] )
 bool
 js::str_includes(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // Steps 1-2.
     RootedString str(cx, ToStringForStringFunction(cx, args.thisv()));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     // Steps 3-4.
-    if (!ReportErrorIfFirstArgIsRegExp(cx, args))
+    if (!ReportErrorIfFirstArgIsRegExp(cx, args)) {
         return false;
+    }
 
     // Step 5.
     RootedLinearString searchStr(cx, ArgToLinearString(cx, args, 0));
-    if (!searchStr)
+    if (!searchStr) {
         return false;
+    }
 
     // Step 6.
     uint32_t pos = 0;
     if (args.hasDefined(1)) {
         if (args[1].isInt32()) {
             int i = args[1].toInt32();
             pos = (i < 0) ? 0U : uint32_t(i);
         } else {
             double d;
-            if (!ToInteger(cx, args[1], &d))
+            if (!ToInteger(cx, args[1], &d)) {
                 return false;
+            }
             pos = uint32_t(Min(Max(d, 0.0), double(UINT32_MAX)));
         }
     }
 
     // Step 7.
     uint32_t textLen = str->length();
 
     // Step 8.
     uint32_t start = Min(Max(pos, 0U), textLen);
 
     // Steps 9-10.
     JSLinearString* text = str->ensureLinear(cx);
-    if (!text)
+    if (!text) {
         return false;
+    }
 
     args.rval().setBoolean(StringMatch(text, searchStr, start) != -1);
     return true;
 }
 
 /* ES6 20120927 draft 15.5.4.7. */
 bool
 js::str_indexOf(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // Steps 1, 2, and 3
     RootedString str(cx, ToStringForStringFunction(cx, args.thisv()));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     // Steps 4 and 5
     RootedLinearString searchStr(cx, ArgToLinearString(cx, args, 0));
-    if (!searchStr)
+    if (!searchStr) {
         return false;
+    }
 
     // Steps 6 and 7
     uint32_t pos = 0;
     if (args.hasDefined(1)) {
         if (args[1].isInt32()) {
             int i = args[1].toInt32();
             pos = (i < 0) ? 0U : uint32_t(i);
         } else {
             double d;
-            if (!ToInteger(cx, args[1], &d))
+            if (!ToInteger(cx, args[1], &d)) {
                 return false;
+            }
             pos = uint32_t(Min(Max(d, 0.0), double(UINT32_MAX)));
         }
     }
 
    // Step 8
     uint32_t textLen = str->length();
 
     // Step 9
@@ -2293,18 +2431,19 @@ js::str_indexOf(JSContext* cx, unsigned 
         // AngularJS often invokes "false".indexOf("false"). This check should
         // be cheap enough to not hurt anything else.
         args.rval().setInt32(start == 0 ? 0 : -1);
         return true;
     }
 
     // Steps 10 and 11
     JSLinearString* text = str->ensureLinear(cx);
-    if (!text)
+    if (!text) {
         return false;
+    }
 
     args.rval().setInt32(StringMatch(text, searchStr, start));
     return true;
 }
 
 template <typename TextChar, typename PatChar>
 static int32_t
 LastIndexOfImpl(const TextChar* text, size_t textLen, const PatChar* pat, size_t patLen,
@@ -2317,18 +2456,19 @@ LastIndexOfImpl(const TextChar* text, si
     const PatChar p0 = *pat;
     const PatChar* patNext = pat + 1;
     const PatChar* patEnd = pat + patLen;
 
     for (const TextChar* t = text + start; t >= text; --t) {
         if (*t == p0) {
             const TextChar* t1 = t + 1;
             for (const PatChar* p1 = patNext; p1 < patEnd; ++p1, ++t1) {
-                if (*t1 != *p1)
+                if (*t1 != *p1) {
                     goto break_continue;
+                }
             }
 
             return static_cast<int32_t>(t - text);
         }
       break_continue:;
     }
 
     return -1;
@@ -2338,49 +2478,54 @@ LastIndexOfImpl(const TextChar* text, si
 // 21.1.3.9 String.prototype.lastIndexOf ( searchString [ , position ] )
 bool
 js::str_lastIndexOf(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // Steps 1-2.
     RootedString str(cx, ToStringForStringFunction(cx, args.thisv()));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     // Step 3.
     RootedLinearString searchStr(cx, ArgToLinearString(cx, args, 0));
-    if (!searchStr)
+    if (!searchStr) {
         return false;
+    }
 
     // Step 6.
     size_t len = str->length();
 
     // Step 8.
     size_t searchLen = searchStr->length();
 
     // Steps 4-5, 7.
     int start = len - searchLen; // Start searching here
     if (args.hasDefined(1)) {
         if (args[1].isInt32()) {
             int i = args[1].toInt32();
-            if (i <= 0)
+            if (i <= 0) {
                 start = 0;
-            else if (i < start)
+            } else if (i < start) {
                 start = i;
+            }
         } else {
             double d;
-            if (!ToNumber(cx, args[1], &d))
+            if (!ToNumber(cx, args[1], &d)) {
                 return false;
+            }
             if (!IsNaN(d)) {
                 d = JS::ToInteger(d);
-                if (d <= 0)
+                if (d <= 0) {
                     start = 0;
-                else if (d < start)
+                } else if (d < start) {
                     start = int(d);
+                }
             }
         }
     }
 
     if (str == searchStr) {
         args.rval().setInt32(0);
         return true;
     }
@@ -2392,71 +2537,78 @@ js::str_lastIndexOf(JSContext* cx, unsig
 
     if (searchLen == 0) {
         args.rval().setInt32(start);
         return true;
     }
     MOZ_ASSERT(0 <= start && size_t(start) < len);
 
     JSLinearString* text = str->ensureLinear(cx);
-    if (!text)
+    if (!text) {
         return false;
+    }
 
     // Step 9.
     int32_t res;
     AutoCheckCannotGC nogc;
     if (text->hasLatin1Chars()) {
         const Latin1Char* textChars = text->latin1Chars(nogc);
-        if (searchStr->hasLatin1Chars())
+        if (searchStr->hasLatin1Chars()) {
             res = LastIndexOfImpl(textChars, len, searchStr->latin1Chars(nogc), searchLen, start);
-        else
+        } else {
             res = LastIndexOfImpl(textChars, len, searchStr->twoByteChars(nogc), searchLen, start);
+        }
     } else {
         const char16_t* textChars = text->twoByteChars(nogc);
-        if (searchStr->hasLatin1Chars())
+        if (searchStr->hasLatin1Chars()) {
             res = LastIndexOfImpl(textChars, len, searchStr->latin1Chars(nogc), searchLen, start);
-        else
+        } else {
             res = LastIndexOfImpl(textChars, len, searchStr->twoByteChars(nogc), searchLen, start);
+        }
     }
 
     args.rval().setInt32(res);
     return true;
 }
 
 // ES2018 draft rev de77aaeffce115deaf948ed30c7dbe4c60983c0c
 // 21.1.3.20 String.prototype.startsWith ( searchString [ , position ] )
 bool
 js::str_startsWith(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // Steps 1-2.
     RootedString str(cx, ToStringForStringFunction(cx, args.thisv()));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     // Steps 3-4.
-    if (!ReportErrorIfFirstArgIsRegExp(cx, args))
+    if (!ReportErrorIfFirstArgIsRegExp(cx, args)) {
         return false;
+    }
 
     // Step 5.
     RootedLinearString searchStr(cx, ArgToLinearString(cx, args, 0));
-    if (!searchStr)
+    if (!searchStr) {
         return false;
+    }
 
     // Step 6.
     uint32_t pos = 0;
     if (args.hasDefined(1)) {
         if (args[1].isInt32()) {
             int i = args[1].toInt32();
             pos = (i < 0) ? 0U : uint32_t(i);
         } else {
             double d;
-            if (!ToInteger(cx, args[1], &d))
+            if (!ToInteger(cx, args[1], &d)) {
                 return false;
+            }
             pos = uint32_t(Min(Max(d, 0.0), double(UINT32_MAX)));
         }
     }
 
     // Step 7.
     uint32_t textLen = str->length();
 
     // Step 8.
@@ -2468,57 +2620,62 @@ js::str_startsWith(JSContext* cx, unsign
     // Step 10.
     if (searchLen + start < searchLen || searchLen + start > textLen) {
         args.rval().setBoolean(false);
         return true;
     }
 
     // Steps 11-12.
     JSLinearString* text = str->ensureLinear(cx);
-    if (!text)
+    if (!text) {
         return false;
+    }
 
     args.rval().setBoolean(HasSubstringAt(text, searchStr, start));
     return true;
 }
 
 // ES2018 draft rev de77aaeffce115deaf948ed30c7dbe4c60983c0c
 // 21.1.3.6 String.prototype.endsWith ( searchString [ , endPosition ] )
 bool
 js::str_endsWith(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // Steps 1-2.
     RootedString str(cx, ToStringForStringFunction(cx, args.thisv()));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     // Steps 3-4.
-    if (!ReportErrorIfFirstArgIsRegExp(cx, args))
+    if (!ReportErrorIfFirstArgIsRegExp(cx, args)) {
         return false;
+    }
 
     // Step 5.
     RootedLinearString searchStr(cx, ArgToLinearString(cx, args, 0));
-    if (!searchStr)
+    if (!searchStr) {
         return false;
+    }
 
     // Step 6.
     uint32_t textLen = str->length();
 
     // Step 7.
     uint32_t pos = textLen;
     if (args.hasDefined(1)) {
         if (args[1].isInt32()) {
             int i = args[1].toInt32();
             pos = (i < 0) ? 0U : uint32_t(i);
         } else {
             double d;
-            if (!ToInteger(cx, args[1], &d))
+            if (!ToInteger(cx, args[1], &d)) {
                 return false;
+            }
             pos = uint32_t(Min(Max(d, 0.0), double(UINT32_MAX)));
         }
     }
 
     // Step 8.
     uint32_t end = Min(Max(pos, 0U), textLen);
 
     // Step 9.
@@ -2530,68 +2687,74 @@ js::str_endsWith(JSContext* cx, unsigned
         return true;
     }
 
     // Step 10.
     uint32_t start = end - searchLen;
 
     // Steps 12-13.
     JSLinearString* text = str->ensureLinear(cx);
-    if (!text)
+    if (!text) {
         return false;
+    }
 
     args.rval().setBoolean(HasSubstringAt(text, searchStr, start));
     return true;
 }
 
 template <typename CharT>
 static void
 TrimString(const CharT* chars, bool trimStart, bool trimEnd, size_t length,
            size_t* pBegin, size_t* pEnd)
 {
     size_t begin = 0, end = length;
 
     if (trimStart) {
-        while (begin < length && unicode::IsSpace(chars[begin]))
+        while (begin < length && unicode::IsSpace(chars[begin])) {
             ++begin;
+        }
     }
 
     if (trimEnd) {
-        while (end > begin && unicode::IsSpace(chars[end - 1]))
+        while (end > begin && unicode::IsSpace(chars[end - 1])) {
             --end;
+        }
     }
 
     *pBegin = begin;
     *pEnd = end;
 }
 
 static bool
 TrimString(JSContext* cx, const CallArgs& args, bool trimStart, bool trimEnd)
 {
     JSString* str = ToStringForStringFunction(cx, args.thisv());
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     JSLinearString* linear = str->ensureLinear(cx);
-    if (!linear)
+    if (!linear) {
         return false;
+    }
 
     size_t length = linear->length();
     size_t begin, end;
     if (linear->hasLatin1Chars()) {
         AutoCheckCannotGC nogc;
         TrimString(linear->latin1Chars(nogc), trimStart, trimEnd, length, &begin, &end);
     } else {
         AutoCheckCannotGC nogc;
         TrimString(linear->twoByteChars(nogc), trimStart, trimEnd, length, &begin, &end);
     }
 
     JSLinearString* result = NewDependentString(cx, linear, begin, end - begin);
-    if (!result)
+    if (!result) {
         return false;
+    }
 
     args.rval().setString(result);
     return true;
 }
 
 bool
 js::str_trim(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -2660,27 +2823,30 @@ FindDollarIndex(const CharT* chars, size
  */
 static JSString*
 BuildFlatReplacement(JSContext* cx, HandleString textstr, HandleLinearString repstr,
                      size_t matchStart, size_t patternLength)
 {
     size_t matchEnd = matchStart + patternLength;
 
     RootedString resultStr(cx, NewDependentString(cx, textstr, 0, matchStart));
-    if (!resultStr)
+    if (!resultStr) {
         return nullptr;
+    }
 
     resultStr = ConcatStrings<CanGC>(cx, resultStr, repstr);
-    if (!resultStr)
+    if (!resultStr) {
         return nullptr;
+    }
 
     MOZ_ASSERT(textstr->length() >= matchEnd);
     RootedString rest(cx, NewDependentString(cx, textstr, matchEnd, textstr->length() - matchEnd));
-    if (!rest)
+    if (!rest) {
         return nullptr;
+    }
 
     return ConcatStrings<CanGC>(cx, resultStr, rest);
 }
 
 static JSString*
 BuildFlatRopeReplacement(JSContext* cx, HandleString textstr, HandleLinearString repstr,
                          size_t match, size_t patternLength)
 {
@@ -2688,18 +2854,19 @@ BuildFlatRopeReplacement(JSContext* cx, 
 
     size_t matchEnd = match + patternLength;
 
     /*
      * If we are replacing over a rope, avoid flattening it by iterating
      * through it, building a new rope.
      */
     StringSegmentRange r(cx);
-    if (!r.init(textstr))
+    if (!r.init(textstr)) {
         return nullptr;
+    }
 
     RopeBuilder builder(cx);
     size_t pos = 0;
     while (!r.empty()) {
         RootedString str(cx, r.front());
         size_t len = str->length();
         size_t strEnd = pos + len;
         if (pos < matchEnd && strEnd > match) {
@@ -2725,26 +2892,29 @@ BuildFlatRopeReplacement(JSContext* cx, 
 
             /*
              * If str runs off the end of the matched string, append the
              * last part of str.
              */
             if (strEnd > matchEnd) {
                 RootedString rightSide(cx, NewDependentString(cx, str, matchEnd - pos,
                                                               strEnd - matchEnd));
-                if (!rightSide || !builder.append(rightSide))
+                if (!rightSide || !builder.append(rightSide)) {
                     return nullptr;
+                }
             }
         } else {
-            if (!builder.append(str))
+            if (!builder.append(str)) {
                 return nullptr;
+            }
         }
         pos += str->length();
-        if (!r.popFront())
+        if (!r.popFront()) {
             return nullptr;
+        }
     }
 
     return builder.result();
 }
 
 template <typename CharT>
 static bool
 AppendDollarReplacement(StringBuffer& newReplaceChars, size_t firstDollarIndex,
@@ -2755,88 +2925,98 @@ AppendDollarReplacement(StringBuffer& ne
 
     /* Move the pre-dollar chunk in bulk. */
     newReplaceChars.infallibleAppend(repChars, firstDollarIndex);
 
     /* Move the rest char-by-char, interpreting dollars as we encounter them. */
     const CharT* repLimit = repChars + repLength;
     for (const CharT* it = repChars + firstDollarIndex; it < repLimit; ++it) {
         if (*it != '$' || it == repLimit - 1) {
-            if (!newReplaceChars.append(*it))
+            if (!newReplaceChars.append(*it)) {
                 return false;
+            }
             continue;
         }
 
         switch (*(it + 1)) {
           case '$': /* Eat one of the dollars. */
-            if (!newReplaceChars.append(*it))
+            if (!newReplaceChars.append(*it)) {
                 return false;
+            }
             break;
           case '&':
-            if (!newReplaceChars.appendSubstring(text, matchStart, matchLimit - matchStart))
+            if (!newReplaceChars.appendSubstring(text, matchStart, matchLimit - matchStart)) {
                 return false;
+            }
             break;
           case '`':
-            if (!newReplaceChars.appendSubstring(text, 0, matchStart))
+            if (!newReplaceChars.appendSubstring(text, 0, matchStart)) {
                 return false;
+            }
             break;
           case '\'':
-            if (!newReplaceChars.appendSubstring(text, matchLimit, text->length() - matchLimit))
+            if (!newReplaceChars.appendSubstring(text, matchLimit, text->length() - matchLimit)) {
                 return false;
+            }
             break;
           default: /* The dollar we saw was not special (no matter what its mother told it). */
-            if (!newReplaceChars.append(*it))
+            if (!newReplaceChars.append(*it)) {
                 return false;
+            }
             continue;
         }
         ++it; /* We always eat an extra char in the above switch. */
     }
 
     return true;
 }
 
 /*
  * Perform a linear-scan dollar substitution on the replacement text.
  */
 static JSLinearString*
 InterpretDollarReplacement(JSContext* cx, HandleString textstrArg, HandleLinearString repstr,
                            uint32_t firstDollarIndex, size_t matchStart, size_t patternLength)
 {
     RootedLinearString textstr(cx, textstrArg->ensureLinear(cx));
-    if (!textstr)
+    if (!textstr) {
         return nullptr;
+    }
 
     size_t matchLimit = matchStart + patternLength;
 
     /*
      * Most probably:
      *
      *      len(newstr) >= len(orig) - len(match) + len(replacement)
      *
      * Note that dollar vars _could_ make the resulting text smaller than this.
      */
     StringBuffer newReplaceChars(cx);
-    if (repstr->hasTwoByteChars() && !newReplaceChars.ensureTwoByteChars())
+    if (repstr->hasTwoByteChars() && !newReplaceChars.ensureTwoByteChars()) {
         return nullptr;
-
-    if (!newReplaceChars.reserve(textstr->length() - patternLength + repstr->length()))
+    }
+
+    if (!newReplaceChars.reserve(textstr->length() - patternLength + repstr->length())) {
         return nullptr;
+    }
 
     bool res;
     if (repstr->hasLatin1Chars()) {
         AutoCheckCannotGC nogc;
         res = AppendDollarReplacement(newReplaceChars, firstDollarIndex, matchStart, matchLimit,
                                       textstr, repstr->latin1Chars(nogc), repstr->length());
     } else {
         AutoCheckCannotGC nogc;
         res = AppendDollarReplacement(newReplaceChars, firstDollarIndex, matchStart, matchLimit,
                                       textstr, repstr->twoByteChars(nogc), repstr->length());
     }
-    if (!res)
+    if (!res) {
         return nullptr;
+    }
 
     return newReplaceChars.finishString();
 }
 
 template <typename StrChar, typename RepChar>
 static bool
 StrFlatReplaceGlobal(JSContext* cx, JSLinearString* str, JSLinearString* pat, JSLinearString* rep,
                      StringBuffer& sb)
@@ -2853,114 +3033,132 @@ StrFlatReplaceGlobal(JSContext* cx, JSLi
         CheckedInt<uint32_t> strLength(str->length());
         CheckedInt<uint32_t> repLength(rep->length());
         CheckedInt<uint32_t> length = repLength * (strLength - 1) + strLength;
         if (!length.isValid()) {
             ReportAllocationOverflow(cx);
             return false;
         }
 
-        if (!sb.reserve(length.value()))
+        if (!sb.reserve(length.value())) {
             return false;
+        }
 
         for (unsigned i = 0; i < str->length() - 1; ++i, ++strChars) {
             sb.infallibleAppend(*strChars);
             sb.infallibleAppend(repChars, rep->length());
         }
         sb.infallibleAppend(*strChars);
         return true;
     }
 
     // If it's true, we are sure that the result's length is, at least, the same
     // length as |str->length()|.
     if (rep->length() >= pat->length()) {
-        if (!sb.reserve(str->length()))
+        if (!sb.reserve(str->length())) {
             return false;
+        }
     }
 
     uint32_t start = 0;
     for (;;) {
         int match = StringMatch(str, pat, start);
-        if (match < 0)
+        if (match < 0) {
             break;
-        if (!sb.append(strChars + start, match - start))
+        }
+        if (!sb.append(strChars + start, match - start)) {
             return false;
-        if (!sb.append(repChars, rep->length()))
+        }
+        if (!sb.append(repChars, rep->length())) {
             return false;
+        }
         start = match + pat->length();
     }
 
-    if (!sb.append(strChars + start, str->length() - start))
+    if (!sb.append(strChars + start, str->length() - start)) {
         return false;
+    }
 
     return true;
 }
 
 // This is identical to "str.split(pattern).join(replacement)" except that we
 // do some deforestation optimization in Ion.
 JSString*
 js::str_flat_replace_string(JSContext* cx, HandleString string, HandleString pattern,
                             HandleString replacement)
 {
     MOZ_ASSERT(string);
     MOZ_ASSERT(pattern);
     MOZ_ASSERT(replacement);
 
-    if (!string->length())
+    if (!string->length()) {
         return string;
+    }
 
     RootedLinearString linearRepl(cx, replacement->ensureLinear(cx));
-    if (!linearRepl)
+    if (!linearRepl) {
         return nullptr;
+    }
 
     RootedLinearString linearPat(cx, pattern->ensureLinear(cx));
-    if (!linearPat)
+    if (!linearPat) {
         return nullptr;
+    }
 
     RootedLinearString linearStr(cx, string->ensureLinear(cx));
-    if (!linearStr)
+    if (!linearStr) {
         return nullptr;
+    }
 
     StringBuffer sb(cx);
     if (linearStr->hasTwoByteChars()) {
-        if (!sb.ensureTwoByteChars())
+        if (!sb.ensureTwoByteChars()) {
             return nullptr;
+        }
         if (linearRepl->hasTwoByteChars()) {
-            if (!StrFlatReplaceGlobal<char16_t, char16_t>(cx, linearStr, linearPat, linearRepl, sb))
+            if (!StrFlatReplaceGlobal<char16_t, char16_t>(cx, linearStr, linearPat, linearRepl, sb)) {
                 return nullptr;
+            }
         } else {
-            if (!StrFlatReplaceGlobal<char16_t, Latin1Char>(cx, linearStr, linearPat, linearRepl, sb))
+            if (!StrFlatReplaceGlobal<char16_t, Latin1Char>(cx, linearStr, linearPat, linearRepl, sb)) {
                 return nullptr;
+            }
         }
     } else {
         if (linearRepl->hasTwoByteChars()) {
-            if (!sb.ensureTwoByteChars())
+            if (!sb.ensureTwoByteChars()) {
                 return nullptr;
-            if (!StrFlatReplaceGlobal<Latin1Char, char16_t>(cx, linearStr, linearPat, linearRepl, sb))
+            }
+            if (!StrFlatReplaceGlobal<Latin1Char, char16_t>(cx, linearStr, linearPat, linearRepl, sb)) {
                 return nullptr;
+            }
         } else {
-            if (!StrFlatReplaceGlobal<Latin1Char, Latin1Char>(cx, linearStr, linearPat, linearRepl, sb))
+            if (!StrFlatReplaceGlobal<Latin1Char, Latin1Char>(cx, linearStr, linearPat, linearRepl, sb)) {
                 return nullptr;
+            }
         }
     }
 
     return sb.finishString();
 }
 
 JSString*
 js::str_replace_string_raw(JSContext* cx, HandleString string, HandleString pattern,
                            HandleString replacement)
 {
     RootedLinearString repl(cx, replacement->ensureLinear(cx));
-    if (!repl)
+    if (!repl) {
         return nullptr;
+    }
 
     RootedLinearString pat(cx, pattern->ensureLinear(cx));
-    if (!pat)
+    if (!pat) {
         return nullptr;
+    }
 
     size_t patternLength = pat->length();
     int32_t match;
     uint32_t dollarIndex;
 
     {
         AutoCheckCannotGC nogc;
         dollarIndex = repl->hasLatin1Chars()
@@ -2968,41 +3166,45 @@ js::str_replace_string_raw(JSContext* cx
                       : FindDollarIndex(repl->twoByteChars(nogc), repl->length());
     }
 
     /*
      * |string| could be a rope, so we want to avoid flattening it for as
      * long as possible.
      */
     if (string->isRope()) {
-        if (!RopeMatch(cx, &string->asRope(), pat, &match))
+        if (!RopeMatch(cx, &string->asRope(), pat, &match)) {
             return nullptr;
+        }
     } else {
         match = StringMatch(&string->asLinear(), pat, 0);
     }
 
-    if (match < 0)
+    if (match < 0) {
         return string;
+    }
 
     if (dollarIndex != UINT32_MAX) {
         repl = InterpretDollarReplacement(cx, string, repl, dollarIndex, match, patternLength);
-        if (!repl)
+        if (!repl) {
             return nullptr;
+        }
     } else if (string->isRope()) {
         return BuildFlatRopeReplacement(cx, string, repl, match, patternLength);
     }
     return BuildFlatReplacement(cx, string, repl, match, patternLength);
 }
 
 static ArrayObject*
 NewFullyAllocatedStringArray(JSContext* cx, HandleObjectGroup group, uint32_t length)
 {
     ArrayObject* array = NewFullyAllocatedArrayTryUseGroup(cx, group, length);
-    if (!array)
+    if (!array) {
         return nullptr;
+    }
 
     // Only string values will be added to this array. Inform TI early about
     // the element type, so we can directly initialize all elements using
     // NativeObject::initDenseElement() instead of the slightly more expensive
     // NativeObject::initDenseElementWithType() method.
     // Since this function is never called to create a zero-length array, it's
     // always necessary and correct to call AddTypePropertyId here.
     MOZ_ASSERT(length > 0);
@@ -3010,18 +3212,19 @@ NewFullyAllocatedStringArray(JSContext* 
 
     return array;
 }
 
 static ArrayObject*
 SingleElementStringArray(JSContext* cx, HandleObjectGroup group, HandleLinearString str)
 {
     ArrayObject* array = NewFullyAllocatedStringArray(cx, group, 1);
-    if (!array)
+    if (!array) {
         return nullptr;
+    }
     array->setDenseInitializedLength(1);
     array->initDenseElement(0, StringValue(str));
     return array;
 }
 
 // ES 2016 draft Mar 25, 2016 21.1.3.17 steps 4, 8, 12-18.
 static ArrayObject*
 SplitHelper(JSContext* cx, HandleLinearString str, uint32_t limit, HandleLinearString sep,
@@ -3032,18 +3235,19 @@ SplitHelper(JSContext* cx, HandleLinearS
     MOZ_ASSERT(sepLength != 0);
 
     // Step 12.
     if (strLength == 0) {
         // Step 12.a.
         int match = StringMatch(str, sep, 0);
 
         // Step 12.b.
-        if (match != -1)
+        if (match != -1) {
             return NewFullyAllocatedArrayTryUseGroup(cx, group, 0);
+        }
 
         // Steps 12.c-e.
         return SingleElementStringArray(cx, group, str);
     }
 
     // Step 3 (reordered).
     AutoValueVector splits(cx);
 
@@ -3066,18 +3270,19 @@ SplitHelper(JSContext* cx, HandleLinearS
         //
         // But what if the match is at the end of the string (and the string is
         // not empty)?  Per 14.c.i this shouldn't be a match, so we have to
         // specially exclude it.  Thus this case should hold:
         //
         //   var a = "abc".split(/\b/);
         //   assertEq(a.length, 1);
         //   assertEq(a[0], "abc");
-        if (match == -1)
+        if (match == -1) {
             break;
+        }
 
         // Step 14.c.
         size_t endIndex = match + sepLength;
 
         // Step 14.c.i.
         if (endIndex == lastEndIndex) {
             index++;
             continue;
@@ -3088,161 +3293,177 @@ SplitHelper(JSContext* cx, HandleLinearS
         MOZ_ASSERT(sepLength <= strLength);
         MOZ_ASSERT(lastEndIndex + sepLength <= endIndex);
 
         // Step 14.c.ii.1.
         size_t subLength = size_t(endIndex - sepLength - lastEndIndex);
         JSString* sub = NewDependentString(cx, str, lastEndIndex, subLength);
 
         // Steps 14.c.ii.2-4.
-        if (!sub || !splits.append(StringValue(sub)))
+        if (!sub || !splits.append(StringValue(sub))) {
             return nullptr;
+        }
 
         // Step 14.c.ii.5.
-        if (splits.length() == limit)
+        if (splits.length() == limit) {
             return NewCopiedArrayTryUseGroup(cx, group, splits.begin(), splits.length());
+        }
 
         // Step 14.c.ii.6.
         index = endIndex;
 
         // Step 14.c.ii.7.
         lastEndIndex = index;
     }
 
     // Step 15.
     JSString* sub = NewDependentString(cx, str, lastEndIndex, strLength - lastEndIndex);
 
     // Steps 16-17.
-    if (!sub || !splits.append(StringValue(sub)))
+    if (!sub || !splits.append(StringValue(sub))) {
         return nullptr;
+    }
 
     // Step 18.
     return NewCopiedArrayTryUseGroup(cx, group, splits.begin(), splits.length());
 }
 
 // Fast-path for splitting a string into a character array via split("").
 static ArrayObject*
 CharSplitHelper(JSContext* cx, HandleLinearString str, uint32_t limit, HandleObjectGroup group)
 {
     size_t strLength = str->length();
-    if (strLength == 0)
+    if (strLength == 0) {
         return NewFullyAllocatedArrayTryUseGroup(cx, group, 0);
+    }
 
     js::StaticStrings& staticStrings = cx->staticStrings();
     uint32_t resultlen = (limit < strLength ? limit : strLength);
     MOZ_ASSERT(limit > 0 && resultlen > 0,
                "Neither limit nor strLength is zero, so resultlen is greater than zero.");
 
     RootedArrayObject splits(cx, NewFullyAllocatedStringArray(cx, group, resultlen));
-    if (!splits)
+    if (!splits) {
         return nullptr;
+    }
 
     if (str->hasLatin1Chars()) {
         splits->setDenseInitializedLength(resultlen);
 
         JS::AutoCheckCannotGC nogc;
         const Latin1Char* latin1Chars = str->latin1Chars(nogc);
         for (size_t i = 0; i < resultlen; ++i) {
             Latin1Char c = latin1Chars[i];
             MOZ_ASSERT(staticStrings.hasUnit(c));
             splits->initDenseElement(i, StringValue(staticStrings.getUnit(c)));
         }
     } else {
         splits->ensureDenseInitializedLength(cx, 0, resultlen);
 
         for (size_t i = 0; i < resultlen; ++i) {
             JSString* sub = staticStrings.getUnitStringForElement(cx, str, i);
-            if (!sub)
+            if (!sub) {
                 return nullptr;
+            }
             splits->initDenseElement(i, StringValue(sub));
         }
     }
 
     return splits;
 }
 
 template <typename TextChar>
 static MOZ_ALWAYS_INLINE ArrayObject*
 SplitSingleCharHelper(JSContext* cx, HandleLinearString str, const TextChar* text,
                       uint32_t textLen, char16_t patCh, HandleObjectGroup group)
 {
     // Count the number of occurrences of patCh within text.
     uint32_t count = 0;
     for (size_t index = 0; index < textLen; index++) {
-        if (static_cast<char16_t>(text[index]) == patCh)
+        if (static_cast<char16_t>(text[index]) == patCh) {
             count++;
+        }
     }
 
     // Handle zero-occurrence case - return input string in an array.
-    if (count == 0)
+    if (count == 0) {
         return SingleElementStringArray(cx, group, str);
+    }
 
     // Create the result array for the substring values.
     RootedArrayObject splits(cx, NewFullyAllocatedStringArray(cx, group, count + 1));
-    if (!splits)
+    if (!splits) {
         return nullptr;
+    }
     splits->ensureDenseInitializedLength(cx, 0, count + 1);
 
     // Add substrings.
     uint32_t splitsIndex = 0;
     size_t lastEndIndex = 0;
     for (size_t index = 0; index < textLen; index++) {
         if (static_cast<char16_t>(text[index]) == patCh) {
             size_t subLength = size_t(index - lastEndIndex);
             JSString* sub = NewDependentString(cx, str, lastEndIndex, subLength);
-            if (!sub)
+            if (!sub) {
                 return nullptr;
+            }
             splits->initDenseElement(splitsIndex++, StringValue(sub));
             lastEndIndex = index + 1;
         }
     }
 
     // Add substring for tail of string (after last match).
     JSString* sub = NewDependentString(cx, str, lastEndIndex, textLen - lastEndIndex);
-    if (!sub)
+    if (!sub) {
         return nullptr;
+    }
     splits->initDenseElement(splitsIndex++, StringValue(sub));
 
     return splits;
 }
 
 // ES 2016 draft Mar 25, 2016 21.1.3.17 steps 4, 8, 12-18.
 static ArrayObject*
 SplitSingleCharHelper(JSContext* cx, HandleLinearString str, char16_t ch, HandleObjectGroup group)
 {
     // Step 12.
     size_t strLength = str->length();
 
     AutoStableStringChars linearChars(cx);
-    if (!linearChars.init(cx, str))
+    if (!linearChars.init(cx, str)) {
         return nullptr;
-
-    if (linearChars.isLatin1())
+    }
+
+    if (linearChars.isLatin1()) {
         return SplitSingleCharHelper(cx, str, linearChars.latin1Chars(), strLength, ch, group);
+    }
 
     return SplitSingleCharHelper(cx, str, linearChars.twoByteChars(), strLength, ch, group);
 }
 
 // ES 2016 draft Mar 25, 2016 21.1.3.17 steps 4, 8, 12-18.
 ArrayObject*
 js::str_split_string(JSContext* cx, HandleObjectGroup group, HandleString str, HandleString sep,
                      uint32_t limit)
 {
     MOZ_ASSERT(limit > 0, "Only called for strictly positive limit.");
 
     RootedLinearString linearStr(cx, str->ensureLinear(cx));
-    if (!linearStr)
+    if (!linearStr) {
         return nullptr;
+    }
 
     RootedLinearString linearSep(cx, sep->ensureLinear(cx));
-    if (!linearSep)
+    if (!linearSep) {
         return nullptr;
-
-    if (linearSep->length() == 0)
+    }
+
+    if (linearSep->length() == 0) {
         return CharSplitHelper(cx, linearStr, limit, group);
+    }
 
     if (linearSep->length() == 1 && limit >= static_cast<uint32_t>(INT32_MAX)) {
         char16_t ch = linearSep->latin1OrTwoByteChar(0);
         return SplitSingleCharHelper(cx, linearStr, ch, group);
     }
 
     return SplitHelper(cx, linearStr, limit, linearSep, group);
 }
@@ -3250,37 +3471,40 @@ js::str_split_string(JSContext* cx, Hand
 /*
  * Python-esque sequence operations.
  */
 bool
 js::str_concat(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     JSString* str = ToStringForStringFunction(cx, args.thisv());
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     for (unsigned i = 0; i < args.length(); i++) {
         JSString* argStr = ToString<NoGC>(cx, args[i]);
         if (!argStr) {
             RootedString strRoot(cx, str);
             argStr = ToString<CanGC>(cx, args[i]);
-            if (!argStr)
+            if (!argStr) {
                 return false;
+            }
             str = strRoot;
         }
 
         JSString* next = ConcatStrings<NoGC>(cx, str, argStr);
         if (next) {
             str = next;
         } else {
             RootedString strRoot(cx, str), argStrRoot(cx, argStr);
             str = ConcatStrings<CanGC>(cx, strRoot, argStrRoot);
-            if (!str)
+            if (!str) {
                 return false;
+            }
         }
     }
 
     args.rval().setString(str);
     return true;
 }
 
 static const JSFunctionSpec string_methods[] = {
@@ -3352,103 +3576,113 @@ static const JSFunctionSpec string_metho
 // ES6 rev 27 (2014 Aug 24) 21.1.1
 bool
 js::StringConstructor(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     RootedString str(cx);
     if (args.length() > 0) {
-        if (!args.isConstructing() && args[0].isSymbol())
+        if (!args.isConstructing() && args[0].isSymbol()) {
             return js::SymbolDescriptiveString(cx, args[0].toSymbol(), args.rval());
+        }
 
         str = ToString<CanGC>(cx, args[0]);
-        if (!str)
+        if (!str) {
             return false;
+        }
     } else {
         str = cx->runtime()->emptyString;
     }
 
     if (args.isConstructing()) {
         RootedObject proto(cx);
-        if (!GetPrototypeFromBuiltinConstructor(cx, args, &proto))
+        if (!GetPrototypeFromBuiltinConstructor(cx, args, &proto)) {
             return false;
+        }
 
         StringObject* strobj = StringObject::create(cx, str, proto);
-        if (!strobj)
+        if (!strobj) {
             return false;
+        }
         args.rval().setObject(*strobj);
         return true;
     }
 
     args.rval().setString(str);
     return true;
 }
 
 bool
 js::str_fromCharCode(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     MOZ_ASSERT(args.length() <= ARGS_LENGTH_MAX);
 
     // Optimize the single-char case.
-    if (args.length() == 1)
+    if (args.length() == 1) {
         return str_fromCharCode_one_arg(cx, args[0], args.rval());
+    }
 
     // Optimize the case where the result will definitely fit in an inline
     // string (thin or fat) and so we don't need to malloc the chars. (We could
     // cover some cases where args.length() goes up to
     // JSFatInlineString::MAX_LENGTH_LATIN1 if we also checked if the chars are
     // all Latin-1, but it doesn't seem worth the effort.)
     InlineCharBuffer<char16_t> chars;
-    if (!chars.maybeAlloc(cx, args.length()))
+    if (!chars.maybeAlloc(cx, args.length())) {
         return false;
+    }
 
     char16_t* rawChars = chars.get();
     for (unsigned i = 0; i < args.length(); i++) {
         uint16_t code;
-        if (!ToUint16(cx, args[i], &code))
+        if (!ToUint16(cx, args[i], &code)) {
             return false;
+        }
 
         rawChars[i] = char16_t(code);
     }
 
     JSString* str = chars.toString(cx, args.length());
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     args.rval().setString(str);
     return true;
 }
 
 static inline bool
 CodeUnitToString(JSContext* cx, uint16_t ucode, MutableHandleValue rval)
 {
     if (StaticStrings::hasUnit(ucode)) {
         rval.setString(cx->staticStrings().getUnit(ucode));
         return true;
     }
 
     char16_t c = char16_t(ucode);
     JSString* str = NewStringCopyNDontDeflate<CanGC>(cx, &c, 1);
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     rval.setString(str);
     return true;
 }
 
 bool
 js::str_fromCharCode_one_arg(JSContext* cx, HandleValue code, MutableHandleValue rval)
 {
     uint16_t ucode;
 
-    if (!ToUint16(cx, code, &ucode))
+    if (!ToUint16(cx, code, &ucode)) {
         return false;
+    }
 
     return CodeUnitToString(cx, ucode, rval);
 }
 
 static MOZ_ALWAYS_INLINE bool
 ToCodePoint(JSContext* cx, HandleValue code, uint32_t* codePoint)
 {
     // String.fromCodePoint, Steps 5.a-b.
@@ -3458,49 +3692,54 @@ ToCodePoint(JSContext* cx, HandleValue c
         int32_t nextCP = code.toInt32();
         if (nextCP >= 0 && nextCP <= int32_t(unicode::NonBMPMax)) {
             *codePoint = uint32_t(nextCP);
             return true;
         }
     }
 
     double nextCP;
-    if (!ToNumber(cx, code, &nextCP))
+    if (!ToNumber(cx, code, &nextCP)) {
         return false;
+    }
 
     // String.fromCodePoint, Steps 5.c-d.
     if (JS::ToInteger(nextCP) != nextCP || nextCP < 0 || nextCP > unicode::NonBMPMax) {
         ToCStringBuf cbuf;
-        if (const char* numStr = NumberToCString(cx, &cbuf, nextCP))
+        if (const char* numStr = NumberToCString(cx, &cbuf, nextCP)) {
             JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_NOT_A_CODEPOINT, numStr);
+        }
         return false;
     }
 
     *codePoint = uint32_t(nextCP);
     return true;
 }
 
 bool
 js::str_fromCodePoint_one_arg(JSContext* cx, HandleValue code, MutableHandleValue rval)
 {
     // Steps 1-4 (omitted).
 
     // Steps 5.a-d.
     uint32_t codePoint;
-    if (!ToCodePoint(cx, code, &codePoint))
+    if (!ToCodePoint(cx, code, &codePoint)) {
         return false;
+    }
 
     // Steps 5.e, 6.
-    if (!unicode::IsSupplementary(codePoint))
+    if (!unicode::IsSupplementary(codePoint)) {
         return CodeUnitToString(cx, uint16_t(codePoint), rval);
+    }
 
     char16_t chars[] = { unicode::LeadSurrogate(codePoint), unicode::TrailSurrogate(codePoint) };
     JSString* str = NewStringCopyNDontDeflate<CanGC>(cx, chars, 2);
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     rval.setString(str);
     return true;
 }
 
 static bool
 str_fromCodePoint_few_args(JSContext* cx, const CallArgs& args)
 {
@@ -3511,77 +3750,84 @@ str_fromCodePoint_few_args(JSContext* cx
     // Step 3.
     char16_t elements[JSFatInlineString::MAX_LENGTH_TWO_BYTE];
 
     // Steps 4-5.
     unsigned length = 0;
     for (unsigned nextIndex = 0; nextIndex < args.length(); nextIndex++) {
         // Steps 5.a-d.
         uint32_t codePoint;
-        if (!ToCodePoint(cx, args[nextIndex], &codePoint))
+        if (!ToCodePoint(cx, args[nextIndex], &codePoint)) {
             return false;
+        }
 
         // Step 5.e.
         unicode::UTF16Encode(codePoint, elements, &length);
     }
 
     // Step 6.
     JSString* str = NewStringCopyN<CanGC>(cx, elements, length);
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     args.rval().setString(str);
     return true;
 }
 
 // ES2017 draft rev 40edb3a95a475c1b251141ac681b8793129d9a6d
 // 21.1.2.2 String.fromCodePoint(...codePoints)
 bool
 js::str_fromCodePoint(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // Optimize the single code-point case.
-    if (args.length() == 1)
+    if (args.length() == 1) {
         return str_fromCodePoint_one_arg(cx, args[0], args.rval());
+    }
 
     // Optimize the case where the result will definitely fit in an inline
     // string (thin or fat) and so we don't need to malloc the chars. (We could
     // cover some cases where |args.length()| goes up to
     // JSFatInlineString::MAX_LENGTH_LATIN1 / 2 if we also checked if the chars
     // are all Latin-1, but it doesn't seem worth the effort.)
-    if (args.length() <= JSFatInlineString::MAX_LENGTH_TWO_BYTE / 2)
+    if (args.length() <= JSFatInlineString::MAX_LENGTH_TWO_BYTE / 2) {
         return str_fromCodePoint_few_args(cx, args);
+    }
 
     // Steps 1-2 (omitted).
 
     // Step 3.
     static_assert(ARGS_LENGTH_MAX < std::numeric_limits<decltype(args.length())>::max() / 2,
                   "|args.length() * 2 + 1| does not overflow");
     auto elements = cx->make_pod_array<char16_t>(args.length() * 2 + 1);
-    if (!elements)
+    if (!elements) {
         return false;
+    }
 
     // Steps 4-5.
     unsigned length = 0;
     for (unsigned nextIndex = 0; nextIndex < args.length(); nextIndex++) {
         // Steps 5.a-d.
         uint32_t codePoint;
-        if (!ToCodePoint(cx, args[nextIndex], &codePoint))
+        if (!ToCodePoint(cx, args[nextIndex], &codePoint)) {
             return false;
+        }
 
         // Step 5.e.
         unicode::UTF16Encode(codePoint, elements.get(), &length);
     }
     elements[length] = 0;
 
     // Step 6.
     JSString* str = NewString<CanGC>(cx, std::move(elements), length);
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     args.rval().setString(str);
     return true;
 }
 
 static const JSFunctionSpec string_static_methods[] = {
     JS_INLINABLE_FN("fromCharCode", js::str_fromCharCode, 1, 0, StringFromCharCode),
     JS_INLINABLE_FN("fromCodePoint", js::str_fromCodePoint, 1, 0, StringFromCodePoint),
@@ -3628,30 +3874,34 @@ StringObject::assignInitialShape(JSConte
                                          JSPROP_PERMANENT | JSPROP_READONLY);
 }
 
 JSObject*
 js::InitStringClass(JSContext* cx, Handle<GlobalObject*> global)
 {
     Rooted<JSString*> empty(cx, cx->runtime()->emptyString);
     Rooted<StringObject*> proto(cx, GlobalObject::createBlankPrototype<StringObject>(cx, global));
-    if (!proto)
+    if (!proto) {
         return nullptr;
-    if (!StringObject::init(cx, proto, empty))
+    }
+    if (!StringObject::init(cx, proto, empty)) {
         return nullptr;
+    }
 
     /* Now create the String function. */
     RootedFunction ctor(cx);
     ctor = GlobalObject::createConstructor(cx, StringConstructor, cx->names().String, 1,
                                            gc::AllocKind::FUNCTION, &jit::JitInfo_String);
-    if (!ctor)
+    if (!ctor) {
         return nullptr;
-
-    if (!LinkConstructorAndPrototype(cx, ctor, proto))
+    }
+
+    if (!LinkConstructorAndPrototype(cx, ctor, proto)) {
         return nullptr;
+    }
 
     if (!DefinePropertiesAndFunctions(cx, proto, nullptr, string_methods) ||
         !DefinePropertiesAndFunctions(cx, ctor, nullptr, string_static_methods))
     {
         return nullptr;
     }
 
     // Create "trimLeft" as an alias for "trimStart".
@@ -3672,21 +3922,23 @@ js::InitStringClass(JSContext* cx, Handl
     {
         return nullptr;
     }
 
     /*
      * Define escape/unescape, the URI encode/decode functions, and maybe
      * uneval on the global object.
      */
-    if (!JS_DefineFunctions(cx, global, string_functions))
+    if (!JS_DefineFunctions(cx, global, string_functions)) {
         return nullptr;
-
-    if (!GlobalObject::initBuiltinConstructor(cx, global, JSProto_String, ctor, proto))
+    }
+
+    if (!GlobalObject::initBuiltinConstructor(cx, global, JSProto_String, ctor, proto)) {
         return nullptr;
+    }
 
     return proto;
 }
 
 #define ____ false
 
 /*
  * Uri reserved chars + #:
@@ -3753,18 +4005,19 @@ static const bool js_isUriUnescaped[] = 
 
 #undef ____
 
 static inline bool
 TransferBufferToString(StringBuffer& sb, JSString* str, MutableHandleValue rval)
 {
     if (!sb.empty()) {
         str = sb.finishString();
-        if (!str)
+        if (!str) {
             return false;
+        }
     }
     rval.setString(str);
     return true;
 }
 
 /*
  * ECMA 3, 15.1.3 URI Handling Function Properties
  *
@@ -3792,75 +4045,84 @@ Encode(StringBuffer& sb, const CharT* ch
         return sb.append(hexBuf, 3);
     };
 
     auto appendRange = [&sb, chars, length](size_t start, size_t end) {
         MOZ_ASSERT(start <= end);
 
         if (start < end) {
             if (start == 0) {
-                if (!sb.reserve(length))
+                if (!sb.reserve(length)) {
                     return false;
+                }
             }
             return sb.append(chars + start, chars + end);
         }
         return true;
     };
 
     size_t startAppend = 0;
     for (size_t k = 0; k < length; k++) {
         CharT c = chars[k];
         if (c < 128 && (js_isUriUnescaped[c] || (unescapedSet && unescapedSet[c]))) {
             continue;
         } else {
-            if (!appendRange(startAppend, k))
+            if (!appendRange(startAppend, k)) {
                 return Encode_Failure;
+            }
 
             if (mozilla::IsSame<CharT, Latin1Char>::value) {
                 if (c < 0x80) {
-                    if (!appendEncoded(c))
+                    if (!appendEncoded(c)) {
                         return Encode_Failure;
+                    }
                 } else {
-                    if (!appendEncoded(0xC0 | (c >> 6)) || !appendEncoded(0x80 | (c & 0x3F)))
+                    if (!appendEncoded(0xC0 | (c >> 6)) || !appendEncoded(0x80 | (c & 0x3F))) {
                         return Encode_Failure;
+                    }
                 }
             } else {
-                if (unicode::IsTrailSurrogate(c))
+                if (unicode::IsTrailSurrogate(c)) {
                     return Encode_BadUri;
+                }
 
                 uint32_t v;
                 if (!unicode::IsLeadSurrogate(c)) {
                     v = c;
                 } else {
                     k++;
-                    if (k == length)
+                    if (k == length) {
                         return Encode_BadUri;
+                    }
 
                     char16_t c2 = chars[k];
-                    if (!unicode::IsTrailSurrogate(c2))
+                    if (!unicode::IsTrailSurrogate(c2)) {
                         return Encode_BadUri;
+                    }
 
                     v = unicode::UTF16Decode(c, c2);
                 }
 
                 uint8_t utf8buf[4];
                 size_t L = OneUcs4ToUtf8Char(utf8buf, v);
                 for (size_t j = 0; j < L; j++) {
-                    if (!appendEncoded(utf8buf[j]))
+                    if (!appendEncoded(utf8buf[j])) {
                         return Encode_Failure;
+                    }
                 }
             }
 
             startAppend = k + 1;
         }
     }
 
     if (startAppend > 0) {
-        if (!appendRange(startAppend, length))
+        if (!appendRange(startAppend, length)) {
             return Encode_Failure;
+        }
     }
 
     return Encode_Success;
 }
 
 static MOZ_ALWAYS_INLINE bool
 Encode(JSContext* cx, HandleLinearString str, const bool* unescapedSet, MutableHandleValue rval)
 {
@@ -3876,18 +4138,19 @@ Encode(JSContext* cx, HandleLinearString
     if (str->hasLatin1Chars()) {
         AutoCheckCannotGC nogc;
         res = Encode(sb, str->latin1Chars(nogc), str->length(), unescapedSet);
     } else {
         AutoCheckCannotGC nogc;
         res = Encode(sb, str->twoByteChars(nogc), str->length(), unescapedSet);
     }
 
-    if (res == Encode_Failure)
+    if (res == Encode_Failure) {
         return false;
+    }
 
     if (res == Encode_BadUri) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_BAD_URI);
         return false;
     }
 
     MOZ_ASSERT(res == Encode_Success);
     return TransferBufferToString(sb, str, rval);
@@ -3897,98 +4160,116 @@ enum DecodeResult { Decode_Failure, Deco
 
 template <typename CharT>
 static DecodeResult
 Decode(StringBuffer& sb, const CharT* chars, size_t length, const bool* reservedSet)
 {
     auto appendRange = [&sb, chars](size_t start, size_t end) {
         MOZ_ASSERT(start <= end);
 
-        if (start < end)
+        if (start < end) {
             return sb.append(chars + start, chars + end);
+        }
         return true;
     };
 
     size_t startAppend = 0;
     for (size_t k = 0; k < length; k++) {
         CharT c = chars[k];
         if (c == '%') {
             size_t start = k;
-            if ((k + 2) >= length)
+            if ((k + 2) >= length) {
                 return Decode_BadUri;
-
-            if (!JS7_ISHEX(chars[k+1]) || !JS7_ISHEX(chars[k+2]))
+            }
+
+            if (!JS7_ISHEX(chars[k+1]) || !JS7_ISHEX(chars[k+2])) {
                 return Decode_BadUri;
+            }
 
             uint32_t B = JS7_UNHEX(chars[k+1]) * 16 + JS7_UNHEX(chars[k+2]);
             k += 2;
             if (B < 128) {
                 Latin1Char ch = Latin1Char(B);
-                if (reservedSet && reservedSet[ch])
+                if (reservedSet && reservedSet[ch]) {
                     continue;
-
-                if (!appendRange(startAppend, start))
+                }
+
+                if (!appendRange(startAppend, start)) {
                     return Decode_Failure;
-                if (!sb.append(ch))
+                }
+                if (!sb.append(ch)) {
                     return Decode_Failure;
+                }
             } else {
                 int n = 1;
-                while (B & (0x80 >> n))
+                while (B & (0x80 >> n)) {
                     n++;
-
-                if (n == 1 || n > 4)
+                }
+
+                if (n == 1 || n > 4) {
                     return Decode_BadUri;
+                }
 
                 uint8_t octets[4];
                 octets[0] = (uint8_t)B;
-                if (k + 3 * (n - 1) >= length)
+                if (k + 3 * (n - 1) >= length) {
                     return Decode_BadUri;
+                }
 
                 for (int j = 1; j < n; j++) {
                     k++;
-                    if (chars[k] != '%')
+                    if (chars[k] != '%') {
                         return Decode_BadUri;
-
-                    if (!JS7_ISHEX(chars[k+1]) || !JS7_ISHEX(chars[k+2]))
+                    }
+
+                    if (!JS7_ISHEX(chars[k+1]) || !JS7_ISHEX(chars[k+2])) {
                         return Decode_BadUri;
+                    }
 
                     B = JS7_UNHEX(chars[k+1]) * 16 + JS7_UNHEX(chars[k+2]);
-                    if ((B & 0xC0) != 0x80)
+                    if ((B & 0xC0) != 0x80) {
                         return Decode_BadUri;
+                    }
 
                     k += 2;
                     octets[j] = char(B);
                 }
 
-                if (!appendRange(startAppend, start))
+                if (!appendRange(startAppend, start)) {
                     return Decode_Failure;
+                }
 
                 uint32_t v = JS::Utf8ToOneUcs4Char(octets, n);
                 MOZ_ASSERT(v >= 128);
                 if (v >= unicode::NonBMPMin) {
-                    if (v > unicode::NonBMPMax)
+                    if (v > unicode::NonBMPMax) {
                         return Decode_BadUri;
-
-                    if (!sb.append(unicode::LeadSurrogate(v)))
+                    }
+
+                    if (!sb.append(unicode::LeadSurrogate(v))) {
                         return Decode_Failure;
-                    if (!sb.append(unicode::TrailSurrogate(v)))
+                    }
+                    if (!sb.append(unicode::TrailSurrogate(v))) {
                         return Decode_Failure;
+                    }
                 } else {
-                    if (!sb.append(char16_t(v)))
+                    if (!sb.append(char16_t(v))) {
                         return Decode_Failure;
+                    }
                 }
             }
 
             startAppend = k + 1;
         }
     }
 
     if (startAppend > 0) {
-        if (!appendRange(startAppend, length))
+        if (!appendRange(startAppend, length)) {
             return Decode_Failure;
+        }
     }
 
     return Decode_Success;
 }
 
 static bool
 Decode(JSContext* cx, HandleLinearString str, const bool* reservedSet, MutableHandleValue rval)
 {
@@ -4004,106 +4285,115 @@ Decode(JSContext* cx, HandleLinearString
     if (str->hasLatin1Chars()) {
         AutoCheckCannotGC nogc;
         res = Decode(sb, str->latin1Chars(nogc), str->length(), reservedSet);
     } else {
         AutoCheckCannotGC nogc;
         res = Decode(sb, str->twoByteChars(nogc), str->length(), reservedSet);
     }
 
-    if (res == Decode_Failure)
+    if (res == Decode_Failure) {
         return false;
+    }
 
     if (res == Decode_BadUri) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_BAD_URI);
         return false;
     }
 
     MOZ_ASSERT(res == Decode_Success);
     return TransferBufferToString(sb, str, rval);
 }
 
 static bool
 str_decodeURI(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     RootedLinearString str(cx, ArgToLinearString(cx, args, 0));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     return Decode(cx, str, js_isUriReservedPlusPound, args.rval());
 }
 
 static bool
 str_decodeURI_Component(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     RootedLinearString str(cx, ArgToLinearString(cx, args, 0));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     return Decode(cx, str, nullptr, args.rval());
 }
 
 static bool
 str_encodeURI(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     RootedLinearString str(cx, ArgToLinearString(cx, args, 0));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     return Encode(cx, str, js_isUriReservedPlusPound, args.rval());
 }
 
 static bool
 str_encodeURI_Component(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     RootedLinearString str(cx, ArgToLinearString(cx, args, 0));
-    if (!str)
+    if (!str) {
         return false;
+    }
 
     return Encode(cx, str, nullptr, args.rval());
 }
 
 JSString*
 js::EncodeURI(JSContext* cx, const char* chars, size_t length)
 {
     StringBuffer sb(cx);
     EncodeResult result = Encode(sb, reinterpret_cast<const Latin1Char*>(chars), length,
                                  js_isUriReservedPlusPound);
-    if (result == EncodeResult::Encode_Failure)
+    if (result == EncodeResult::Encode_Failure) {
         return nullptr;
+    }
     if (result == EncodeResult::Encode_BadUri) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_BAD_URI);
         return nullptr;
     }
-    if (sb.empty())
+    if (sb.empty()) {
         return NewStringCopyN<CanGC>(cx, chars, length);
+    }
     return sb.finishString();
 }
 
 static bool
 FlatStringMatchHelper(JSContext* cx, HandleString str, HandleString pattern, bool* isFlat, int32_t* match)
 {
     RootedLinearString linearPattern(cx, pattern->ensureLinear(cx));
-    if (!linearPattern)
+    if (!linearPattern) {
         return false;
+    }
 
     static const size_t MAX_FLAT_PAT_LEN = 256;
     if (linearPattern->length() > MAX_FLAT_PAT_LEN || StringHasRegExpMetaChars(linearPattern)) {
         *isFlat = false;
         return true;
     }
 
     *isFlat = true;
     if (str->isRope()) {
-        if (!RopeMatch(cx, &str->asRope(), linearPattern, match))
+        if (!RopeMatch(cx, &str->asRope(), linearPattern, match)) {
             return false;
+        }
     } else {
         *match = StringMatch(&str->asLinear(), linearPattern);
     }
 
     return true;
 }
 
 static bool
@@ -4112,85 +4402,92 @@ BuildFlatMatchArray(JSContext* cx, Handl
 {
     if (match < 0) {
         rval.setNull();
         return true;
     }
 
     /* Get the templateObject that defines the shape and type of the output object */
     JSObject* templateObject = cx->realm()->regExps.getOrCreateMatchResultTemplateObject(cx);
-    if (!templateObject)
+    if (!templateObject) {
         return false;
+    }
 
     RootedArrayObject arr(cx, NewDenseFullyAllocatedArrayWithTemplate(cx, 1, templateObject));
-    if (!arr)
+    if (!arr) {
         return false;
+    }
 
     /* Store a Value for each pair. */
     arr->setDenseInitializedLength(1);
     arr->initDenseElement(0, StringValue(pattern));
 
     /* Set the |index| property. (TemplateObject positions it in slot 0) */
     arr->setSlot(0, Int32Value(match));
 
     /* Set the |input| property. (TemplateObject positions it in slot 1) */
     arr->setSlot(1, StringValue(str));
 
 #ifdef DEBUG
     RootedValue test(cx);
     RootedId id(cx, NameToId(cx->names().index));
-    if (!NativeGetProperty(cx, arr, id, &test))
+    if (!NativeGetProperty(cx, arr, id, &test)) {
         return false;
+    }
     MOZ_ASSERT(test == arr->getSlot(0));
     id = NameToId(cx->names().input);
-    if (!NativeGetProperty(cx, arr, id, &test))
+    if (!NativeGetProperty(cx, arr, id, &test)) {
         return false;
+    }
     MOZ_ASSERT(test == arr->getSlot(1));
 #endif
 
     rval.setObject(*arr);
     return true;
 }
 
 #ifdef DEBUG
 static bool
 CallIsStringOptimizable(JSContext* cx, const char* name, bool* result)
 {
     FixedInvokeArgs<0> args(cx);
 
     RootedValue rval(cx);
-    if (!CallSelfHostedFunction(cx, name, UndefinedHandleValue, args, &rval))
+    if (!CallSelfHostedFunction(cx, name, UndefinedHandleValue, args, &rval)) {
         return false;
+    }
 
     *result = rval.toBoolean();
     return true;
 }
 #endif
 
 bool
 js::FlatStringMatch(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     MOZ_ASSERT(args.length() == 2);
     MOZ_ASSERT(args[0].isString());
     MOZ_ASSERT(args[1].isString());
 #ifdef DEBUG
     bool isOptimizable = false;
-    if (!CallIsStringOptimizable(cx, "IsStringMatchOptimizable", &isOptimizable))
+    if (!CallIsStringOptimizable(cx, "IsStringMatchOptimizable", &isOptimizable)) {
         return false;
+    }
     MOZ_ASSERT(isOptimizable);
 #endif
 
     RootedString str(cx, args[0].toString());
     RootedString pattern(cx, args[1].toString());
 
     bool isFlat = false;
     int32_t match = 0;
-    if (!FlatStringMatchHelper(cx, str, pattern, &isFlat, &match))
+    if (!FlatStringMatchHelper(cx, str, pattern, &isFlat, &match)) {
         return false;
+    }
 
     if (!isFlat) {
         args.rval().setUndefined();
         return true;
     }
 
     return BuildFlatMatchArray(cx, str, pattern, match, args.rval());
 }
@@ -4199,28 +4496,30 @@ bool
 js::FlatStringSearch(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     MOZ_ASSERT(args.length() == 2);
     MOZ_ASSERT(args[0].isString());
     MOZ_ASSERT(args[1].isString());
 #ifdef DEBUG
     bool isOptimizable = false;
-    if (!CallIsStringOptimizable(cx, "IsStringSearchOptimizable", &isOptimizable))
+    if (!CallIsStringOptimizable(cx, "IsStringSearchOptimizable", &isOptimizable)) {
         return false;
+    }
     MOZ_ASSERT(isOptimizable);
 #endif
 
     RootedString str(cx, args[0].toString());
     RootedString pattern(cx, args[1].toString());
 
     bool isFlat = false;
     int32_t match = 0;
-    if (!FlatStringMatchHelper(cx, str, pattern, &isFlat, &match))
+    if (!FlatStringMatchHelper(cx, str, pattern, &isFlat, &match)) {
         return false;
+    }
 
     if (!isFlat) {
         args.rval().setInt32(-2);
         return true;
     }
 
     args.rval().setInt32(match);
     return true;
--- a/js/src/builtin/Symbol.cpp
+++ b/js/src/builtin/Symbol.cpp
@@ -19,18 +19,19 @@ const Class SymbolObject::class_ = {
     "Symbol",
     JSCLASS_HAS_RESERVED_SLOTS(RESERVED_SLOTS) | JSCLASS_HAS_CACHED_PROTO(JSProto_Symbol)
 };
 
 SymbolObject*
 SymbolObject::create(JSContext* cx, JS::HandleSymbol symbol)
 {
     SymbolObject* obj = NewBuiltinClassInstance<SymbolObject>(cx);
-    if (!obj)
+    if (!obj) {
         return nullptr;
+    }
     obj->setPrimitiveValue(symbol);
     return obj;
 }
 
 const JSPropertySpec SymbolObject::properties[] = {
     JS_PSG("description", descriptionGetter, 0),
     JS_PS_END
 };
@@ -50,51 +51,56 @@ const JSFunctionSpec SymbolObject::stati
 
 JSObject*
 SymbolObject::initClass(JSContext* cx, Handle<GlobalObject*> global, bool defineMembers)
 {
     // This uses &JSObject::class_ because: "The Symbol prototype object is an
     // ordinary object. It is not a Symbol instance and does not have a
     // [[SymbolData]] internal slot." (ES6 rev 24, 19.4.3)
     RootedObject proto(cx, GlobalObject::createBlankPrototype<PlainObject>(cx, global));
-    if (!proto)
+    if (!proto) {
         return nullptr;
+    }
 
     RootedFunction ctor(cx, GlobalObject::createConstructor(cx, construct,
                                                             ClassName(JSProto_Symbol, cx), 0));
-    if (!ctor)
+    if (!ctor) {
         return nullptr;
+    }
 
     if (defineMembers) {
         // Define the well-known symbol properties, such as Symbol.iterator.
         ImmutablePropertyNamePtr* names = cx->names().wellKnownSymbolNames();
         RootedValue value(cx);
         unsigned attrs = JSPROP_READONLY | JSPROP_PERMANENT;
         WellKnownSymbols* wks = cx->runtime()->wellKnownSymbols;
         for (size_t i = 0; i < JS::WellKnownSymbolLimit; i++) {
             value.setSymbol(wks->get(i));
-            if (!NativeDefineDataProperty(cx, ctor, names[i], value, attrs))
+            if (!NativeDefineDataProperty(cx, ctor, names[i], value, attrs)) {
                 return nullptr;
+            }
         }
     }
 
-    if (!LinkConstructorAndPrototype(cx, ctor, proto))
+    if (!LinkConstructorAndPrototype(cx, ctor, proto)) {
         return nullptr;
+    }
 
     if (defineMembers) {
         if (!DefinePropertiesAndFunctions(cx, proto, properties, methods) ||
             !DefineToStringTag(cx, proto, cx->names().Symbol) ||
             !DefinePropertiesAndFunctions(cx, ctor, nullptr, staticMethods))
         {
             return nullptr;
         }
     }
 
-    if (!GlobalObject::initBuiltinConstructor(cx, global, JSProto_Symbol, ctor, proto))
+    if (!GlobalObject::initBuiltinConstructor(cx, global, JSProto_Symbol, ctor, proto)) {
         return nullptr;
+    }
     return proto;
 }
 
 // ES6 rev 24 (2014 Apr 27) 19.4.1.1 and 19.4.1.2
 bool
 SymbolObject::construct(JSContext* cx, unsigned argc, Value* vp)
 {
     // According to a note in the draft standard, "Symbol has ordinary
@@ -106,43 +112,47 @@ SymbolObject::construct(JSContext* cx, u
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_NOT_CONSTRUCTOR, "Symbol");
         return false;
     }
 
     // steps 1-3
     RootedString desc(cx);
     if (!args.get(0).isUndefined()) {
         desc = ToString(cx, args.get(0));
-        if (!desc)
+        if (!desc) {
             return false;
+        }
     }
 
     // step 4
     RootedSymbol symbol(cx, JS::Symbol::new_(cx, JS::SymbolCode::UniqueSymbol, desc));
-    if (!symbol)
+    if (!symbol) {
         return false;
+    }
     args.rval().setSymbol(symbol);
     return true;
 }
 
 // ES6 rev 24 (2014 Apr 27) 19.4.2.2
 bool
 SymbolObject::for_(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // steps 1-2
     RootedString stringKey(cx, ToString(cx, args.get(0)));
-    if (!stringKey)
+    if (!stringKey) {
         return false;
+    }
 
     // steps 3-7
     JS::Symbol* symbol = JS::Symbol::for_(cx, stringKey);
-    if (!symbol)
+    if (!symbol) {
         return false;
+    }
     args.rval().setSymbol(symbol);
     return true;
 }
 
 // ES6 rev 25 (2014 May 22) 19.4.2.7
 bool
 SymbolObject::keyFor(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -202,20 +212,21 @@ SymbolObject::toString(JSContext* cx, un
 
 //ES6 rev 24 (2014 Apr 27) 19.4.3.3
 bool
 SymbolObject::valueOf_impl(JSContext* cx, const CallArgs& args)
 {
     // Step 3, the error case, is handled by CallNonGenericMethod.
     HandleValue thisv = args.thisv();
     MOZ_ASSERT(IsSymbol(thisv));
-    if (thisv.isSymbol())
+    if (thisv.isSymbol()) {
         args.rval().set(thisv);
-    else
+    } else {
         args.rval().setSymbol(thisv.toObject().as<SymbolObject>().unbox());
+    }
     return true;
 }
 
 bool
 SymbolObject::valueOf(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsSymbol, valueOf_impl>(cx, args);
@@ -238,20 +249,21 @@ SymbolObject::descriptionGetter_impl(JSC
     // Get symbol object pointer.
     HandleValue thisv = args.thisv();
     MOZ_ASSERT(IsSymbol(thisv));
     Rooted<Symbol*> sym(cx, thisv.isSymbol()
                             ? thisv.toSymbol()
                             : thisv.toObject().as<SymbolObject>().unbox());
 
     // Return the symbol's description if present, otherwise return undefined.
-    if (JSString* str = sym->description())
+    if (JSString* str = sym->description()) {
         args.rval().setString(str);
-    else
+    } else {
         args.rval().setUndefined();
+    }
     return true;
 }
 
 bool
 SymbolObject::descriptionGetter(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     return CallNonGenericMethod<IsSymbol, descriptionGetter_impl>(cx, args);
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -109,238 +109,269 @@ EnvVarIsDefined(const char* name)
     const char* value = getenv(name);
     return value && *value;
 }
 
 #if defined(DEBUG) || defined(JS_OOM_BREAKPOINT)
 static bool
 EnvVarAsInt(const char* name, int* valueOut)
 {
-    if (!EnvVarIsDefined(name))
-        return false;
+    if (!EnvVarIsDefined(name)) {
+        return false;
+    }
 
     *valueOut = atoi(getenv(name));
     return true;
 }
 #endif
 
 static bool
 GetBuildConfiguration(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     RootedObject info(cx, JS_NewPlainObject(cx));
-    if (!info)
-        return false;
-
-    if (!JS_SetProperty(cx, info, "rooting-analysis", FalseHandleValue))
-        return false;
-
-    if (!JS_SetProperty(cx, info, "exact-rooting", TrueHandleValue))
-        return false;
-
-    if (!JS_SetProperty(cx, info, "trace-jscalls-api", FalseHandleValue))
-        return false;
-
-    if (!JS_SetProperty(cx, info, "incremental-gc", TrueHandleValue))
-        return false;
-
-    if (!JS_SetProperty(cx, info, "generational-gc", TrueHandleValue))
-        return false;
+    if (!info) {
+        return false;
+    }
+
+    if (!JS_SetProperty(cx, info, "rooting-analysis", FalseHandleValue)) {
+        return false;
+    }
+
+    if (!JS_SetProperty(cx, info, "exact-rooting", TrueHandleValue)) {
+        return false;
+    }
+
+    if (!JS_SetProperty(cx, info, "trace-jscalls-api", FalseHandleValue)) {
+        return false;
+    }
+
+    if (!JS_SetProperty(cx, info, "incremental-gc", TrueHandleValue)) {
+        return false;
+    }
+
+    if (!JS_SetProperty(cx, info, "generational-gc", TrueHandleValue)) {
+        return false;
+    }
 
     RootedValue value(cx);
 #ifdef DEBUG
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "debug", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "debug", value)) {
+        return false;
+    }
 
 #ifdef RELEASE_OR_BETA
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "release_or_beta", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "release_or_beta", value)) {
+        return false;
+    }
 
 #ifdef MOZ_CODE_COVERAGE
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "coverage", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "coverage", value)) {
+        return false;
+    }
 
 #ifdef JS_HAS_CTYPES
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "has-ctypes", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "has-ctypes", value)) {
+        return false;
+    }
 
 #if defined(_M_IX86) || defined(__i386__)
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "x86", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "x86", value)) {
+        return false;
+    }
 
 #if defined(_M_X64) || defined(__x86_64__)
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "x64", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "x64", value)) {
+        return false;
+    }
 
 #ifdef JS_SIMULATOR_ARM
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "arm-simulator", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "arm-simulator", value)) {
+        return false;
+    }
 
 #ifdef JS_SIMULATOR_ARM64
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "arm64-simulator", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "arm64-simulator", value)) {
+        return false;
+    }
 
 #ifdef JS_SIMULATOR_MIPS32
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "mips32-simulator", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "mips32-simulator", value)) {
+        return false;
+    }
 
 #ifdef JS_SIMULATOR_MIPS64
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "mips64-simulator", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "mips64-simulator", value)) {
+        return false;
+    }
 
 #ifdef MOZ_ASAN
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "asan", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "asan", value)) {
+        return false;
+    }
 
 #ifdef MOZ_TSAN
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "tsan", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "tsan", value)) {
+        return false;
+    }
 
 #ifdef JS_GC_ZEAL
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "has-gczeal", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "has-gczeal", value)) {
+        return false;
+    }
 
 #ifdef JS_MORE_DETERMINISTIC
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "more-deterministic", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "more-deterministic", value)) {
+        return false;
+    }
 
 #ifdef MOZ_PROFILING
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "profiling", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "profiling", value)) {
+        return false;
+    }
 
 #ifdef INCLUDE_MOZILLA_DTRACE
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "dtrace", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "dtrace", value)) {
+        return false;
+    }
 
 #ifdef MOZ_VALGRIND
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "valgrind", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "valgrind", value)) {
+        return false;
+    }
 
 #ifdef JS_OOM_DO_BACKTRACES
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "oom-backtraces", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "oom-backtraces", value)) {
+        return false;
+    }
 
 #ifdef ENABLE_BINARYDATA
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "binary-data", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "binary-data", value)) {
+        return false;
+    }
 
 #ifdef EXPOSE_INTL_API
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "intl-api", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "intl-api", value)) {
+        return false;
+    }
 
 #if defined(SOLARIS)
     value = BooleanValue(false);
 #else
     value = BooleanValue(true);
 #endif
-    if (!JS_SetProperty(cx, info, "mapped-array-buffer", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "mapped-array-buffer", value)) {
+        return false;
+    }
 
 #ifdef MOZ_MEMORY
     value = BooleanValue(true);
 #else
     value = BooleanValue(false);
 #endif
-    if (!JS_SetProperty(cx, info, "moz-memory", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "moz-memory", value)) {
+        return false;
+    }
 
     value.setInt32(sizeof(void*));
-    if (!JS_SetProperty(cx, info, "pointer-byte-size", value))
-        return false;
+    if (!JS_SetProperty(cx, info, "pointer-byte-size", value)) {
+        return false;
+    }
 
     args.rval().setObject(*info);
     return true;
 }
 
 static bool
 ReturnStringCopy(JSContext* cx, CallArgs& args, const char* message)
 {
     JSString* str = JS_NewStringCopyZ(cx, message);
-    if (!str)
-        return false;
+    if (!str) {
+        return false;
+    }
 
     args.rval().setString(str);
     return true;
 }
 
 static bool
 GC(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -351,59 +382,63 @@ GC(JSContext* cx, unsigned argc, Value* 
      * scheduled for GC via schedulegc. If the first argument is an object, we
      * collect the object's zone (and any other zones scheduled for
      * GC). Otherwise, we collect all zones.
      */
     bool zone = false;
     if (args.length() >= 1) {
         Value arg = args[0];
         if (arg.isString()) {
-            if (!JS_StringEqualsAscii(cx, arg.toString(), "zone", &zone))
+            if (!JS_StringEqualsAscii(cx, arg.toString(), "zone", &zone)) {
                 return false;
+            }
         } else if (arg.isObject()) {
             PrepareZoneForGC(UncheckedUnwrap(&arg.toObject())->zone());
             zone = true;
         }
     }
 
     bool shrinking = false;
     if (args.length() >= 2) {
         Value arg = args[1];
         if (arg.isString()) {
-            if (!JS_StringEqualsAscii(cx, arg.toString(), "shrinking", &shrinking))
+            if (!JS_StringEqualsAscii(cx, arg.toString(), "shrinking", &shrinking)) {
                 return false;
+            }
         }
     }
 
 #ifndef JS_MORE_DETERMINISTIC
     size_t preBytes = cx->runtime()->gc.usage.gcBytes();
 #endif
 
-    if (zone)
+    if (zone) {
         PrepareForDebugGC(cx->runtime());
-    else
+    } else {
         JS::PrepareForFullGC(cx);
+    }
 
     JSGCInvocationKind gckind = shrinking ? GC_SHRINK : GC_NORMAL;
     JS::NonIncrementalGC(cx, gckind, JS::gcreason::API);
 
     char buf[256] = { '\0' };
 #ifndef JS_MORE_DETERMINISTIC
     SprintfLiteral(buf, "before %zu, after %zu\n",
                    preBytes, cx->runtime()->gc.usage.gcBytes());
 #endif
     return ReturnStringCopy(cx, args, buf);
 }
 
 static bool
 MinorGC(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    if (args.get(0) == BooleanValue(true))
+    if (args.get(0) == BooleanValue(true)) {
         cx->runtime()->gc.storeBuffer().setAboutToOverflow(JS::gcreason::FULL_GENERIC_BUFFER);
+    }
 
     cx->minorGC(JS::gcreason::API);
     args.rval().setUndefined();
     return true;
 }
 
 #define FOR_EACH_GC_PARAM(_)                                                    \
     _("maxBytes",                   JSGC_MAX_BYTES,                      true)  \
@@ -445,32 +480,35 @@ FOR_EACH_GC_PARAM(DEFINE_PARAM_INFO)
 #define GC_PARAMETER_ARGS_LIST FOR_EACH_GC_PARAM(PARAM_NAME_LIST_ENTRY)
 
 static bool
 GCParameter(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     JSString* str = ToString(cx, args.get(0));
-    if (!str)
-        return false;
+    if (!str) {
+        return false;
+    }
 
     JSFlatString* flatStr = JS_FlattenString(cx, str);
-    if (!flatStr)
-        return false;
+    if (!flatStr) {
+        return false;
+    }
 
     size_t paramIndex = 0;
     for (;; paramIndex++) {
         if (paramIndex == ArrayLength(paramMap)) {
             JS_ReportErrorASCII(cx,
                                 "the first argument must be one of:" GC_PARAMETER_ARGS_LIST);
             return false;
         }
-        if (JS_FlatStringEqualsAscii(flatStr, paramMap[paramIndex].name))
+        if (JS_FlatStringEqualsAscii(flatStr, paramMap[paramIndex].name)) {
             break;
+        }
     }
     const ParamInfo& info = paramMap[paramIndex];
     JSGCParamKey param = info.param;
 
     // Request mode.
     if (args.length() == 1) {
         uint32_t value = JS_GetGCParameter(cx, param);
         args.rval().setNumber(value);
@@ -490,18 +528,19 @@ GCParameter(JSContext* cx, unsigned argc
             args.rval().setUndefined();
             return true;
           default:
             break;
         }
     }
 
     double d;
-    if (!ToNumber(cx, args[1], &d))
-        return false;
+    if (!ToNumber(cx, args[1], &d)) {
+        return false;
+    }
 
     if (d < 0 || d > UINT32_MAX) {
         JS_ReportErrorASCII(cx, "Parameter value out of range");
         return false;
     }
 
     uint32_t value = floor(d);
     if (param == JSGC_MARK_STACK_LIMIT && JS::IsIncrementalGCInProgress(cx)) {
@@ -527,18 +566,19 @@ GCParameter(JSContext* cx, unsigned argc
 
 static void
 SetAllowRelazification(JSContext* cx, bool allow)
 {
     JSRuntime* rt = cx->runtime();
     MOZ_ASSERT(rt->allowRelazificationForTesting != allow);
     rt->allowRelazificationForTesting = allow;
 
-    for (AllScriptFramesIter i(cx); !i.done(); ++i)
+    for (AllScriptFramesIter i(cx); !i.done(); ++i) {
         i.script()->setDoNotRelazify(allow);
+    }
 }
 
 static bool
 RelazifyFunctions(JSContext* cx, unsigned argc, Value* vp)
 {
     // Relazifying functions on GC is usually only done for compartments that are
     // not active. To aid fuzzing, this testing function allows us to relazify
     // even if the compartment is active.
@@ -660,49 +700,53 @@ WasmGcEnabled(JSContext* cx, unsigned ar
 
 static bool
 WasmCompileMode(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // We default to ion if nothing is enabled, as does the Wasm compiler.
     JSString* result;
-    if (!wasm::HasSupport(cx))
+    if (!wasm::HasSupport(cx)) {
         result = JS_NewStringCopyZ(cx, "disabled");
-    else if (cx->options().wasmBaseline() && cx->options().wasmIon())
+    } else if (cx->options().wasmBaseline() && cx->options().wasmIon()) {
         result = JS_NewStringCopyZ(cx, "baseline-or-ion");
-    else if (cx->options().wasmBaseline())
+    } else if (cx->options().wasmBaseline()) {
         result = JS_NewStringCopyZ(cx, "baseline");
-    else
+    } else {
         result = JS_NewStringCopyZ(cx, "ion");
-
-    if (!result)
-        return false;
+    }
+
+    if (!result) {
+        return false;
+    }
 
     args.rval().setString(result);
     return true;
 }
 
 static bool
 WasmTextToBinary(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     RootedObject callee(cx, &args.callee());
 
-    if (!args.requireAtLeast(cx, "wasmTextToBinary", 1))
-        return false;
+    if (!args.requireAtLeast(cx, "wasmTextToBinary", 1)) {
+        return false;
+    }
 
     if (!args[0].isString()) {
         ReportUsageErrorASCII(cx, callee, "First argument must be a String");
         return false;
     }
 
     AutoStableStringChars twoByteChars(cx);
-    if (!twoByteChars.initTwoByte(cx, args[0].toString()))
-        return false;
+    if (!twoByteChars.initTwoByte(cx, args[0].toString())) {
+        return false;
+    }
 
     bool withOffsets = false;
     if (args.hasDefined(1)) {
         if (!args[1].isBoolean()) {
             ReportUsageErrorASCII(cx, callee, "Second argument, if present, must be a boolean");
             return false;
         }
         withOffsets = ToBoolean(args[1]);
@@ -715,45 +759,51 @@ WasmTextToBinary(JSContext* cx, unsigned
     wasm::Uint32Vector offsets;
     if (!wasm::TextToBinary(twoByteChars.twoByteChars(), stackLimit, &bytes, &offsets, &error)) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_WASM_TEXT_FAIL,
                                   error.get() ? error.get() : "out of memory");
         return false;
     }
 
     RootedObject binary(cx, JS_NewUint8Array(cx, bytes.length()));
-    if (!binary)
-        return false;
+    if (!binary) {
+        return false;
+    }
 
     memcpy(binary->as<TypedArrayObject>().viewDataUnshared(), bytes.begin(), bytes.length());
 
     if (!withOffsets) {
         args.rval().setObject(*binary);
         return true;
     }
 
     RootedObject obj(cx, JS_NewPlainObject(cx));
-    if (!obj)
-        return false;
+    if (!obj) {
+        return false;
+    }
 
     constexpr unsigned propAttrs = JSPROP_ENUMERATE;
-    if (!JS_DefineProperty(cx, obj, "binary", binary, propAttrs))
-        return false;
+    if (!JS_DefineProperty(cx, obj, "binary", binary, propAttrs)) {
+        return false;
+    }
 
     RootedObject jsOffsets(cx, JS_NewArrayObject(cx, offsets.length()));
-    if (!jsOffsets)
-        return false;
+    if (!jsOffsets) {
+        return false;
+    }
     for (size_t i = 0; i < offsets.length(); i++) {
         uint32_t offset = offsets[i];
         RootedValue offsetVal(cx, NumberValue(offset));
-        if (!JS_SetElement(cx, jsOffsets, i, offsetVal))
+        if (!JS_SetElement(cx, jsOffsets, i, offsetVal)) {
             return false;
-    }
-    if (!JS_DefineProperty(cx, obj, "offsets", jsOffsets, propAttrs))
-        return false;
+        }
+    }
+    if (!JS_DefineProperty(cx, obj, "offsets", jsOffsets, propAttrs)) {
+        return false;
+    }
 
     args.rval().setObject(*obj);
     return true;
 }
 
 static bool
 WasmExtractCode(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -778,18 +828,19 @@ WasmExtractCode(JSContext* cx, unsigned 
     Rooted<WasmModuleObject*> module(cx, &unwrapped->as<WasmModuleObject>());
 
     bool stableTier = false;
     bool bestTier = false;
     bool baselineTier = false;
     bool ionTier = false;
     if (args.length() > 1) {
         JSString* opt = JS::ToString(cx, args[1]);
-        if (!opt)
+        if (!opt) {
             return false;
+        }
         if (!JS_StringEqualsAscii(cx, opt, "stable", &stableTier) ||
             !JS_StringEqualsAscii(cx, opt, "best", &bestTier) ||
             !JS_StringEqualsAscii(cx, opt, "baseline", &baselineTier) ||
             !JS_StringEqualsAscii(cx, opt, "ion", &ionTier))
         {
             return false;
         }
         // You can omit the argument but you can't pass just anything you like
@@ -797,28 +848,30 @@ WasmExtractCode(JSContext* cx, unsigned 
             args.rval().setNull();
             return true;
         }
     } else {
         stableTier = true;
     }
 
     wasm::Tier tier;
-    if (stableTier)
+    if (stableTier) {
         tier = module->module().code().stableTier();
-    else if (bestTier)
+    } else if (bestTier) {
         tier = module->module().code().bestTier();
-    else if (baselineTier)
+    } else if (baselineTier) {
         tier = wasm::Tier::Baseline;
-    else
+    } else {
         tier = wasm::Tier::Ion;
+    }
 
     RootedValue result(cx);
-    if (!module->module().extractCode(cx, tier, &result))
-        return false;
+    if (!module->module().extractCode(cx, tier, &result)) {
+        return false;
+    }
 
     args.rval().set(result);
     return true;
 }
 
 static bool
 WasmHasTier2CompilationCompleted(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -881,21 +934,23 @@ InternalConst(JSContext* cx, unsigned ar
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     if (args.length() == 0) {
         JS_ReportErrorASCII(cx, "the function takes exactly one argument");
         return false;
     }
 
     JSString* str = ToString(cx, args[0]);
-    if (!str)
-        return false;
+    if (!str) {
+        return false;
+    }
     JSFlatString* flat = JS_FlattenString(cx, str);
-    if (!flat)
-        return false;
+    if (!flat) {
+        return false;
+    }
 
     if (JS_FlatStringEqualsAscii(flat, "INCREMENTAL_MARK_STACK_BASE_CAPACITY")) {
         args.rval().setNumber(uint32_t(js::INCREMENTAL_MARK_STACK_BASE_CAPACITY));
     } else {
         JS_ReportErrorASCII(cx, "unknown const name");
         return false;
     }
     return true;
@@ -927,28 +982,30 @@ GCZeal(JSContext* cx, unsigned argc, Val
 
     if (args.length() > 2) {
         RootedObject callee(cx, &args.callee());
         ReportUsageErrorASCII(cx, callee, "Too many arguments");
         return false;
     }
 
     uint32_t zeal;
-    if (!ToUint32(cx, args.get(0), &zeal))
-        return false;
+    if (!ToUint32(cx, args.get(0), &zeal)) {
+        return false;
+    }
 
     if (zeal > uint32_t(gc::ZealMode::Limit)) {
         JS_ReportErrorASCII(cx, "gczeal argument out of range");
         return false;
     }
 
     uint32_t frequency = JS_DEFAULT_ZEAL_FREQ;
     if (args.length() >= 2) {
-        if (!ToUint32(cx, args.get(1), &frequency))
+        if (!ToUint32(cx, args.get(1), &frequency)) {
             return false;
+        }
     }
 
     JS_SetGCZeal(cx, (uint8_t)zeal, frequency);
     args.rval().setUndefined();
     return true;
 }
 
 static bool
@@ -1008,18 +1065,19 @@ SelectForGC(JSContext* cx, unsigned argc
      * The selectedForMarking set is intended to be manually marked at slice
      * start to detect missing pre-barriers. It is invalid for nursery things
      * to be in the set, so evict the nursery before adding items.
      */
     cx->runtime()->gc.evictNursery();
 
     for (unsigned i = 0; i < args.length(); i++) {
         if (args[i].isObject()) {
-            if (!cx->runtime()->gc.selectForMarking(&args[i].toObject()))
+            if (!cx->runtime()->gc.selectForMarking(&args[i].toObject())) {
                 return false;
+            }
         }
     }
 
     args.rval().setUndefined();
     return true;
 }
 
 static bool
@@ -1103,27 +1161,29 @@ StartGC(JSContext* cx, unsigned argc, Va
         RootedObject callee(cx, &args.callee());
         ReportUsageErrorASCII(cx, callee, "Wrong number of arguments");
         return false;
     }
 
     auto budget = SliceBudget::unlimited();
     if (args.length() >= 1) {
         uint32_t work = 0;
-        if (!ToUint32(cx, args[0], &work))
+        if (!ToUint32(cx, args[0], &work)) {
             return false;
+        }
         budget = SliceBudget(WorkBudget(work));
     }
 
     bool shrinking = false;
     if (args.length() >= 2) {
         Value arg = args[1];
         if (arg.isString()) {
-            if (!JS_StringEqualsAscii(cx, arg.toString(), "shrinking", &shrinking))
+            if (!JS_StringEqualsAscii(cx, arg.toString(), "shrinking", &shrinking)) {
                 return false;
+            }
         }
     }
 
     JSRuntime* rt = cx->runtime();
     if (rt->gc.isIncrementalGCInProgress()) {
         RootedObject callee(cx, &args.callee());
         JS_ReportErrorASCII(cx, "Incremental GC already in progress");
         return false;
@@ -1145,26 +1205,28 @@ GCSlice(JSContext* cx, unsigned argc, Va
         RootedObject callee(cx, &args.callee());
         ReportUsageErrorASCII(cx, callee, "Wrong number of arguments");
         return false;
     }
 
     auto budget = SliceBudget::unlimited();
     if (args.length() == 1) {
         uint32_t work = 0;
-        if (!ToUint32(cx, args[0], &work))
+        if (!ToUint32(cx, args[0], &work)) {
             return false;
+        }
         budget = SliceBudget(WorkBudget(work));
     }
 
     JSRuntime* rt = cx->runtime();
-    if (!rt->gc.isIncrementalGCInProgress())
+    if (!rt->gc.isIncrementalGCInProgress()) {
         rt->gc.startDebugGC(GC_NORMAL, budget);
-    else
+    } else {
         rt->gc.debugGCSlice(budget);
+    }
 
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 AbortGC(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -1210,36 +1272,38 @@ NondeterministicGetWeakMapKeys(JSContext
     if (!args[0].isObject()) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_NOT_EXPECTED_TYPE,
                                   "nondeterministicGetWeakMapKeys", "WeakMap",
                                   InformalValueTypeName(args[0]));
         return false;
     }
     RootedObject arr(cx);
     RootedObject mapObj(cx, &args[0].toObject());
-    if (!JS_NondeterministicGetWeakMapKeys(cx, mapObj, &arr))
-        return false;
+    if (!JS_NondeterministicGetWeakMapKeys(cx, mapObj, &arr)) {
+        return false;
+    }
     if (!arr) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_NOT_EXPECTED_TYPE,
                                   "nondeterministicGetWeakMapKeys", "WeakMap",
                                   args[0].toObject().getClass()->name);
         return false;
     }
     args.rval().setObject(*arr);
     return true;
 }
 
 class HasChildTracer : public JS::CallbackTracer
 {
     RootedValue child_;
     bool found_;
 
     void onChild(const JS::GCCellPtr& thing) override {
-        if (thing.asCell() == child_.toGCThing())
+        if (thing.asCell() == child_.toGCThing()) {
             found_ = true;
+        }
     }
 
   public:
     HasChildTracer(JSContext* cx, HandleValue child)
       : JS::CallbackTracer(cx, TraceWeakMapKeysValues), child_(cx, child), found_(false)
     {}
 
     bool found() const { return found_; }
@@ -1262,22 +1326,24 @@ HasChild(JSContext* cx, unsigned argc, V
     args.rval().setBoolean(trc.found());
     return true;
 }
 
 static bool
 SetSavedStacksRNGState(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    if (!args.requireAtLeast(cx, "setSavedStacksRNGState", 1))
-        return false;
+    if (!args.requireAtLeast(cx, "setSavedStacksRNGState", 1)) {
+        return false;
+    }
 
     int32_t seed;
-    if (!ToInt32(cx, args[0], &seed))
-        return false;
+    if (!ToInt32(cx, args[0], &seed)) {
+        return false;
+    }
 
     // Either one or the other of the seed arguments must be non-zero;
     // make this true no matter what value 'seed' has.
     cx->realm()->savedStacks().setRNGState(seed, (seed + 1) * 33);
     return true;
 }
 
 static bool
@@ -1291,97 +1357,107 @@ GetSavedFrameCount(JSContext* cx, unsign
 static bool
 ClearSavedFrames(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     js::SavedStacks& savedStacks = cx->realm()->savedStacks();
     savedStacks.clear();
 
-    for (ActivationIterator iter(cx); !iter.done(); ++iter)
+    for (ActivationIterator iter(cx); !iter.done(); ++iter) {
         iter->clearLiveSavedFrameCache();
+    }
 
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 SaveStack(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     JS::StackCapture capture((JS::AllFrames()));
     if (args.length() >= 1) {
         double maxDouble;
-        if (!ToNumber(cx, args[0], &maxDouble))
+        if (!ToNumber(cx, args[0], &maxDouble)) {
             return false;
+        }
         if (mozilla::IsNaN(maxDouble) || maxDouble < 0 || maxDouble > UINT32_MAX) {
             ReportValueError(cx, JSMSG_UNEXPECTED_TYPE, JSDVG_SEARCH_STACK, args[0], nullptr,
                              "not a valid maximum frame count");
             return false;
         }
         uint32_t max = uint32_t(maxDouble);
-        if (max > 0)
+        if (max > 0) {
             capture = JS::StackCapture(JS::MaxFrames(max));
+        }
     }
 
     RootedObject compartmentObject(cx);
     if (args.length() >= 2) {
         if (!args[1].isObject()) {
             ReportValueError(cx, JSMSG_UNEXPECTED_TYPE, JSDVG_SEARCH_STACK, args[0], nullptr,
                              "not an object");
             return false;
         }
         compartmentObject = UncheckedUnwrap(&args[1].toObject());
-        if (!compartmentObject)
+        if (!compartmentObject) {
             return false;
+        }
     }
 
     RootedObject stack(cx);
     {
         Maybe<AutoRealm> ar;
-        if (compartmentObject)
+        if (compartmentObject) {
             ar.emplace(cx, compartmentObject);
-        if (!JS::CaptureCurrentStack(cx, &stack, std::move(capture)))
+        }
+        if (!JS::CaptureCurrentStack(cx, &stack, std::move(capture))) {
             return false;
-    }
-
-    if (stack && !cx->compartment()->wrap(cx, &stack))
-        return false;
+        }
+    }
+
+    if (stack && !cx->compartment()->wrap(cx, &stack)) {
+        return false;
+    }
 
     args.rval().setObjectOrNull(stack);
     return true;
 }
 
 static bool
 CaptureFirstSubsumedFrame(JSContext* cx, unsigned argc, JS::Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    if (!args.requireAtLeast(cx, "captureFirstSubsumedFrame", 1))
-        return false;
+    if (!args.requireAtLeast(cx, "captureFirstSubsumedFrame", 1)) {
+        return false;
+    }
 
     if (!args[0].isObject()) {
         JS_ReportErrorASCII(cx, "The argument must be an object");
         return false;
     }
 
     RootedObject obj(cx, &args[0].toObject());
     obj = CheckedUnwrap(obj);
     if (!obj) {
         JS_ReportErrorASCII(cx, "Denied permission to object.");
         return false;
     }
 
     JS::StackCapture capture(JS::FirstSubsumedFrame(cx, obj->nonCCWRealm()->principals()));
-    if (args.length() > 1)
+    if (args.length() > 1) {
         capture.as<JS::FirstSubsumedFrame>().ignoreSelfHosted = JS::ToBoolean(args[1]);
+    }
 
     JS::RootedObject capturedStack(cx);
-    if (!JS::CaptureCurrentStack(cx, &capturedStack, std::move(capture)))
-        return false;
+    if (!JS::CaptureCurrentStack(cx, &capturedStack, std::move(capture))) {
+        return false;
+    }
 
     args.rval().setObjectOrNull(capturedStack);
     return true;
 }
 
 static bool
 CallFunctionFromNativeFrame(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -1474,25 +1550,28 @@ NewExternalString(JSContext* cx, unsigne
         JS_ReportErrorASCII(cx, "newExternalString takes exactly one string argument.");
         return false;
     }
 
     RootedString str(cx, args[0].toString());
     size_t len = str->length();
 
     auto buf = cx->make_pod_array<char16_t>(len);
-    if (!buf)
-        return false;
-
-    if (!JS_CopyStringChars(cx, mozilla::Range<char16_t>(buf.get(), len), str))
-        return false;
+    if (!buf) {
+        return false;
+    }
+
+    if (!JS_CopyStringChars(cx, mozilla::Range<char16_t>(buf.get(), len), str)) {
+        return false;
+    }
 
     JSString* res = JS_NewExternalString(cx, buf.get(), len, &ExternalStringFinalizer);
-    if (!res)
-        return false;
+    if (!res) {
+        return false;
+    }
 
     mozilla::Unused << buf.release();
     args.rval().setString(res);
     return true;
 }
 
 static bool
 NewMaybeExternalString(JSContext* cx, unsigned argc, Value* vp)
@@ -1503,30 +1582,34 @@ NewMaybeExternalString(JSContext* cx, un
         JS_ReportErrorASCII(cx, "newMaybeExternalString takes exactly one string argument.");
         return false;
     }
 
     RootedString str(cx, args[0].toString());
     size_t len = str->length();
 
     auto buf = cx->make_pod_array<char16_t>(len);
-    if (!buf)
-        return false;
-
-    if (!JS_CopyStringChars(cx, mozilla::Range<char16_t>(buf.get(), len), str))
-        return false;
+    if (!buf) {
+        return false;
+    }
+
+    if (!JS_CopyStringChars(cx, mozilla::Range<char16_t>(buf.get(), len), str)) {
+        return false;
+    }
 
     bool allocatedExternal;
     JSString* res = JS_NewMaybeExternalString(cx, buf.get(), len, &ExternalStringFinalizer,
                                               &allocatedExternal);
-    if (!res)
-        return false;
-
-    if (allocatedExternal)
+    if (!res) {
+        return false;
+    }
+
+    if (allocatedExternal) {
         mozilla::Unused << buf.release();
+    }
     args.rval().setString(res);
     return true;
 }
 
 // Warning! This will let you create ropes that I'm not sure would be possible
 // otherwise, specifically:
 //
 //   - a rope with a zero-length child
@@ -1541,67 +1624,73 @@ NewRope(JSContext* cx, unsigned argc, Va
         JS_ReportErrorASCII(cx, "newRope requires two string arguments.");
         return false;
     }
 
     gc::InitialHeap heap = js::gc::DefaultHeap;
     if (args.get(2).isObject()) {
         RootedObject options(cx, &args[2].toObject());
         RootedValue v(cx);
-        if (!JS_GetProperty(cx, options, "nursery", &v))
+        if (!JS_GetProperty(cx, options, "nursery", &v)) {
             return false;
-        if (!v.isUndefined() && !ToBoolean(v))
+        }
+        if (!v.isUndefined() && !ToBoolean(v)) {
             heap = js::gc::TenuredHeap;
+        }
     }
 
     JSString* left = args[0].toString();
     JSString* right = args[1].toString();
     size_t length = JS_GetStringLength(left) + JS_GetStringLength(right);
     if (length > JSString::MAX_LENGTH) {
         JS_ReportErrorASCII(cx, "rope length exceeds maximum string length");
         return false;
     }
 
     Rooted<JSRope*> str(cx, JSRope::new_<NoGC>(cx, left, right, length, heap));
-    if (!str)
-        return false;
+    if (!str) {
+        return false;
+    }
 
     args.rval().setString(str);
     return true;
 }
 
 static bool
 EnsureFlatString(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     if (args.length() != 1 || !args[0].isString()) {
         JS_ReportErrorASCII(cx, "ensureFlatString takes exactly one string argument.");
         return false;
     }
 
     JSFlatString* flat = args[0].toString()->ensureFlat(cx);
-    if (!flat)
-        return false;
+    if (!flat) {
+        return false;
+    }
 
     args.rval().setString(flat);
     return true;
 }
 
 static bool
 RepresentativeStringArray(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     RootedObject array(cx, JS_NewArrayObject(cx, 0));
-    if (!array)
-        return false;
-
-    if (!JSString::fillWithRepresentatives(cx, array.as<ArrayObject>()))
-        return false;
+    if (!array) {
+        return false;
+    }
+
+    if (!JSString::fillWithRepresentatives(cx, array.as<ArrayObject>())) {
+        return false;
+    }
 
     args.rval().setObject(*array);
     return true;
 }
 
 #if defined(DEBUG) || defined(JS_OOM_BREAKPOINT)
 
 static bool
@@ -1639,35 +1728,38 @@ SetupOOMFailure(JSContext* cx, bool fail
     }
 
     if (args.length() > 2) {
         JS_ReportErrorASCII(cx, "Too many arguments");
         return false;
     }
 
     int32_t count;
-    if (!JS::ToInt32(cx, args.get(0), &count))
-        return false;
+    if (!JS::ToInt32(cx, args.get(0), &count)) {
+        return false;
+    }
 
     if (count <= 0) {
         JS_ReportErrorASCII(cx, "OOM cutoff should be positive");
         return false;
     }
 
     uint32_t targetThread = js::THREAD_TYPE_MAIN;
-    if (args.length() > 1 && !ToUint32(cx, args[1], &targetThread))
-        return false;
+    if (args.length() > 1 && !ToUint32(cx, args[1], &targetThread)) {
+        return false;
+    }
 
     if (targetThread == js::THREAD_TYPE_NONE || targetThread >= js::THREAD_TYPE_MAX) {
         JS_ReportErrorASCII(cx, "Invalid thread type specified");
         return false;
     }
 
-    if (!CheckCanSimulateOOM(cx))
-        return false;
+    if (!CheckCanSimulateOOM(cx)) {
+        return false;
+    }
 
     js::oom::SimulateOOMAfter(count, targetThread, failAlways);
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 OOMAfterAllocations(JSContext* cx, unsigned argc, Value* vp)
@@ -1681,30 +1773,32 @@ OOMAtAllocation(JSContext* cx, unsigned 
     return SetupOOMFailure(cx, false, argc, vp);
 }
 
 static bool
 ResetOOMFailure(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
-    if (!CheckCanSimulateOOM(cx))
-        return false;
+    if (!CheckCanSimulateOOM(cx)) {
+        return false;
+    }
 
     args.rval().setBoolean(js::oom::HadSimulatedOOM());
     js::oom::ResetSimulatedOOM();
     return true;
 }
 
 static size_t
 CountCompartments(JSContext* cx)
 {
     size_t count = 0;
-    for (auto zone : cx->runtime()->gc.zones())
+    for (auto zone : cx->runtime()->gc.zones()) {
         count += zone->compartments().length();
+    }
     return count;
 }
 
 // Iterative failure testing: test a function by simulating failures at indexed
 // locations throughout the normal execution path and checking that the
 // resulting state of the environment is consistent with the error result.
 //
 // For example, trigger OOM at every allocation point and test that the function
@@ -1731,18 +1825,19 @@ struct IterativeFailureSimulator
     virtual bool stopSimulating() = 0;
     virtual void cleanup(JSContext* cx) {}
 };
 
 bool
 RunIterativeFailureTest(JSContext* cx, const IterativeFailureTestParams& params,
                         IterativeFailureSimulator& simulator)
 {
-    if (disableOOMFunctions)
+    if (disableOOMFunctions) {
         return true;
+    }
 
     // Disallow nested tests.
     if (cx->runningOOMTest) {
         JS_ReportErrorASCII(cx, "Nested call to iterative failure test is not allowed.");
         return false;
     }
     cx->runningOOMTest = true;
 
@@ -1752,24 +1847,26 @@ RunIterativeFailureTest(JSContext* cx, c
     JS_SetGCZeal(cx, 0, JS_DEFAULT_ZEAL_FREQ);
 #endif
 
     size_t compartmentCount = CountCompartments(cx);
 
     simulator.setup(cx);
 
     for (unsigned thread = params.threadStart; thread < params.threadEnd; thread++) {
-        if (params.verbose)
+        if (params.verbose) {
             fprintf(stderr, "thread %d\n", thread);
+        }
 
         unsigned iteration = 1;
         bool failureWasSimulated;
         do {
-            if (params.verbose)
+            if (params.verbose) {
                 fprintf(stderr, "  iteration %d\n", iteration);
+            }
 
             MOZ_ASSERT(!cx->isExceptionPending());
 
             simulator.startSimulating(cx, iteration, thread);
 
             RootedValue result(cx);
             bool ok = JS_CallFunction(cx, cx->global(), params.testFunction,
                                       HandleValueArray::empty(), &result);
@@ -1805,27 +1902,29 @@ RunIterativeFailureTest(JSContext* cx, c
                 JS_GC(cx);
                 compartmentCount = CountCompartments(cx);
             }
 
 #ifdef JS_TRACE_LOGGING
             // Reset the TraceLogger state if enabled.
             TraceLoggerThread* logger = TraceLoggerForCurrentThread(cx);
             if (logger->enabled()) {
-                while (logger->enabled())
+                while (logger->enabled()) {
                     logger->disable();
+                }
                 logger->enable(cx);
             }
 #endif
 
             iteration++;
         } while (failureWasSimulated);
 
-        if (params.verbose)
+        if (params.verbose) {
             fprintf(stderr, "  finished after %d iterations\n", iteration - 2);
+        }
     }
 
     simulator.teardown(cx);
 
     cx->runningOOMTest = false;
     return true;
 }
 
@@ -1901,22 +2000,24 @@ struct OOMSimulator : public IterativeFa
 };
 
 static bool
 OOMTest(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     IterativeFailureTestParams params(cx);
-    if (!ParseIterativeFailureTestParams(cx, args, &params))
-        return false;
+    if (!ParseIterativeFailureTestParams(cx, args, &params)) {
+        return false;
+    }
 
     OOMSimulator simulator;
-    if (!RunIterativeFailureTest(cx, params, simulator))
-        return false;
+    if (!RunIterativeFailureTest(cx, params, simulator)) {
+        return false;
+    }
 
     args.rval().setUndefined();
     return true;
 }
 
 struct StackOOMSimulator : public IterativeFailureSimulator
 {
     void startSimulating(JSContext* cx, unsigned i, unsigned thread) override {
@@ -1931,22 +2032,24 @@ struct StackOOMSimulator : public Iterat
 };
 
 static bool
 StackTest(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     IterativeFailureTestParams params(cx);
-    if (!ParseIterativeFailureTestParams(cx, args, &params))
-        return false;
+    if (!ParseIterativeFailureTestParams(cx, args, &params)) {
+        return false;
+    }
 
     StackOOMSimulator simulator;
-    if (!RunIterativeFailureTest(cx, params, simulator))
-        return false;
+    if (!RunIterativeFailureTest(cx, params, simulator)) {
+        return false;
+    }
 
     args.rval().setUndefined();
     return true;
 }
 
 struct FailingIterruptSimulator : public IterativeFailureSimulator
 {
     JSInterruptCallback* prevEnd = nullptr;
@@ -1977,35 +2080,38 @@ struct FailingIterruptSimulator : public
 };
 
 static bool
 InterruptTest(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     IterativeFailureTestParams params(cx);
-    if (!ParseIterativeFailureTestParams(cx, args, &params))
-        return false;
+    if (!ParseIterativeFailureTestParams(cx, args, &params)) {
+        return false;
+    }
 
     FailingIterruptSimulator simulator;
-    if (!RunIterativeFailureTest(cx, params, simulator))
-        return false;
+    if (!RunIterativeFailureTest(cx, params, simulator)) {
+        return false;
+    }
 
     args.rval().setUndefined();
     return true;
 }
 
 #endif // defined(DEBUG) || defined(JS_OOM_BREAKPOINT)
 
 static bool
 SettlePromiseNow(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    if (!args.requireAtLeast(cx, "settlePromiseNow", 1))
-        return false;
+    if (!args.requireAtLeast(cx, "settlePromiseNow", 1)) {
+        return false;
+    }
     if (!args[0].isObject() || !args[0].toObject().is<PromiseObject>()) {
         JS_ReportErrorASCII(cx, "first argument must be a Promise object");
         return false;
     }
 
     Rooted<PromiseObject*> promise(cx, &args[0].toObject().as<PromiseObject>());
     if (IsPromiseForAsync(promise)) {
         JS_ReportErrorASCII(cx, "async function's promise shouldn't be manually settled");
@@ -2020,106 +2126,115 @@ SettlePromiseNow(JSContext* cx, unsigned
     Debugger::onPromiseSettled(cx, promise);
     return true;
 }
 
 static bool
 GetWaitForAllPromise(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    if (!args.requireAtLeast(cx, "getWaitForAllPromise", 1))
-        return false;
+    if (!args.requireAtLeast(cx, "getWaitForAllPromise", 1)) {
+        return false;
+    }
     if (!args[0].isObject() || !IsPackedArray(&args[0].toObject())) {
         JS_ReportErrorASCII(cx, "first argument must be a dense Array of Promise objects");
         return false;
     }
     RootedNativeObject list(cx, &args[0].toObject().as<NativeObject>());
     AutoObjectVector promises(cx);
     uint32_t count = list->getDenseInitializedLength();
-    if (!promises.resize(count))
-        return false;
+    if (!promises.resize(count)) {
+        return false;
+    }
 
     for (uint32_t i = 0; i < count; i++) {
         RootedValue elem(cx, list->getDenseElement(i));
         if (!elem.isObject() || !elem.toObject().is<PromiseObject>()) {
             JS_ReportErrorASCII(cx, "Each entry in the passed-in Array must be a Promise");
             return false;
         }
         promises[i].set(&elem.toObject());
     }
 
     RootedObject resultPromise(cx, JS::GetWaitForAllPromise(cx, promises));
-    if (!resultPromise)
-        return false;
+    if (!resultPromise) {
+        return false;
+    }
 
     args.rval().set(ObjectValue(*resultPromise));
     return true;
 }
 
 static bool
 ResolvePromise(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    if (!args.requireAtLeast(cx, "resolvePromise", 2))
-        return false;
+    if (!args.requireAtLeast(cx, "resolvePromise", 2)) {
+        return false;
+    }
     if (!args[0].isObject() || !UncheckedUnwrap(&args[0].toObject())->is<PromiseObject>()) {
         JS_ReportErrorASCII(cx, "first argument must be a maybe-wrapped Promise object");
         return false;
     }
 
     RootedObject promise(cx, &args[0].toObject());
     RootedValue resolution(cx, args[1]);
     mozilla::Maybe<AutoRealm> ar;
     if (IsWrapper(promise)) {
         promise = UncheckedUnwrap(promise);
         ar.emplace(cx, promise);
-        if (!cx->compartment()->wrap(cx, &resolution))
+        if (!cx->compartment()->wrap(cx, &resolution)) {
             return false;
+        }
     }
 
     if (IsPromiseForAsync(promise)) {
         JS_ReportErrorASCII(cx, "async function's promise shouldn't be manually resolved");
         return false;
     }
 
     bool result = JS::ResolvePromise(cx, promise, resolution);
-    if (result)
+    if (result) {
         args.rval().setUndefined();
+    }
     return result;
 }
 
 static bool
 RejectPromise(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    if (!args.requireAtLeast(cx, "rejectPromise", 2))
-        return false;
+    if (!args.requireAtLeast(cx, "rejectPromise", 2)) {
+        return false;
+    }
     if (!args[0].isObject() || !UncheckedUnwrap(&args[0].toObject())->is<PromiseObject>()) {
         JS_ReportErrorASCII(cx, "first argument must be a maybe-wrapped Promise object");
         return false;
     }
 
     RootedObject promise(cx, &args[0].toObject());
     RootedValue reason(cx, args[1]);
     mozilla::Maybe<AutoRealm> ar;
     if (IsWrapper(promise)) {
         promise = UncheckedUnwrap(promise);
         ar.emplace(cx, promise);
-        if (!cx->compartment()->wrap(cx, &reason))
+        if (!cx->compartment()->wrap(cx, &reason)) {
             return false;
+        }
     }
 
     if (IsPromiseForAsync(promise)) {
         JS_ReportErrorASCII(cx, "async function's promise shouldn't be manually rejected");
         return false;
     }
 
     bool result = JS::RejectPromise(cx, promise, reason);
-    if (result)
+    if (result) {
         args.rval().setUndefined();
+    }
     return result;
 }
 
 static bool
 StreamsAreEnabled(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     args.rval().setBoolean(cx->options().streams());
@@ -2152,18 +2267,19 @@ static const JSClass FinalizeCounterClas
 };
 
 static bool
 MakeFinalizeObserver(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     JSObject* obj = JS_NewObjectWithGivenProto(cx, &FinalizeCounterClass, nullptr);
-    if (!obj)
-        return false;
+    if (!obj) {
+        return false;
+    }
 
     args.rval().setObject(*obj);
     return true;
 }
 
 static bool
 FinalizeCount(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -2190,57 +2306,62 @@ DumpHeap(JSContext* cx, unsigned argc, V
     FILE* dumpFile = nullptr;
 
     unsigned i = 0;
     if (args.length() > i) {
         Value v = args[i];
         if (v.isString()) {
             JSString* str = v.toString();
             bool same = false;
-            if (!JS_StringEqualsAscii(cx, str, "collectNurseryBeforeDump", &same))
+            if (!JS_StringEqualsAscii(cx, str, "collectNurseryBeforeDump", &same)) {
                 return false;
+            }
             if (same) {
                 nurseryBehaviour = js::CollectNurseryBeforeDump;
                 ++i;
             }
         }
     }
 
     if (args.length() > i) {
         Value v = args[i];
         if (v.isString()) {
             if (!fuzzingSafe) {
                 RootedString str(cx, v.toString());
                 UniqueChars fileNameBytes = JS_EncodeStringToLatin1(cx, str);
-                if (!fileNameBytes)
+                if (!fileNameBytes) {
                     return false;
+                }
                 dumpFile = fopen(fileNameBytes.get(), "w");
                 if (!dumpFile) {
                     fileNameBytes = JS_EncodeStringToUTF8(cx, str);
-                    if (!fileNameBytes)
+                    if (!fileNameBytes) {
                         return false;
+                    }
                     JS_ReportErrorUTF8(cx, "can't open %s", fileNameBytes.get());
                     return false;
                 }
             }
             ++i;
         }
     }
 
     if (i != args.length()) {
         JS_ReportErrorASCII(cx, "bad arguments passed to dumpHeap");
-        if (dumpFile)
+        if (dumpFile) {
             fclose(dumpFile);
+        }
         return false;
     }
 
     js::DumpHeap(cx, dumpFile ? dumpFile : stdout, nurseryBehaviour);
 
-    if (dumpFile)
+    if (dumpFile) {
         fclose(dumpFile);
+    }
 
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 Terminate(JSContext* cx, unsigned arg, Value* vp)
 {
@@ -2263,18 +2384,19 @@ ReadGeckoProfilingStack(JSContext* cx, u
     // Return boolean 'false' if profiler is not enabled.
     if (!cx->runtime()->geckoProfiler().enabled()) {
         args.rval().setBoolean(false);
         return true;
     }
 
     // Array holding physical jit stack frames.
     RootedObject stack(cx, NewDenseEmptyArray(cx));
-    if (!stack)
-        return false;
+    if (!stack) {
+        return false;
+    }
 
     // If profiler sampling has been suppressed, return an empty
     // stack.
     if (!cx->isProfilerSamplingEnabled()) {
       args.rval().setObject(*stack);
       return true;
     }
 
@@ -2287,18 +2409,19 @@ ReadGeckoProfilingStack(JSContext* cx, u
     };
 
     Vector<Vector<InlineFrameInfo, 0, TempAllocPolicy>, 0, TempAllocPolicy> frameInfo(cx);
 
     JS::ProfilingFrameIterator::RegisterState state;
     for (JS::ProfilingFrameIterator i(cx, state); !i.done(); ++i) {
         MOZ_ASSERT(i.stackAddress() != nullptr);
 
-        if (!frameInfo.emplaceBack(cx))
+        if (!frameInfo.emplaceBack(cx)) {
             return false;
+        }
 
         const size_t MaxInlineFrames = 16;
         JS::ProfilingFrameIterator::Frame frames[MaxInlineFrames];
         uint32_t nframes = i.extractStack(frames, 0, MaxInlineFrames);
         MOZ_ASSERT(nframes <= MaxInlineFrames);
         for (uint32_t i = 0; i < nframes; i++) {
             const char* frameKindStr = nullptr;
             switch (frames[i].kind) {
@@ -2311,70 +2434,80 @@ ReadGeckoProfilingStack(JSContext* cx, u
               case JS::ProfilingFrameIterator::Frame_Wasm:
                 frameKindStr = "wasm";
                 break;
               default:
                 frameKindStr = "unknown";
             }
 
             UniqueChars label = DuplicateString(cx, frames[i].label);
-            if (!label)
+            if (!label) {
                 return false;
-
-            if (!frameInfo.back().emplaceBack(frameKindStr, std::move(label)))
+            }
+
+            if (!frameInfo.back().emplaceBack(frameKindStr, std::move(label))) {
                 return false;
+            }
         }
     }
 
     RootedObject inlineFrameInfo(cx);
     RootedString frameKind(cx);
     RootedString frameLabel(cx);
     RootedId idx(cx);
 
     const unsigned propAttrs = JSPROP_ENUMERATE;
 
     uint32_t physicalFrameNo = 0;
     for (auto& frame : frameInfo) {
         // Array holding all inline frames in a single physical jit stack frame.
         RootedObject inlineStack(cx, NewDenseEmptyArray(cx));
-        if (!inlineStack)
+        if (!inlineStack) {
             return false;
+        }
 
         uint32_t inlineFrameNo = 0;
         for (auto& inlineFrame : frame) {
             // Object holding frame info.
             RootedObject inlineFrameInfo(cx, NewBuiltinClassInstance<PlainObject>(cx));
-            if (!inlineFrameInfo)
+            if (!inlineFrameInfo) {
                 return false;
+            }
 
             frameKind = NewStringCopyZ<CanGC>(cx, inlineFrame.kind);
-            if (!frameKind)
+            if (!frameKind) {
                 return false;
-
-            if (!JS_DefineProperty(cx, inlineFrameInfo, "kind", frameKind, propAttrs))
+            }
+
+            if (!JS_DefineProperty(cx, inlineFrameInfo, "kind", frameKind, propAttrs)) {
                 return false;
+            }
 
             frameLabel = NewLatin1StringZ(cx, std::move(inlineFrame.label));
-            if (!frameLabel)
+            if (!frameLabel) {
                 return false;
-
-            if (!JS_DefineProperty(cx, inlineFrameInfo, "label", frameLabel, propAttrs))
+            }
+
+            if (!JS_DefineProperty(cx, inlineFrameInfo, "label", frameLabel, propAttrs)) {
                 return false;
+            }
 
             idx = INT_TO_JSID(inlineFrameNo);
-            if (!JS_DefinePropertyById(cx, inlineStack, idx, inlineFrameInfo, 0))
+            if (!JS_DefinePropertyById(cx, inlineStack, idx, inlineFrameInfo, 0)) {
                 return false;
+            }
 
             ++inlineFrameNo;
         }
 
         // Push inline array into main array.
         idx = INT_TO_JSID(physicalFrameNo);
-        if (!JS_DefinePropertyById(cx, stack, idx, inlineStack, 0))
+        if (!JS_DefinePropertyById(cx, stack, idx, inlineStack, 0)) {
             return false;
+        }
 
         ++physicalFrameNo;
     }
 
     args.rval().setObject(*stack);
     return true;
 }
 
@@ -2415,41 +2548,46 @@ class ShellAllocationMetadataBuilder : p
     static const ShellAllocationMetadataBuilder metadataBuilder;
 };
 
 JSObject*
 ShellAllocationMetadataBuilder::build(JSContext* cx, HandleObject,
                                       AutoEnterOOMUnsafeRegion& oomUnsafe) const
 {
     RootedObject obj(cx, NewBuiltinClassInstance<PlainObject>(cx));
-    if (!obj)
+    if (!obj) {
         oomUnsafe.crash("ShellAllocationMetadataBuilder::build");
+    }
 
     RootedObject stack(cx, NewDenseEmptyArray(cx));
-    if (!stack)
+    if (!stack) {
         oomUnsafe.crash("ShellAllocationMetadataBuilder::build");
+    }
 
     static int createdIndex = 0;
     createdIndex++;
 
-    if (!JS_DefineProperty(cx, obj, "index", createdIndex, 0))
+    if (!JS_DefineProperty(cx, obj, "index", createdIndex, 0)) {
         oomUnsafe.crash("ShellAllocationMetadataBuilder::build");
-
-    if (!JS_DefineProperty(cx, obj, "stack", stack, 0))
+    }
+
+    if (!JS_DefineProperty(cx, obj, "stack", stack, 0)) {
         oomUnsafe.crash("ShellAllocationMetadataBuilder::build");
+    }
 
     int stackIndex = 0;
     RootedId id(cx);
     RootedValue callee(cx);
     for (NonBuiltinScriptFrameIter iter(cx); !iter.done(); ++iter) {
         if (iter.isFunctionFrame() && iter.compartment() == cx->compartment()) {
             id = INT_TO_JSID(stackIndex);
             RootedObject callee(cx, iter.callee(cx));
-            if (!JS_DefinePropertyById(cx, stack, id, callee, 0))
+            if (!JS_DefinePropertyById(cx, stack, id, callee, 0)) {
                 oomUnsafe.crash("ShellAllocationMetadataBuilder::build");
+            }
             stackIndex++;
         }
     }
 
     return obj;
 }
 
 const ShellAllocationMetadataBuilder ShellAllocationMetadataBuilder::metadataBuilder;
@@ -2493,47 +2631,51 @@ testingFunc_bailAfter(JSContext* cx, uns
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     if (args.length() != 1 || !args[0].isInt32() || args[0].toInt32() < 0) {
         JS_ReportErrorASCII(cx, "Argument must be a positive number that fits in an int32");
         return false;
     }
 
 #ifdef DEBUG
-    if (auto* jitRuntime = cx->runtime()->jitRuntime())
+    if (auto* jitRuntime = cx->runtime()->jitRuntime()) {
         jitRuntime->setIonBailAfter(args[0].toInt32());
+    }
 #endif
 
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 testingFunc_inJit(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
-    if (!jit::IsBaselineEnabled(cx))
+    if (!jit::IsBaselineEnabled(cx)) {
         return ReturnStringCopy(cx, args, "Baseline is disabled.");
+    }
 
     JSScript* script = cx->currentScript();
-    if (script && script->getWarmUpResetCount() >= 20)
+    if (script && script->getWarmUpResetCount() >= 20) {
         return ReturnStringCopy(cx, args, "Compilation is being repeatedly prevented. Giving up.");
+    }
 
     args.rval().setBoolean(cx->currentlyRunningInJit());
     return true;
 }
 
 static bool
 testingFunc_inIon(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
-    if (!jit::IsIonEnabled(cx))
+    if (!jit::IsIonEnabled(cx)) {
         return ReturnStringCopy(cx, args, "Ion is disabled.");
+    }
 
     if (cx->activation()->hasWasmExitFP()) {
         // Exited through wasm. Note this is false when the fast wasm->jit exit
         // was taken, in which case we actually have jit frames on the stack.
         args.rval().setBoolean(false);
         return true;
     }
 
@@ -2541,18 +2683,19 @@ testingFunc_inIon(JSContext* cx, unsigne
     if (!iter.done() && iter.isIon()) {
         // Reset the counter of the IonScript's script.
         jit::JSJitFrameIter jitIter(cx->activation()->asJit());
         ++jitIter;
         jitIter.script()->resetWarmUpResetCounter();
     } else {
         // Check if we missed multiple attempts at compiling the innermost script.
         JSScript* script = cx->currentScript();
-        if (script && script->getWarmUpResetCount() >= 20)
+        if (script && script->getWarmUpResetCount() >= 20) {
             return ReturnStringCopy(cx, args, "Compilation is being repeatedly prevented. Giving up.");
+        }
     }
 
     args.rval().setBoolean(!iter.done() && iter.isIon());
     return true;
 }
 
 bool
 js::testingFunc_assertFloat32(JSContext* cx, unsigned argc, Value* vp)
@@ -2592,18 +2735,19 @@ js::testingFunc_assertRecoveredOnBailout
     return true;
 }
 
 static bool
 GetJitCompilerOptions(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     RootedObject info(cx, JS_NewPlainObject(cx));
-    if (!info)
-        return false;
+    if (!info) {
+        return false;
+    }
 
     uint32_t intValue = 0;
     RootedValue value(cx);
 
 #define JIT_COMPILER_MATCH(key, string)                                \
     opt = JSJITCOMPILER_ ## key;                                       \
     if (JS_GetGlobalJitCompilerOption(cx, opt, &intValue)) {           \
         value.setInt32(intValue);                                      \
@@ -2637,31 +2781,34 @@ class CloneBufferObject : public NativeO
     static const size_t SYNTHETIC_SLOT = 1;
     static const size_t NUM_SLOTS = 2;
 
   public:
     static const Class class_;
 
     static CloneBufferObject* Create(JSContext* cx) {
         RootedObject obj(cx, JS_NewObject(cx, Jsvalify(&class_)));
-        if (!obj)
+        if (!obj) {
             return nullptr;
+        }
         obj->as<CloneBufferObject>().setReservedSlot(DATA_SLOT, PrivateValue(nullptr));
         obj->as<CloneBufferObject>().setReservedSlot(SYNTHETIC_SLOT, BooleanValue(false));
 
-        if (!JS_DefineProperties(cx, obj, props_))
+        if (!JS_DefineProperties(cx, obj, props_)) {
             return nullptr;
+        }
 
         return &obj->as<CloneBufferObject>();
     }
 
     static CloneBufferObject* Create(JSContext* cx, JSAutoStructuredCloneBuffer* buffer) {
         Rooted<CloneBufferObject*> obj(cx, Create(cx));
-        if (!obj)
+        if (!obj) {
             return nullptr;
+        }
         auto data = js::MakeUnique<JSStructuredCloneData>(buffer->scope());
         if (!data) {
             ReportOutOfMemory(cx);
             return nullptr;
         }
         buffer->steal(data.get());
         obj->setData(data.release(), false);
         return obj;
@@ -2699,21 +2846,23 @@ class CloneBufferObject : public NativeO
             ArrayBufferObject* buffer = &args[0].toObject().as<ArrayBufferObject>();
             bool isSharedMemory;
             uint8_t* dataBytes = nullptr;
             js::GetArrayBufferLengthAndData(buffer, &nbytes, &isSharedMemory, &dataBytes);
             MOZ_ASSERT(!isSharedMemory);
             data = reinterpret_cast<char*>(dataBytes);
         } else {
             JSString* str = JS::ToString(cx, args.get(0));
-            if (!str)
+            if (!str) {
                 return false;
+            }
             dataOwner = JS_EncodeStringToLatin1(cx, str);
-            if (!dataOwner)
+            if (!dataOwner) {
                 return false;
+            }
             data = dataOwner.get();
             nbytes = JS_GetStringLength(str);
         }
 
         if (nbytes == 0 || (nbytes % sizeof(uint64_t) != 0)) {
             JS_ReportErrorASCII(cx, "Invalid length for clonebuffer data");
             return false;
         }
@@ -2746,66 +2895,70 @@ class CloneBufferObject : public NativeO
     static bool
     getData(JSContext* cx, Handle<CloneBufferObject*> obj, JSStructuredCloneData** data) {
         if (!obj->data()) {
             *data = nullptr;
             return true;
         }
 
         bool hasTransferable;
-        if (!JS_StructuredCloneHasTransferables(*obj->data(), &hasTransferable))
+        if (!JS_StructuredCloneHasTransferables(*obj->data(), &hasTransferable)) {
             return false;
+        }
 
         if (hasTransferable) {
             JS_ReportErrorASCII(cx, "cannot retrieve structured clone buffer with transferables");
             return false;
         }
 
         *data = obj->data();
         return true;
     }
 
     static bool
     getCloneBuffer_impl(JSContext* cx, const CallArgs& args) {
         Rooted<CloneBufferObject*> obj(cx, &args.thisv().toObject().as<CloneBufferObject>());
         MOZ_ASSERT(args.length() == 0);
 
         JSStructuredCloneData* data;
-        if (!getData(cx, obj, &data))
+        if (!getData(cx, obj, &data)) {
             return false;
+        }
 
         size_t size = data->Size();
         UniqueChars buffer(js_pod_malloc<char>(size));
         if (!buffer) {
             ReportOutOfMemory(cx);
             return false;
         }
         auto iter = data->Start();
         data->ReadBytes(iter, buffer.get(), size);
         JSString* str = JS_NewStringCopyN(cx, buffer.get(), size);
-        if (!str)
+        if (!str) {
             return false;
+        }
         args.rval().setString(str);
         return true;
     }
 
     static bool
     getCloneBuffer(JSContext* cx, unsigned int argc, JS::Value* vp) {
         CallArgs args = CallArgsFromVp(argc, vp);
         return CallNonGenericMethod<is, getCloneBuffer_impl>(cx, args);
     }
 
     static bool
     getCloneBufferAsArrayBuffer_impl(JSContext* cx, const CallArgs& args) {
         Rooted<CloneBufferObject*> obj(cx, &args.thisv().toObject().as<CloneBufferObject>());
         MOZ_ASSERT(args.length() == 0);
 
         JSStructuredCloneData* data;
-        if (!getData(cx, obj, &data))
+        if (!getData(cx, obj, &data)) {
             return false;
+        }
 
         size_t size = data->Size();
         UniqueChars buffer(js_pod_malloc<char>(size));
         if (!buffer) {
             ReportOutOfMemory(cx);
             return false;
         }
         auto iter = data->Start();
@@ -2857,91 +3010,102 @@ const JSPropertySpec CloneBufferObject::
 };
 
 static mozilla::Maybe<JS::StructuredCloneScope>
 ParseCloneScope(JSContext* cx, HandleString str)
 {
     mozilla::Maybe<JS::StructuredCloneScope> scope;
 
     JSLinearString* scopeStr = str->ensureLinear(cx);
-    if (!scopeStr)
+    if (!scopeStr) {
         return scope;
-
-    if (StringEqualsAscii(scopeStr, "SameProcessSameThread"))
+    }
+
+    if (StringEqualsAscii(scopeStr, "SameProcessSameThread")) {
         scope.emplace(JS::StructuredCloneScope::SameProcessSameThread);
-    else if (StringEqualsAscii(scopeStr, "SameProcessDifferentThread"))
+    } else if (StringEqualsAscii(scopeStr, "SameProcessDifferentThread")) {
         scope.emplace(JS::StructuredCloneScope::SameProcessDifferentThread);
-    else if (StringEqualsAscii(scopeStr, "DifferentProcess"))
+    } else if (StringEqualsAscii(scopeStr, "DifferentProcess")) {
         scope.emplace(JS::StructuredCloneScope::DifferentProcess);
-    else if (StringEqualsAscii(scopeStr, "DifferentProcessForIndexedDB"))
+    } else if (StringEqualsAscii(scopeStr, "DifferentProcessForIndexedDB")) {
         scope.emplace(JS::StructuredCloneScope::DifferentProcessForIndexedDB);
+    }
 
     return scope;
 }
 
 static bool
 Serialize(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     mozilla::Maybe<JSAutoStructuredCloneBuffer> clonebuf;
     JS::CloneDataPolicy policy;
 
     if (!args.get(2).isUndefined()) {
         RootedObject opts(cx, ToObject(cx, args.get(2)));
-        if (!opts)
+        if (!opts) {
             return false;
+        }
 
         RootedValue v(cx);
-        if (!JS_GetProperty(cx, opts, "SharedArrayBuffer", &v))
+        if (!JS_GetProperty(cx, opts, "SharedArrayBuffer", &v)) {
             return false;
+        }
 
         if (!v.isUndefined()) {
             JSString* str = JS::ToString(cx, v);
-            if (!str)
+            if (!str) {
                 return false;
+            }
             JSLinearString* poli = str->ensureLinear(cx);
-            if (!poli)
+            if (!poli) {
                 return false;
+            }
 
             if (StringEqualsAscii(poli, "allow")) {
                 // default
             } else if (StringEqualsAscii(poli, "deny")) {
                 policy.denySharedArrayBuffer();
             } else {
                 JS_ReportErrorASCII(cx, "Invalid policy value for 'SharedArrayBuffer'");
                 return false;
             }
         }
 
-        if (!JS_GetProperty(cx, opts, "scope", &v))
+        if (!JS_GetProperty(cx, opts, "scope", &v)) {
             return false;
+        }
 
         if (!v.isUndefined()) {
             RootedString str(cx, JS::ToString(cx, v));
-            if (!str)
+            if (!str) {
                 return false;
+            }
             auto scope = ParseCloneScope(cx, str);
             if (!scope) {
                 JS_ReportErrorASCII(cx, "Invalid structured clone scope");
                 return false;
             }
             clonebuf.emplace(*scope, nullptr, nullptr);
         }
     }
 
-    if (!clonebuf)
+    if (!clonebuf) {
         clonebuf.emplace(JS::StructuredCloneScope::SameProcessSameThread, nullptr, nullptr);
-
-    if (!clonebuf->write(cx, args.get(0), args.get(1), policy))
-        return false;
+    }
+
+    if (!clonebuf->write(cx, args.get(0), args.get(1), policy)) {
+        return false;
+    }
 
     RootedObject obj(cx, CloneBufferObject::Create(cx, clonebuf.ptr()));
-    if (!obj)
-        return false;
+    if (!obj) {
+        return false;
+    }
 
     args.rval().setObject(*obj);
     return true;
 }
 
 static bool
 Deserialize(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -2953,27 +3117,30 @@ Deserialize(JSContext* cx, unsigned argc
     }
     Rooted<CloneBufferObject*> obj(cx, &args[0].toObject().as<CloneBufferObject>());
 
     JS::StructuredCloneScope scope =
         obj->isSynthetic() ? JS::StructuredCloneScope::DifferentProcess
                            : JS::StructuredCloneScope::SameProcessSameThread;
     if (args.get(1).isObject()) {
         RootedObject opts(cx, &args[1].toObject());
-        if (!opts)
+        if (!opts) {
             return false;
+        }
 
         RootedValue v(cx);
-        if (!JS_GetProperty(cx, opts, "scope", &v))
+        if (!JS_GetProperty(cx, opts, "scope", &v)) {
             return false;
+        }
 
         if (!v.isUndefined()) {
             RootedString str(cx, JS::ToString(cx, v));
-            if (!str)
+            if (!str) {
                 return false;
+            }
             auto maybeScope = ParseCloneScope(cx, str);
             if (!maybeScope) {
                 JS_ReportErrorASCII(cx, "Invalid structured clone scope");
                 return false;
             }
 
             if (*maybeScope < scope) {
                 JS_ReportErrorASCII(cx, "Cannot use less restrictive scope "
@@ -2988,33 +3155,35 @@ Deserialize(JSContext* cx, unsigned argc
     // Clone buffer was already consumed?
     if (!obj->data()) {
         JS_ReportErrorASCII(cx, "deserialize given invalid clone buffer "
                             "(transferables already consumed?)");
         return false;
     }
 
     bool hasTransferable;
-    if (!JS_StructuredCloneHasTransferables(*obj->data(), &hasTransferable))
-        return false;
+    if (!JS_StructuredCloneHasTransferables(*obj->data(), &hasTransferable)) {
+        return false;
+    }
 
     RootedValue deserialized(cx);
     if (!JS_ReadStructuredClone(cx, *obj->data(),
                                 JS_STRUCTURED_CLONE_VERSION,
                                 scope,
                                 &deserialized, nullptr, nullptr))
     {
         return false;
     }
     args.rval().set(deserialized);
 
     // Consume any clone buffer with transferables; throw an error if it is
     // deserialized again.
-    if (hasTransferable)
+    if (hasTransferable) {
         obj->discard();
+    }
 
     return true;
 }
 
 static bool
 DetachArrayBuffer(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
@@ -3025,35 +3194,37 @@ DetachArrayBuffer(JSContext* cx, unsigne
     }
 
     if (!args[0].isObject()) {
         JS_ReportErrorASCII(cx, "detachArrayBuffer must be passed an object");
         return false;
     }
 
     RootedObject obj(cx, &args[0].toObject());
-    if (!JS_DetachArrayBuffer(cx, obj))
-        return false;
+    if (!JS_DetachArrayBuffer(cx, obj)) {
+        return false;
+    }
 
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 HelperThreadCount(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 #ifdef JS_MORE_DETERMINISTIC
     // Always return 0 to get consistent output with and without --no-threads.
     args.rval().setInt32(0);
 #else
-    if (CanUseExtraThreads())
+    if (CanUseExtraThreads()) {
         args.rval().setInt32(HelperThreadState().threadCount);
-    else
+    } else {
         args.rval().setInt32(0);
+    }
 #endif
     return true;
 }
 
 static bool
 EnableShapeConsistencyChecks(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
@@ -3065,18 +3236,19 @@ EnableShapeConsistencyChecks(JSContext* 
 }
 
 #ifdef JS_TRACE_LOGGING
 static bool
 EnableTraceLogger(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     TraceLoggerThread* logger = TraceLoggerForCurrentThread(cx);
-    if (!TraceLoggerEnable(logger, cx))
-        return false;
+    if (!TraceLoggerEnable(logger, cx)) {
+        return false;
+    }
 
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 DisableTraceLogger(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -3089,18 +3261,19 @@ DisableTraceLogger(JSContext* cx, unsign
 #endif
 
 #if defined(DEBUG) || defined(JS_JITSPEW)
 static bool
 DumpObject(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     RootedObject obj(cx, ToObject(cx, args.get(0)));
-    if (!obj)
-        return false;
+    if (!obj) {
+        return false;
+    }
 
     DumpObject(obj);
 
     args.rval().setUndefined();
     return true;
 }
 #endif
 
@@ -3193,18 +3366,19 @@ SharedAddress(JSContext* cx, unsigned ar
         return false;
     }
     char buffer[64];
     uint32_t nchar =
         SprintfLiteral(buffer, "%p",
                        obj->as<SharedArrayBufferObject>().dataPointerShared().unwrap(/*safeish*/));
 
     JSString* str = JS_NewStringCopyN(cx, buffer, nchar);
-    if (!str)
-        return false;
+    if (!str) {
+        return false;
+    }
 
     args.rval().setString(str);
 #endif
 
     return true;
 }
 #endif
 
@@ -3229,41 +3403,47 @@ GetBacktrace(JSContext* cx, unsigned arg
     if (args.length() > 1) {
         RootedObject callee(cx, &args.callee());
         ReportUsageErrorASCII(cx, callee, "Too many arguments");
         return false;
     }
 
     if (args.length() == 1) {
         RootedObject cfg(cx, ToObject(cx, args[0]));
-        if (!cfg)
+        if (!cfg) {
             return false;
+        }
         RootedValue v(cx);
 
-        if (!JS_GetProperty(cx, cfg, "args", &v))
+        if (!JS_GetProperty(cx, cfg, "args", &v)) {
             return false;
+        }
         showArgs = ToBoolean(v);
 
-        if (!JS_GetProperty(cx, cfg, "locals", &v))
+        if (!JS_GetProperty(cx, cfg, "locals", &v)) {
             return false;
+        }
         showLocals = ToBoolean(v);
 
-        if (!JS_GetProperty(cx, cfg, "thisprops", &v))
+        if (!JS_GetProperty(cx, cfg, "thisprops", &v)) {
             return false;
+        }
         showThisProps = ToBoolean(v);
     }
 
     JS::UniqueChars buf = JS::FormatStackDump(cx, showArgs, showLocals, showThisProps);
-    if (!buf)
-        return false;
+    if (!buf) {
+        return false;
+    }
 
     JS::ConstUTF8CharsZ utf8chars(buf.get(), strlen(buf.get()));
     JSString* str = NewStringCopyUTF8Z<CanGC>(cx, utf8chars);
-    if (!str)
-        return false;
+    if (!str) {
+        return false;
+    }
 
     args.rval().setString(str);
     return true;
 }
 
 static bool
 ReportOutOfMemory(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -3336,31 +3516,34 @@ struct FindPathHandler {
         nodes(nodes), edges(edges) { }
 
     bool
     operator()(Traversal& traversal, JS::ubi::Node origin, const JS::ubi::Edge& edge,
                BackEdge* backEdge, bool first)
     {
         // We take care of each node the first time we visit it, so there's
         // nothing to be done on subsequent visits.
-        if (!first)
+        if (!first) {
             return true;
+        }
 
         // Record how we reached this node. This is the last edge on a
         // shortest path to this node.
         EdgeName edgeName = DuplicateString(cx, edge.name.get());
-        if (!edgeName)
+        if (!edgeName) {
             return false;
+        }
         *backEdge = BackEdge(origin, std::move(edgeName));
 
         // Have we reached our final target node?
         if (edge.referent == target) {
             // Record the path that got us here, which must be a shortest path.
-            if (!recordPath(traversal))
+            if (!recordPath(traversal)) {
                 return false;
+            }
             foundPath = true;
             traversal.stop();
         }
 
         return true;
     }
 
     // We've found a path to our target. Walk the backlinks to produce the
@@ -3444,18 +3627,19 @@ FindPath(JSContext* cx, unsigned argc, V
         heaptools::FindPathHandler handler(cx, start, target, &nodes, edges);
         heaptools::FindPathHandler::Traversal traversal(cx, handler, autoCannotGC);
         if (!traversal.addStart(start)) {
             ReportOutOfMemory(cx);
             return false;
         }
 
         if (!traversal.traverse()) {
-            if (!cx->isExceptionPending())
+            if (!cx->isExceptionPending()) {
                 ReportOutOfMemory(cx);
+            }
             return false;
         }
 
         if (!handler.foundPath) {
             // We didn't find any paths from the start to the target.
             args.rval().setUndefined();
             return true;
         }
@@ -3471,58 +3655,65 @@ FindPath(JSContext* cx, unsigned argc, V
     //   }
     //
     // or, if the node is some internal thing that isn't a proper JavaScript
     // value:
     //
     //   { node: undefined, edge: <string> }
     size_t length = nodes.length();
     RootedArrayObject result(cx, NewDenseFullyAllocatedArray(cx, length));
-    if (!result)
-        return false;
+    if (!result) {
+        return false;
+    }
     result->ensureDenseInitializedLength(cx, 0, length);
 
     // Walk |nodes| and |edges| in the stored order, and construct the result
     // array in start-to-target order.
     for (size_t i = 0; i < length; i++) {
         // Build an object describing the node and edge.
         RootedObject obj(cx, NewBuiltinClassInstance<PlainObject>(cx));
-        if (!obj)
+        if (!obj) {
             return false;
+        }
 
         RootedValue wrapped(cx, nodes[i]);
-        if (!cx->compartment()->wrap(cx, &wrapped))
+        if (!cx->compartment()->wrap(cx, &wrapped)) {
             return false;
-
-        if (!JS_DefineProperty(cx, obj, "node", wrapped, JSPROP_ENUMERATE))
+        }
+
+        if (!JS_DefineProperty(cx, obj, "node", wrapped, JSPROP_ENUMERATE)) {
             return false;
+        }
 
         heaptools::EdgeName edgeName = std::move(edges[i]);
 
         size_t edgeNameLength = js_strlen(edgeName.get());
         RootedString edgeStr(cx, NewString<CanGC>(cx, std::move(edgeName), edgeNameLength));
-        if (!edgeStr)
+        if (!edgeStr) {
             return false;
-
-        if (!JS_DefineProperty(cx, obj, "edge", edgeStr, JSPROP_ENUMERATE))
+        }
+
+        if (!JS_DefineProperty(cx, obj, "edge", edgeStr, JSPROP_ENUMERATE)) {
             return false;
+        }
 
         result->setDenseElement(length - i - 1, ObjectValue(*obj));
     }
 
     args.rval().setObject(*result);
     return true;
 }
 
 static bool
 ShortestPaths(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    if (!args.requireAtLeast(cx, "shortestPaths", 3))
-        return false;
+    if (!args.requireAtLeast(cx, "shortestPaths", 3)) {
+        return false;
+    }
 
     // We don't ToString non-objects given as 'start' or 'target', because this
     // test is all about object identity, and ToString doesn't preserve that.
     // Non-GCThing endpoints don't make much sense.
     if (!args[0].isObject() && !args[0].isString() && !args[0].isSymbol()) {
         ReportValueError(cx, JSMSG_UNEXPECTED_TYPE, JSDVG_SEARCH_STACK, args[0], nullptr,
                          "not an object, string, or symbol");
         return false;
@@ -3546,18 +3737,19 @@ ShortestPaths(JSContext* cx, unsigned ar
         RootedValue el(cx, objs->getDenseElement(i));
         if (!el.isObject() && !el.isString() && !el.isSymbol()) {
             JS_ReportErrorASCII(cx, "Each target must be an object, string, or symbol");
             return false;
         }
     }
 
     int32_t maxNumPaths;
-    if (!JS::ToInt32(cx, args[2], &maxNumPaths))
-        return false;
+    if (!JS::ToInt32(cx, args[2], &maxNumPaths)) {
+        return false;
+    }
     if (maxNumPaths <= 0) {
         ReportValueError(cx, JSMSG_UNEXPECTED_TYPE, JSDVG_SEARCH_STACK, args[2], nullptr,
                          "not greater than 0");
         return false;
     }
 
     // We accumulate the results into a GC-stable form, due to the fact that the
     // JS::ubi::ShortestPaths lifetime (when operating on the live heap graph)
@@ -3609,63 +3801,69 @@ ShortestPaths(JSContext* cx, unsigned ar
                         return false;
                     }
                 }
 
                 return values.back().append(std::move(pathVals.get())) &&
                        names.back().append(std::move(pathNames));
             });
 
-            if (!ok)
+            if (!ok) {
                 return false;
+            }
         }
     }
 
     MOZ_ASSERT(values.length() == names.length());
     MOZ_ASSERT(values.length() == length);
 
     RootedArrayObject results(cx, NewDenseFullyAllocatedArray(cx, length));
-    if (!results)
-        return false;
+    if (!results) {
+        return false;
+    }
     results->ensureDenseInitializedLength(cx, 0, length);
 
     for (size_t i = 0; i < length; i++) {
         size_t numPaths = values[i].length();
         MOZ_ASSERT(names[i].length() == numPaths);
 
         RootedArrayObject pathsArray(cx, NewDenseFullyAllocatedArray(cx, numPaths));
-        if (!pathsArray)
+        if (!pathsArray) {
             return false;
+        }
         pathsArray->ensureDenseInitializedLength(cx, 0, numPaths);
 
         for (size_t j = 0; j < numPaths; j++) {
             size_t pathLength = values[i][j].length();
             MOZ_ASSERT(names[i][j].length() == pathLength);
 
             RootedArrayObject path(cx, NewDenseFullyAllocatedArray(cx, pathLength));
-            if (!path)
+            if (!path) {
                 return false;
+            }
             path->ensureDenseInitializedLength(cx, 0, pathLength);
 
             for (size_t k = 0; k < pathLength; k++) {
                 RootedPlainObject part(cx, NewBuiltinClassInstance<PlainObject>(cx));
-                if (!part)
+                if (!part) {
                     return false;
+                }
 
                 RootedValue predecessor(cx, values[i][j][k]);
                 if (!cx->compartment()->wrap(cx, &predecessor) ||
                     !JS_DefineProperty(cx, part, "predecessor", predecessor, JSPROP_ENUMERATE))
                 {
                     return false;
                 }
 
                 if (names[i][j][k]) {
                     RootedString edge(cx, NewStringCopyZ<CanGC>(cx, names[i][j][k].get()));
-                    if (!edge || !JS_DefineProperty(cx, part, "edge", edge, JSPROP_ENUMERATE))
+                    if (!edge || !JS_DefineProperty(cx, part, "edge", edge, JSPROP_ENUMERATE)) {
                         return false;
+                    }
                 }
 
                 path->setDenseElement(k, ObjectValue(*part));
             }
 
             pathsArray->setDenseElement(j, ObjectValue(*path));
         }
 
@@ -3675,51 +3873,56 @@ ShortestPaths(JSContext* cx, unsigned ar
     args.rval().setObject(*results);
     return true;
 }
 
 static bool
 EvalReturningScope(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    if (!args.requireAtLeast(cx, "evalReturningScope", 1))
-        return false;
+    if (!args.requireAtLeast(cx, "evalReturningScope", 1)) {
+        return false;
+    }
 
     RootedString str(cx, ToString(cx, args[0]));
-    if (!str)
-        return false;
+    if (!str) {
+        return false;
+    }
 
     RootedObject global(cx);
     if (args.hasDefined(1)) {
         global = ToObject(cx, args[1]);
-        if (!global)
+        if (!global) {
             return false;
+        }
     }
 
     AutoStableStringChars strChars(cx);
-    if (!strChars.initTwoByte(cx, str))
-        return false;
+    if (!strChars.initTwoByte(cx, str)) {
+        return false;
+    }
 
     mozilla::Range<const char16_t> chars = strChars.twoByteRange();
     size_t srclen = chars.length();
     const char16_t* src = chars.begin().get();
 
     JS::AutoFilename filename;
     unsigned lineno;
 
     JS::DescribeScriptedCaller(cx, &filename, &lineno);
 
     JS::CompileOptions options(cx);
     options.setFileAndLine(filename.get(), lineno);
     options.setNoScriptRval(true);
 
     JS::SourceBufferHolder srcBuf(src, srclen, JS::SourceBufferHolder::NoOwnership);
     RootedScript script(cx);
-    if (!JS::CompileForNonSyntacticScope(cx, options, srcBuf, &script))
-        return false;
+    if (!JS::CompileForNonSyntacticScope(cx, options, srcBuf, &script)) {
+        return false;
+    }
 
     if (global) {
         global = CheckedUnwrap(global);
         if (!global) {
             JS_ReportErrorASCII(cx, "Permission denied to access global");
             return false;
         }
         if (!global->is<GlobalObject>()) {
@@ -3734,97 +3937,110 @@ EvalReturningScope(JSContext* cx, unsign
     RootedObject lexicalScope(cx);
 
     {
         // If we're switching globals here, ExecuteInFrameScriptEnvironment will
         // take care of cloning the script into that compartment before
         // executing it.
         AutoRealm ar(cx, global);
         JS::RootedObject obj(cx, JS_NewPlainObject(cx));
-        if (!obj)
+        if (!obj) {
             return false;
-
-        if (!js::ExecuteInFrameScriptEnvironment(cx, obj, script, &lexicalScope))
+        }
+
+        if (!js::ExecuteInFrameScriptEnvironment(cx, obj, script, &lexicalScope)) {
             return false;
+        }
 
         varObj = lexicalScope->enclosingEnvironment()->enclosingEnvironment();
     }
 
     RootedObject rv(cx, JS_NewPlainObject(cx));
-    if (!rv)
-        return false;
+    if (!rv) {
+        return false;
+    }
 
     RootedValue varObjVal(cx, ObjectValue(*varObj));
-    if (!cx->compartment()->wrap(cx, &varObjVal))
-        return false;
-    if (!JS_SetProperty(cx, rv, "vars", varObjVal))
-        return false;
+    if (!cx->compartment()->wrap(cx, &varObjVal)) {
+        return false;
+    }
+    if (!JS_SetProperty(cx, rv, "vars", varObjVal)) {
+        return false;
+    }
 
     RootedValue lexicalScopeVal(cx, ObjectValue(*lexicalScope));
-    if (!cx->compartment()->wrap(cx, &lexicalScopeVal))
-        return false;
-    if (!JS_SetProperty(cx, rv, "lexicals", lexicalScopeVal))
-        return false;
+    if (!cx->compartment()->wrap(cx, &lexicalScopeVal)) {
+        return false;
+    }
+    if (!JS_SetProperty(cx, rv, "lexicals", lexicalScopeVal)) {
+        return false;
+    }
 
     args.rval().setObject(*rv);
     return true;
 }
 
 static bool
 ShellCloneAndExecuteScript(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    if (!args.requireAtLeast(cx, "cloneAndExecuteScript", 2))
-        return false;
+    if (!args.requireAtLeast(cx, "cloneAndExecuteScript", 2)) {
+        return false;
+    }
 
     RootedString str(cx, ToString(cx, args[0]));
-    if (!str)
-        return false;
+    if (!str) {
+        return false;
+    }
 
     RootedObject global(cx, ToObject(cx, args[1]));
-    if (!global)
-        return false;
+    if (!global) {
+        return false;
+    }
 
     AutoStableStringChars strChars(cx);
-    if (!strChars.initTwoByte(cx, str))
-        return false;
+    if (!strChars.initTwoByte(cx, str)) {
+        return false;
+    }
 
     mozilla::Range<const char16_t> chars = strChars.twoByteRange();
     size_t srclen = chars.length();
     const char16_t* src = chars.begin().get();
 
     JS::AutoFilename filename;
     unsigned lineno;
 
     JS::DescribeScriptedCaller(cx, &filename, &lineno);
 
     JS::CompileOptions options(cx);
     options.setFileAndLine(filename.get(), lineno);
     options.setNoScriptRval(true);
 
     JS::SourceBufferHolder srcBuf(src, srclen, JS::SourceBufferHolder::NoOwnership);
     RootedScript script(cx);
-    if (!JS::Compile(cx, options, srcBuf, &script))
-        return false;
+    if (!JS::Compile(cx, options, srcBuf, &script)) {
+        return false;
+    }
 
     global = CheckedUnwrap(global);
     if (!global) {
         JS_ReportErrorASCII(cx, "Permission denied to access global");
         return false;
     }
     if (!global->is<GlobalObject>()) {
         JS_ReportErrorASCII(cx, "Argument must be a global object");
         return false;
     }
 
     AutoRealm ar(cx, global);
 
     JS::RootedValue rval(cx);
-    if (!JS::CloneAndExecuteScript(cx, script, &rval))
-        return false;
+    if (!JS::CloneAndExecuteScript(cx, script, &rval)) {
+        return false;
+    }
 
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 IsSimdAvailable(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -3840,89 +4056,95 @@ ByteSize(JSContext* cx, unsigned argc, V
     mozilla::MallocSizeOf mallocSizeOf = cx->runtime()->debuggerMallocSizeOf;
 
     {
         // We can't tolerate the GC moving things around while we're using a
         // ubi::Node. Check that nothing we do causes a GC.
         JS::AutoCheckCannotGC autoCannotGC;
 
         JS::ubi::Node node = args.get(0);
-        if (node)
+        if (node) {
             args.rval().setNumber(uint32_t(node.size(mallocSizeOf)));
-        else
+        } else {
             args.rval().setUndefined();
+        }
     }
     return true;
 }
 
 static bool
 ByteSizeOfScript(JSContext*cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    if (!args.requireAtLeast(cx, "byteSizeOfScript", 1))
-        return false;
+    if (!args.requireAtLeast(cx, "byteSizeOfScript", 1)) {
+        return false;
+    }
     if (!args[0].isObject() || !args[0].toObject().is<JSFunction>()) {
         JS_ReportErrorASCII(cx, "Argument must be a Function object");
         return false;
     }
 
     RootedFunction fun(cx, &args[0].toObject().as<JSFunction>());
     if (fun->isNative()) {
         JS_ReportErrorASCII(cx, "Argument must be a scripted function");
         return false;
     }
 
     RootedScript script(cx, JSFunction::getOrCreateScript(cx, fun));
-    if (!script)
-        return false;
+    if (!script) {
+        return false;
+    }
 
     mozilla::MallocSizeOf mallocSizeOf = cx->runtime()->debuggerMallocSizeOf;
 
     {
         // We can't tolerate the GC moving things around while we're using a
         // ubi::Node. Check that nothing we do causes a GC.
         JS::AutoCheckCannotGC autoCannotGC;
 
         JS::ubi::Node node = script;
-        if (node)
+        if (node) {
             args.rval().setNumber(uint32_t(node.size(mallocSizeOf)));
-        else
+        } else {
             args.rval().setUndefined();
+        }
     }
     return true;
 }
 
 static bool
 SetImmutablePrototype(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     if (!args.get(0).isObject()) {
         JS_ReportErrorASCII(cx, "setImmutablePrototype: object expected");
         return false;
     }
 
     RootedObject obj(cx, &args[0].toObject());
 
     bool succeeded;
-    if (!js::SetImmutablePrototype(cx, obj, &succeeded))
-        return false;
+    if (!js::SetImmutablePrototype(cx, obj, &succeeded)) {
+        return false;
+    }
 
     args.rval().setBoolean(succeeded);
     return true;
 }
 
 #ifdef DEBUG
 static bool
 DumpStringRepresentation(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     RootedString str(cx, ToString(cx, args.get(0)));
-    if (!str)
-        return false;
+    if (!str) {
+        return false;
+    }
 
     Fprinter out(stderr);
     str->dumpRepresentation(out, 0);
 
     args.rval().setUndefined();
     return true;
 }
 #endif
@@ -3950,30 +4172,32 @@ SetDiscardSource(JSContext* cx, unsigned
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 GetConstructorName(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    if (!args.requireAtLeast(cx, "getConstructorName", 1))
-        return false;
+    if (!args.requireAtLeast(cx, "getConstructorName", 1)) {
+        return false;
+    }
 
     if (!args[0].isObject()) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_NOT_EXPECTED_TYPE,
                                   "getConstructorName", "Object",
                                   InformalValueTypeName(args[0]));
         return false;
     }
 
     RootedAtom name(cx);
     RootedObject obj(cx, &args[0].toObject());
-    if (!JSObject::constructorDisplayAtom(cx, obj, &name))
-        return false;
+    if (!JSObject::constructorDisplayAtom(cx, obj, &name)) {
+        return false;
+    }
 
     if (name) {
         args.rval().setString(name);
     } else {
         args.rval().setNull();
     }
     return true;
 }
@@ -3983,45 +4207,48 @@ AllocationMarker(JSContext* cx, unsigned
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     bool allocateInsideNursery = true;
     if (args.length() > 0 && args[0].isObject()) {
         RootedObject options(cx, &args[0].toObject());
 
         RootedValue nurseryVal(cx);
-        if (!JS_GetProperty(cx, options, "nursery", &nurseryVal))
+        if (!JS_GetProperty(cx, options, "nursery", &nurseryVal)) {
             return false;
+        }
         allocateInsideNursery = ToBoolean(nurseryVal);
     }
 
     static const Class cls = { "AllocationMarker" };
 
     auto newKind = allocateInsideNursery ? GenericObject : TenuredObject;
     RootedObject obj(cx, NewObjectWithGivenProto(cx, &cls, nullptr, newKind));
-    if (!obj)
-        return false;
+    if (!obj) {
+        return false;
+    }
 
     args.rval().setObject(*obj);
     return true;
 }
 
 namespace gcCallback {
 
 struct MajorGC {
     int32_t depth;
     int32_t phases;
 };
 
 static void
 majorGC(JSContext* cx, JSGCStatus status, void* data)
 {
     auto info = static_cast<MajorGC*>(data);
-    if (!(info->phases & (1 << status)))
+    if (!(info->phases & (1 << status))) {
         return;
+    }
 
     if (info->depth > 0) {
         info->depth--;
         JS::PrepareForFullGC(cx);
         JS::NonIncrementalGC(cx, GC_NORMAL, JS::gcreason::API);
         info->depth++;
     }
 }
@@ -4030,23 +4257,25 @@ struct MinorGC {
     int32_t phases;
     bool active;
 };
 
 static void
 minorGC(JSContext* cx, JSGCStatus status, void* data)
 {
     auto info = static_cast<MinorGC*>(data);
-    if (!(info->phases & (1 << status)))
+    if (!(info->phases & (1 << status))) {
         return;
+    }
 
     if (info->active) {
         info->active = false;
-        if (cx->zone() && !cx->zone()->isAtomsZone())
+        if (cx->zone() && !cx->zone()->isAtomsZone()) {
             cx->runtime()->gc.evictNursery(JS::gcreason::DEBUG_GC);
+        }
         info->active = true;
     }
 }
 
 // Process global, should really be runtime-local. Also, the final one of these
 // is currently leaked, since they are only deleted when changing.
 MajorGC* prevMajorGC = nullptr;
 MinorGC* prevMinorGC = nullptr;
@@ -4059,43 +4288,50 @@ SetGCCallback(JSContext* cx, unsigned ar
     CallArgs args = CallArgsFromVp(argc, vp);
 
     if (args.length() != 1) {
         JS_ReportErrorASCII(cx, "Wrong number of arguments");
         return false;
     }
 
     RootedObject opts(cx, ToObject(cx, args[0]));
-    if (!opts)
-        return false;
+    if (!opts) {
+        return false;
+    }
 
     RootedValue v(cx);
-    if (!JS_GetProperty(cx, opts, "action", &v))
-        return false;
+    if (!JS_GetProperty(cx, opts, "action", &v)) {
+        return false;
+    }
 
     JSString* str = JS::ToString(cx, v);
-    if (!str)
-        return false;
+    if (!str) {
+        return false;
+    }
     RootedLinearString action(cx, str->ensureLinear(cx));
-    if (!action)
-        return false;
+    if (!action) {
+        return false;
+    }
 
     int32_t phases = 0;
     if (StringEqualsAscii(action, "minorGC") || StringEqualsAscii(action, "majorGC")) {
-        if (!JS_GetProperty(cx, opts, "phases", &v))
+        if (!JS_GetProperty(cx, opts, "phases", &v)) {
             return false;
+        }
         if (v.isUndefined()) {
             phases = (1 << JSGC_END);
         } else {
             JSString* str = JS::ToString(cx, v);
-            if (!str)
+            if (!str) {
                 return false;
+            }
             JSLinearString* phasesStr = str->ensureLinear(cx);
-            if (!phasesStr)
+            if (!phasesStr) {
                 return false;
+            }
 
             if (StringEqualsAscii(phasesStr, "begin")) {
                 phases = (1 << JSGC_BEGIN);
             } else if (StringEqualsAscii(phasesStr, "end")) {
                 phases = (1 << JSGC_END);
             } else if (StringEqualsAscii(phasesStr, "both")) {
                 phases = (1 << JSGC_BEGIN) | (1 << JSGC_END);
             } else {
@@ -4123,22 +4359,24 @@ SetGCCallback(JSContext* cx, unsigned ar
             ReportOutOfMemory(cx);
             return false;
         }
 
         info->phases = phases;
         info->active = true;
         JS_SetGCCallback(cx, gcCallback::minorGC, info);
     } else if (StringEqualsAscii(action, "majorGC")) {
-        if (!JS_GetProperty(cx, opts, "depth", &v))
+        if (!JS_GetProperty(cx, opts, "depth", &v)) {
             return false;
+        }
         int32_t depth = 1;
         if (!v.isUndefined()) {
-            if (!ToInt32(cx, v, &depth))
+            if (!ToInt32(cx, v, &depth)) {
                 return false;
+            }
         }
         if (depth < 0) {
             JS_ReportErrorASCII(cx, "Nesting depth cannot be negative");
             return false;
         }
         if (depth + gcstats::MAX_PHASE_NESTING > gcstats::Statistics::MAX_SUSPENDED_PHASES) {
             JS_ReportErrorASCII(cx, "Nesting depth too large, would overflow");
             return false;
@@ -4194,42 +4432,47 @@ GetLcovInfo(JSContext* cx, unsigned argc
 
     size_t length = 0;
     UniqueChars content;
     {
         AutoRealm ar(cx, global);
         content.reset(js::GetCodeCoverageSummary(cx, &length));
     }
 
-    if (!content)
-        return false;
+    if (!content) {
+        return false;
+    }
 
     JSString* str = JS_NewStringCopyN(cx, content.get(), length);
-    if (!str)
-        return false;
+    if (!str) {
+        return false;
+    }
 
     args.rval().setString(str);
     return true;
 }
 
 #ifdef DEBUG
 static bool
 SetRNGState(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    if (!args.requireAtLeast(cx, "SetRNGState", 2))
-        return false;
+    if (!args.requireAtLeast(cx, "SetRNGState", 2)) {
+        return false;
+    }
 
     double d0;
-    if (!ToNumber(cx, args[0], &d0))
-        return false;
+    if (!ToNumber(cx, args[0], &d0)) {
+        return false;
+    }
 
     double d1;
-    if (!ToNumber(cx, args[1], &d1))
-        return false;
+    if (!ToNumber(cx, args[1], &d1)) {
+        return false;
+    }
 
     uint64_t seed0 = static_cast<uint64_t>(d0);
     uint64_t seed1 = static_cast<uint64_t>(d1);
 
     if (seed0 == 0 && seed1 == 0) {
         JS_ReportErrorASCII(cx, "RNG requires non-zero seed");
         return false;
     }
@@ -4265,239 +4508,281 @@ AssertionTypeToString(irregexp::RegExpAs
     }
     MOZ_CRASH("unexpected AssertionType");
 }
 
 static JSObject*
 ConvertRegExpTreeToObject(JSContext* cx, irregexp::RegExpTree* tree)
 {
     RootedObject obj(cx, JS_NewPlainObject(cx));
-    if (!obj)
+    if (!obj) {
         return nullptr;
+    }
 
     auto IntProp = [](JSContext* cx, HandleObject obj,
                       const char* name, int32_t value) {
         RootedValue val(cx, Int32Value(value));
         return JS_SetProperty(cx, obj, name, val);
     };
 
     auto BooleanProp = [](JSContext* cx, HandleObject obj,
                           const char* name, bool value) {
         RootedValue val(cx, BooleanValue(value));
         return JS_SetProperty(cx, obj, name, val);
     };
 
     auto StringProp = [](JSContext* cx, HandleObject obj,
                          const char* name, const char* value) {
         RootedString valueStr(cx, JS_NewStringCopyZ(cx, value));
-        if (!valueStr)
+        if (!valueStr) {
             return false;
+        }
 
         RootedValue val(cx, StringValue(valueStr));
         return JS_SetProperty(cx, obj, name, val);
     };
 
     auto ObjectProp = [](JSContext* cx, HandleObject obj,
                          const char* name, HandleObject value) {
         RootedValue val(cx, ObjectValue(*value));
         return JS_SetProperty(cx, obj, name, val);
     };
 
     auto CharVectorProp = [](JSContext* cx, HandleObject obj,
                              const char* name, const irregexp::CharacterVector& data) {
         RootedString valueStr(cx, JS_NewUCStringCopyN(cx, data.begin(), data.length()));
-        if (!valueStr)
+        if (!valueStr) {
             return false;
+        }
 
         RootedValue val(cx, StringValue(valueStr));
         return JS_SetProperty(cx, obj, name, val);
     };
 
     auto TreeProp = [&ObjectProp](JSContext* cx, HandleObject obj,
                                   const char* name, irregexp::RegExpTree* tree) {
         RootedObject treeObj(cx, ConvertRegExpTreeToObject(cx, tree));
-        if (!treeObj)
+        if (!treeObj) {
             return false;
+        }
         return ObjectProp(cx, obj, name, treeObj);
     };
 
     auto TreeVectorProp = [&ObjectProp](JSContext* cx, HandleObject obj,
                                         const char* name,
                                         const irregexp::RegExpTreeVector& nodes) {
         size_t len = nodes.length();
         RootedObject array(cx, JS_NewArrayObject(cx, len));
-        if (!array)
+        if (!array) {
             return false;
+        }
 
         for (size_t i = 0; i < len; i++) {
             RootedObject child(cx, ConvertRegExpTreeToObject(cx, nodes[i]));
-            if (!child)
+            if (!child) {
                 return false;
+            }
 
             RootedValue childVal(cx, ObjectValue(*child));
-            if (!JS_SetElement(cx, array, i, childVal))
+            if (!JS_SetElement(cx, array, i, childVal)) {
                 return false;
+            }
         }
         return ObjectProp(cx, obj, name, array);
     };
 
     auto CharRangesProp = [&ObjectProp](JSContext* cx, HandleObject obj,
                                         const char* name,
                                         const irregexp::CharacterRangeVector& ranges) {
         size_t len = ranges.length();
         RootedObject array(cx, JS_NewArrayObject(cx, len));
-        if (!array)
+        if (!array) {
             return false;
+        }
 
         for (size_t i = 0; i < len; i++) {
             const irregexp::CharacterRange& range = ranges[i];
             RootedObject rangeObj(cx, JS_NewPlainObject(cx));
-            if (!rangeObj)
+            if (!rangeObj) {
                 return false;
+            }
 
             auto CharProp = [](JSContext* cx, HandleObject obj,
                                const char* name, char16_t c) {
                 RootedString valueStr(cx, JS_NewUCStringCopyN(cx, &c, 1));
-                if (!valueStr)
+                if (!valueStr) {
                     return false;
+                }
                 RootedValue val(cx, StringValue(valueStr));
                 return JS_SetProperty(cx, obj, name, val);
             };
 
-            if (!CharProp(cx, rangeObj, "from", range.from()))
+            if (!CharProp(cx, rangeObj, "from", range.from())) {
                 return false;
-            if (!CharProp(cx, rangeObj, "to", range.to()))
+            }
+            if (!CharProp(cx, rangeObj, "to", range.to())) {
                 return false;
+            }
 
             RootedValue rangeVal(cx, ObjectValue(*rangeObj));
-            if (!JS_SetElement(cx, array, i, rangeVal))
+            if (!JS_SetElement(cx, array, i, rangeVal)) {
                 return false;
+            }
         }
         return ObjectProp(cx, obj, name, array);
     };
 
     auto ElemProp = [&ObjectProp](JSContext* cx, HandleObject obj,
                                   const char* name, const irregexp::TextElementVector& elements) {
         size_t len = elements.length();
         RootedObject array(cx, JS_NewArrayObject(cx, len));
-        if (!array)
+        if (!array) {
             return false;
+        }
 
         for (size_t i = 0; i < len; i++) {
             const irregexp::TextElement& element = elements[i];
             RootedObject elemTree(cx, ConvertRegExpTreeToObject(cx, element.tree()));
-            if (!elemTree)
+            if (!elemTree) {
                 return false;
+            }
 
             RootedValue elemTreeVal(cx, ObjectValue(*elemTree));
-            if (!JS_SetElement(cx, array, i, elemTreeVal))
+            if (!JS_SetElement(cx, array, i, elemTreeVal)) {
                 return false;
+            }
         }
         return ObjectProp(cx, obj, name, array);
     };
 
     if (tree->IsDisjunction()) {
-        if (!StringProp(cx, obj, "type", "Disjunction"))
+        if (!StringProp(cx, obj, "type", "Disjunction")) {
             return nullptr;
+        }
         irregexp::RegExpDisjunction* t = tree->AsDisjunction();
-        if (!TreeVectorProp(cx, obj, "alternatives", t->alternatives()))
+        if (!TreeVectorProp(cx, obj, "alternatives", t->alternatives())) {
             return nullptr;
+        }
         return obj;
     }
     if (tree->IsAlternative()) {
-        if (!StringProp(cx, obj, "type", "Alternative"))
+        if (!StringProp(cx, obj, "type", "Alternative")) {
             return nullptr;
+        }
         irregexp::RegExpAlternative* t = tree->AsAlternative();
-        if (!TreeVectorProp(cx, obj, "nodes", t->nodes()))
+        if (!TreeVectorProp(cx, obj, "nodes", t->nodes())) {
             return nullptr;
+        }
         return obj;
     }
     if (tree->IsAssertion()) {
-        if (!StringProp(cx, obj, "type", "Assertion"))
+        if (!StringProp(cx, obj, "type", "Assertion")) {
             return nullptr;
+        }
         irregexp::RegExpAssertion* t = tree->AsAssertion();
-        if (!StringProp(cx, obj, "assertion_type", AssertionTypeToString(t->assertion_type())))
+        if (!StringProp(cx, obj, "assertion_type", AssertionTypeToString(t->assertion_type()))) {
             return nullptr;
+        }
         return obj;
     }
     if (tree->IsCharacterClass()) {
-        if (!StringProp(cx, obj, "type", "CharacterClass"))
+        if (!StringProp(cx, obj, "type", "CharacterClass")) {
             return nullptr;
+        }
         irregexp::RegExpCharacterClass* t = tree->AsCharacterClass();
-        if (!BooleanProp(cx, obj, "is_negated", t->is_negated()))
+        if (!BooleanProp(cx, obj, "is_negated", t->is_negated())) {
             return nullptr;
+        }
         LifoAlloc* alloc = &cx->tempLifoAlloc();
-        if (!CharRangesProp(cx, obj, "ranges", t->ranges(alloc)))
+        if (!CharRangesProp(cx, obj, "ranges", t->ranges(alloc))) {
             return nullptr;
+        }
         return obj;
     }
     if (tree->IsAtom()) {
-        if (!StringProp(cx, obj, "type", "Atom"))
+        if (!StringProp(cx, obj, "type", "Atom")) {
             return nullptr;
+        }
         irregexp::RegExpAtom* t = tree->AsAtom();
-        if (!CharVectorProp(cx, obj, "data", t->data()))
+        if (!CharVectorProp(cx, obj, "data", t->data())) {
             return nullptr;
+        }
         return obj;
     }
     if (tree->IsText()) {
-        if (!StringProp(cx, obj, "type", "Text"))
+        if (!StringProp(cx, obj, "type", "Text")) {
             return nullptr;
+        }
         irregexp::RegExpText* t = tree->AsText();
-        if (!ElemProp(cx, obj, "elements", t->elements()))
+        if (!ElemProp(cx, obj, "elements", t->elements())) {
             return nullptr;
+        }
         return obj;
     }
     if (tree->IsQuantifier()) {
-        if (!StringProp(cx, obj, "type", "Quantifier"))
+        if (!StringProp(cx, obj, "type", "Quantifier")) {
             return nullptr;
+        }
         irregexp::RegExpQuantifier* t = tree->AsQuantifier();
-        if (!IntProp(cx, obj, "min", t->min()))
+        if (!IntProp(cx, obj, "min", t->min())) {
             return nullptr;
-        if (!IntProp(cx, obj, "max", t->max()))
+        }
+        if (!IntProp(cx, obj, "max", t->max())) {
             return nullptr;
+        }
         if (!StringProp(cx, obj, "quantifier_type",
                         t->is_possessive() ? "POSSESSIVE"
                         : t->is_non_greedy() ? "NON_GREEDY"
                         : "GREEDY"))
             return nullptr;
-        if (!TreeProp(cx, obj, "body", t->body()))
+        if (!TreeProp(cx, obj, "body", t->body())) {
             return nullptr;
+        }
         return obj;
     }
     if (tree->IsCapture()) {
-        if (!StringProp(cx, obj, "type", "Capture"))
+        if (!StringProp(cx, obj, "type", "Capture")) {
             return nullptr;
+        }
         irregexp::RegExpCapture* t = tree->AsCapture();
-        if (!IntProp(cx, obj, "index", t->index()))
+        if (!IntProp(cx, obj, "index", t->index())) {
             return nullptr;
-        if (!TreeProp(cx, obj, "body", t->body()))
+        }
+        if (!TreeProp(cx, obj, "body", t->body())) {
             return nullptr;
+        }
         return obj;
     }
     if (tree->IsLookahead()) {
-        if (!StringProp(cx, obj, "type", "Lookahead"))
+        if (!StringProp(cx, obj, "type", "Lookahead")) {
             return nullptr;
+        }
         irregexp::RegExpLookahead* t = tree->AsLookahead();
-        if (!BooleanProp(cx, obj, "is_positive", t->is_positive()))
+        if (!BooleanProp(cx, obj, "is_positive", t->is_positive())) {
             return nullptr;
-        if (!TreeProp(cx, obj, "body", t->body()))
+        }
+        if (!TreeProp(cx, obj, "body", t->body())) {
             return nullptr;
+        }
         return obj;
     }
     if (tree->IsBackReference()) {
-        if (!StringProp(cx, obj, "type", "BackReference"))
+        if (!StringProp(cx, obj, "type", "BackReference")) {
             return nullptr;
+        }
         irregexp::RegExpBackReference* t = tree->AsBackReference();
-        if (!IntProp(cx, obj, "index", t->index()))
+        if (!IntProp(cx, obj, "index", t->index())) {
             return nullptr;
+        }
         return obj;
     }
     if (tree->IsEmpty()) {
-        if (!StringProp(cx, obj, "type", "Empty"))
+        if (!StringProp(cx, obj, "type", "Empty")) {
             return nullptr;
+        }
         return obj;
     }
 
     MOZ_CRASH("unexpected RegExpTree type");
 }
 
 static bool
 ParseRegExp(JSContext* cx, unsigned argc, Value* vp)
@@ -4517,49 +4802,52 @@ ParseRegExp(JSContext* cx, unsigned argc
 
     RegExpFlag flags = RegExpFlag(0);
     if (!args.get(1).isUndefined()) {
         if (!args.get(1).isString()) {
             ReportUsageErrorASCII(cx, callee, "Second argument, if present, must be a String");
             return false;
         }
         RootedString flagStr(cx, args[1].toString());
-        if (!ParseRegExpFlags(cx, flagStr, &flags))
+        if (!ParseRegExpFlags(cx, flagStr, &flags)) {
             return false;
+        }
     }
 
     bool match_only = false;
     if (!args.get(2).isUndefined()) {
         if (!args.get(2).isBoolean()) {
             ReportUsageErrorASCII(cx, callee, "Third argument, if present, must be a Boolean");
             return false;
         }
         match_only = args[2].toBoolean();
     }
 
     RootedAtom pattern(cx, AtomizeString(cx, args[0].toString()));
-    if (!pattern)
-        return false;
+    if (!pattern) {
+        return false;
+    }
 
     CompileOptions options(cx);
     frontend::TokenStream dummyTokenStream(cx, options, nullptr, 0, nullptr);
 
     irregexp::RegExpCompileData data;
     if (!irregexp::ParsePattern(dummyTokenStream, cx->tempLifoAlloc(), pattern,
                                 flags & MultilineFlag, match_only,
                                 flags & UnicodeFlag, flags & IgnoreCaseFlag,
                                 flags & GlobalFlag, flags & StickyFlag,
                                 &data))
     {
         return false;
     }
 
     RootedObject obj(cx, ConvertRegExpTreeToObject(cx, data.tree));
-    if (!obj)
-        return false;
+    if (!obj) {
+        return false;
+    }
 
     args.rval().setObject(*obj);
     return true;
 }
 
 static bool
 DisRegExp(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -4590,22 +4878,24 @@ DisRegExp(JSContext* cx, unsigned argc, 
     RootedLinearString input(cx, cx->runtime()->emptyString);
     if (!args.get(2).isUndefined()) {
         if (!args.get(2).isString()) {
             ReportUsageErrorASCII(cx, callee, "Third argument, if present, must be a String");
             return false;
         }
         RootedString inputStr(cx, args[2].toString());
         input = inputStr->ensureLinear(cx);
-        if (!input)
+        if (!input) {
             return false;
-    }
-
-    if (!RegExpObject::dumpBytecode(cx, reobj, match_only, input))
-        return false;
+        }
+    }
+
+    if (!RegExpObject::dumpBytecode(cx, reobj, match_only, input)) {
+        return false;
+    }
 
     args.rval().setUndefined();
     return true;
 }
 #endif // DEBUG
 
 static bool
 GetTimeZone(JSContext* cx, unsigned argc, Value* vp)
@@ -4617,18 +4907,19 @@ GetTimeZone(JSContext* cx, unsigned argc
         ReportUsageErrorASCII(cx, callee, "Wrong number of arguments");
         return false;
     }
 
     auto getTimeZone = [](std::time_t* now) -> const char* {
         std::tm local{};
 #if defined(_WIN32)
         _tzset();
-        if (localtime_s(&local, now) == 0)
+        if (localtime_s(&local, now) == 0) {
             return _tzname[local.tm_isdst > 0];
+        }
 #else
         tzset();
 #if defined(HAVE_LOCALTIME_R)
         if (localtime_r(now, &local)) {
 #else
         std::tm* localtm = std::localtime(now);
         if (localtm) {
             *local = *localtm;
@@ -4641,18 +4932,19 @@ GetTimeZone(JSContext* cx, unsigned argc
 #endif /* HAVE_TM_ZONE_TM_GMTOFF */
         }
 #endif /* _WIN32 */
         return nullptr;
     };
 
     std::time_t now = std::time(nullptr);
     if (now != static_cast<std::time_t>(-1)) {
-        if (const char* tz = getTimeZone(&now))
+        if (const char* tz = getTimeZone(&now)) {
             return ReturnStringCopy(cx, args, tz);
+        }
     }
 
     args.rval().setUndefined();
     return true;
 }
 
 static bool
 SetTimeZone(JSContext* cx, unsigned argc, Value* vp)
@@ -4683,18 +4975,19 @@ SetTimeZone(JSContext* cx, unsigned argc
         return _putenv_s("TZ", "") == 0;
 #else
         return unsetenv("TZ") == 0;
 #endif /* _WIN32 */
     };
 
     if (args[0].isString() && !args[0].toString()->empty()) {
         UniqueChars timeZone = JS_EncodeStringToLatin1(cx, args[0].toString());
-        if (!timeZone)
+        if (!timeZone) {
             return false;
+        }
 
         if (!setTimeZone(timeZone.get())) {
             JS_ReportErrorASCII(cx, "Failed to set 'TZ' environment variable");
             return false;
         }
     } else {
         if (!unsetTimeZone()) {
             JS_ReportErrorASCII(cx, "Failed to unset 'TZ' environment variable");
@@ -4754,18 +5047,19 @@ SetDefaultLocale(JSContext* cx, unsigned
         auto containsOnlyValidBCP47Characters = [](auto* chars, size_t length) {
             return mozilla::IsAsciiAlpha(chars[0]) &&
                    std::all_of(chars, chars + length, [](auto c) {
                        return mozilla::IsAsciiAlphanumeric(c) || c == '-';
                    });
         };
 
         RootedLinearString str(cx, args[0].toString()->ensureLinear(cx));
-        if (!str)
+        if (!str) {
             return false;
+        }
 
         bool hasValidChars;
         {
             JS::AutoCheckCannotGC nogc;
 
             size_t length = str->length();
             hasValidChars = str->hasLatin1Chars()
                             ? containsOnlyValidBCP47Characters(str->latin1Chars(nogc), length)
@@ -4773,18 +5067,19 @@ SetDefaultLocale(JSContext* cx, unsigned
         }
 
         if (!hasValidChars) {
             ReportUsageErrorASCII(cx, callee, "First argument should be BCP47 language tag");
             return false;
         }
 
         UniqueChars locale = JS_EncodeStringToLatin1(cx, str);
-        if (!locale)
+        if (!locale) {
             return false;
+        }
 
         if (!JS_SetDefaultLocale(cx->runtime(), locale.get())) {
             ReportOutOfMemory(cx);
             return false;
         }
     } else {
         JS_ResetDefaultLocale(cx->runtime());
     }
@@ -4795,18 +5090,19 @@ SetDefaultLocale(JSContext* cx, unsigned
 
 #if defined(FUZZING) && defined(__AFL_COMPILER)
 static bool
 AflLoop(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     uint32_t max_cnt;
-    if (!ToUint32(cx, args.get(0), &max_cnt))
-        return false;
+    if (!ToUint32(cx, args.get(0), &max_cnt)) {
+        return false;
+    }
 
     args.rval().setBoolean(!!__AFL_LOOP(max_cnt));
     return true;
 }
 #endif
 
 static bool
 MonotonicNow(JSContext* cx, unsigned argc, Value* vp)
@@ -4833,18 +5129,19 @@ MonotonicNow(JSContext* cx, unsigned arg
             return false;
         }
 
         now = ComputeNow(ts);
 
         // Manually enforce atomicity on a non-monotonic clock.
         {
             static mozilla::Atomic<bool, mozilla::ReleaseAcquire> spinLock;
-            while (!spinLock.compareExchange(false, true))
+            while (!spinLock.compareExchange(false, true)) {
                 continue;
+            }
 
             static double lastNow = -FLT_MAX;
             now = lastNow = std::max(now, lastNow);
 
             spinLock = false;
         }
     }
 #else
@@ -4867,57 +5164,61 @@ TimeSinceCreation(JSContext* cx, unsigne
     args.rval().setNumber(when);
     return true;
 }
 
 static bool
 GetErrorNotes(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    if (!args.requireAtLeast(cx, "getErrorNotes", 1))
-        return false;
+    if (!args.requireAtLeast(cx, "getErrorNotes", 1)) {
+        return false;
+    }
 
     if (!args[0].isObject() || !args[0].toObject().is<ErrorObject>()) {
         args.rval().setNull();
         return true;
     }
 
     JSErrorReport* report = args[0].toObject().as<ErrorObject>().getErrorReport();
     if (!report) {
         args.rval().setNull();
         return true;
     }
 
     RootedObject notesArray(cx, CreateErrorNotesArray(cx, report));
-    if (!notesArray)
-        return false;
+    if (!notesArray) {
+        return false;
+    }
 
     args.rval().setObject(*notesArray);
     return true;
 }
 
 static bool
 IsConstructor(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
-    if (args.length() < 1)
+    if (args.length() < 1) {
         args.rval().setBoolean(false);
-    else
+    } else {
         args.rval().setBoolean(IsConstructor(args[0]));
+    }
     return true;
 }
 
 static bool
 SetTimeResolution(JSContext* cx, unsigned argc, Value* vp)
 {
    CallArgs args = CallArgsFromVp(argc, vp);
    RootedObject callee(cx, &args.callee());
 
-   if (!args.requireAtLeast(cx, "setTimeResolution", 2))
-        return false;
+   if (!args.requireAtLeast(cx, "setTimeResolution", 2)) {
+        return false;
+   }
 
    if (!args[0].isInt32()) {
       ReportUsageErrorASCII(cx, callee, "First argument must be an Int32.");
       return false;
    }
    int32_t resolution = args[0].toInt32();
 
    if (!args[1].isBoolean()) {
@@ -4940,18 +5241,19 @@ ScriptedCallerGlobal(JSContext* cx, unsi
     RootedObject obj(cx, JS::GetScriptedCallerGlobal(cx));
     if (!obj) {
         args.rval().setNull();
         return true;
     }
 
     obj = ToWindowProxyIfWindow(obj);
 
-    if (!cx->compartment()->wrap(cx, &obj))
-        return false;
+    if (!cx->compartment()->wrap(cx, &obj)) {
+        return false;
+    }
 
     args.rval().setObject(*obj);
     return true;
 }
 
 static bool
 ObjectGlobal(JSContext* cx, unsigned argc, Value* vp)
 {
@@ -4987,62 +5289,71 @@ AssertCorrectRealm(JSContext* cx, unsign
 JSScript*
 js::TestingFunctionArgumentToScript(JSContext* cx,
                                     HandleValue v,
                                     JSFunction** funp /* = nullptr */)
 {
     if (v.isString()) {
         // To convert a string to a script, compile it. Parse it as an ES6 Program.
         RootedLinearString linearStr(cx, StringToLinearString(cx, v.toString()));
-        if (!linearStr)
+        if (!linearStr) {
             return nullptr;
+        }
         size_t len = GetLinearStringLength(linearStr);
         AutoStableStringChars linearChars(cx);
-        if (!linearChars.initTwoByte(cx, linearStr))
+        if (!linearChars.initTwoByte(cx, linearStr)) {
             return nullptr;
+        }
         const char16_t* chars = linearChars.twoByteRange().begin().get();
 
         RootedScript script(cx);
         CompileOptions options(cx);
         SourceBufferHolder source(chars, len, SourceBufferHolder::NoOwnership);
-        if (!JS::Compile(cx, options, source, &script))
+        if (!JS::Compile(cx, options, source, &script)) {
             return nullptr;
+        }
         return script;
     }
 
     RootedFunction fun(cx, JS_ValueToFunction(cx, v));
-    if (!fun)
+    if (!fun) {
         return nullptr;
+    }
 
     // Unwrap bound functions.
     while (fun->isBoundFunction()) {
         JSObject* target = fun->getBoundFunctionTarget();
-        if (target && target->is<JSFunction>())
+        if (target && target->is<JSFunction>()) {
             fun = &target->as<JSFunction>();
-        else