Bug 1490594 - Always use braces for if/for/while statements in jsapi-tests. r=luke
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 12 Sep 2018 14:23:43 +0000
changeset 436047 ec5fe5d123b1baac235d978858c5226f7c8d9ed0
parent 436046 8675ff71202cb14c8ff3d7138d8166ff5870b5cb
child 436048 6a9c8ef40c0616b6338503957e9edc8fff2e4d00
push id34625
push userdvarga@mozilla.com
push dateThu, 13 Sep 2018 02:31:40 +0000
treeherdermozilla-central@51e9e9660b3e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1490594
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 1490594 - Always use braces for if/for/while statements in jsapi-tests. r=luke Differential Revision: https://phabricator.services.mozilla.com/D5649
js/src/jsapi-tests/testArgumentsObject.cpp
js/src/jsapi-tests/testArrayBuffer.cpp
js/src/jsapi-tests/testArrayBufferView.cpp
js/src/jsapi-tests/testAssemblerBuffer.cpp
js/src/jsapi-tests/testAtomicOperations.cpp
js/src/jsapi-tests/testBinASTReader.cpp
js/src/jsapi-tests/testBinTokenReaderTester.cpp
js/src/jsapi-tests/testBug604087.cpp
js/src/jsapi-tests/testCallArgs.cpp
js/src/jsapi-tests/testCompileNonSyntactic.cpp
js/src/jsapi-tests/testDateToLocaleString.cpp
js/src/jsapi-tests/testDefineProperty.cpp
js/src/jsapi-tests/testDefinePropertyIgnoredAttributes.cpp
js/src/jsapi-tests/testErrorInterceptor.cpp
js/src/jsapi-tests/testExecuteInJSMEnvironment.cpp
js/src/jsapi-tests/testFindSCCs.cpp
js/src/jsapi-tests/testFreshGlobalEvalRedefinition.cpp
js/src/jsapi-tests/testGCAllocator.cpp
js/src/jsapi-tests/testGCChunkPool.cpp
js/src/jsapi-tests/testGCExactRooting.cpp
js/src/jsapi-tests/testGCFinalizeCallback.cpp
js/src/jsapi-tests/testGCGrayMarking.cpp
js/src/jsapi-tests/testGCHeapPostBarriers.cpp
js/src/jsapi-tests/testGCMarking.cpp
js/src/jsapi-tests/testGCOutOfMemory.cpp
js/src/jsapi-tests/testGCUniqueId.cpp
js/src/jsapi-tests/testGCWeakCache.cpp
js/src/jsapi-tests/testHashTable.cpp
js/src/jsapi-tests/testIndexToString.cpp
js/src/jsapi-tests/testIntern.cpp
js/src/jsapi-tests/testIntlAvailableLocales.cpp
js/src/jsapi-tests/testJitDCEinGVN.cpp
js/src/jsapi-tests/testJitFoldsTo.cpp
js/src/jsapi-tests/testJitGVN.cpp
js/src/jsapi-tests/testJitMacroAssembler.cpp
js/src/jsapi-tests/testJitMinimalFunc.h
js/src/jsapi-tests/testJitRValueAlloc.cpp
js/src/jsapi-tests/testJitRangeAnalysis.cpp
js/src/jsapi-tests/testJitRegisterSet.cpp
js/src/jsapi-tests/testLookup.cpp
js/src/jsapi-tests/testMappedArrayBuffer.cpp
js/src/jsapi-tests/testMutedErrors.cpp
js/src/jsapi-tests/testNewObject.cpp
js/src/jsapi-tests/testOOM.cpp
js/src/jsapi-tests/testObjectEmulatingUndefined.cpp
js/src/jsapi-tests/testParseJSON.cpp
js/src/jsapi-tests/testPersistentRooted.cpp
js/src/jsapi-tests/testPreserveJitCode.cpp
js/src/jsapi-tests/testPrivateGCThingValue.cpp
js/src/jsapi-tests/testProfileStrings.cpp
js/src/jsapi-tests/testPromise.cpp
js/src/jsapi-tests/testReadableStream.cpp
js/src/jsapi-tests/testScriptInfo.cpp
js/src/jsapi-tests/testScriptObject.cpp
js/src/jsapi-tests/testSetPropertyIgnoringNamedGetter.cpp
js/src/jsapi-tests/testSharedImmutableStringsCache.cpp
js/src/jsapi-tests/testSlowScript.cpp
js/src/jsapi-tests/testStructuredClone.cpp
js/src/jsapi-tests/testThreadingConditionVariable.cpp
js/src/jsapi-tests/testThreadingExclusiveData.cpp
js/src/jsapi-tests/testThreadingThread.cpp
js/src/jsapi-tests/testTypedArrays.cpp
js/src/jsapi-tests/testUTF8.cpp
js/src/jsapi-tests/testUbiNode.cpp
js/src/jsapi-tests/testUncaughtSymbol.cpp
js/src/jsapi-tests/testWasmLEB128.cpp
js/src/jsapi-tests/testWeakMap.cpp
js/src/jsapi-tests/testXDR.cpp
js/src/jsapi-tests/tests.cpp
js/src/jsapi-tests/tests.h
--- a/js/src/jsapi-tests/testArgumentsObject.cpp
+++ b/js/src/jsapi-tests/testArgumentsObject.cpp
@@ -85,28 +85,31 @@ ExhaustiveTest(const char funcode[])
     Rooted<ArgumentsObject*> argsobj(cx, &v.toObjectOrNull()->as<ArgumentsObject>());
 
     JS::AutoValueArray<MAX_ELEMS> elems(cx);
 
     for (size_t i = 0; i <= ArgCount; i++) {
         for (size_t j = 0; j <= ArgCount - i; j++) {
             ClearElements(elems);
             CHECK(argsobj->maybeGetElements(i, j, elems.begin()));
-            for (size_t k = 0; k < j; k++)
+            for (size_t k = 0; k < j; k++) {
                 CHECK(elems[k].isInt32(i + k));
-            for (size_t k = j; k < MAX_ELEMS - 1; k++)
+            }
+            for (size_t k = j; k < MAX_ELEMS - 1; k++) {
                 CHECK(elems[k].isNull());
+            }
             CHECK(elems[MAX_ELEMS - 1].isInt32(42));
         }
     }
 
     return true;
 }
 
 template <size_t N>
 static void
 ClearElements(JS::AutoValueArray<N>& elems)
 {
-    for (size_t i = 0; i < elems.length() - 1; i++)
+    for (size_t i = 0; i < elems.length() - 1; i++) {
         elems[i].setNull();
+    }
     elems[elems.length() - 1].setInt32(42);
 }
 END_TEST(testArgumentsObject)
--- a/js/src/jsapi-tests/testArrayBuffer.cpp
+++ b/js/src/jsapi-tests/testArrayBuffer.cpp
@@ -156,20 +156,22 @@ bool hasDetachedBuffer(JS::HandleObject 
     JS::RootedValue v(cx);
     return JS_GetProperty(cx, obj, "byteLength", &v) && v.toInt32() == 0;
 }
 
 END_TEST(testArrayBuffer_bug720949_viewList)
 
 BEGIN_TEST(testArrayBuffer_externalize)
 {
-    if (!testWithSize(cx, 2))    // ArrayBuffer data stored inline in the object.
+    if (!testWithSize(cx, 2)) {  // ArrayBuffer data stored inline in the object.
         return false;
-    if (!testWithSize(cx, 2000)) // ArrayBuffer data stored out-of-line in a separate heap allocation.
+    }
+    if (!testWithSize(cx, 2000)) { // ArrayBuffer data stored out-of-line in a separate heap allocation.
         return false;
+    }
 
     return true;
 }
 
 bool testWithSize(JSContext* cx, size_t n)
 {
     JS::RootedObject buffer(cx, JS_NewArrayBuffer(cx, n));
     CHECK(buffer != nullptr);
@@ -213,18 +215,19 @@ static void GC(JSContext* cx)
     JS_GC(cx);
     JS_GC(cx); // Trigger another to wait for background finalization to end
 }
 
 static bool
 hasExpectedLength(JSContext* cx, JS::HandleObject obj, uint32_t* len)
 {
     JS::RootedValue v(cx);
-    if (!JS_GetProperty(cx, obj, "byteLength", &v))
+    if (!JS_GetProperty(cx, obj, "byteLength", &v)) {
         return false;
+    }
     *len = v.toInt32();
     return true;
 }
 
 END_TEST(testArrayBuffer_externalize)
 
 BEGIN_TEST(testArrayBuffer_customFreeFunc)
 {
--- a/js/src/jsapi-tests/testArrayBufferView.cpp
+++ b/js/src/jsapi-tests/testArrayBufferView.cpp
@@ -88,18 +88,19 @@ BEGIN_TEST(testArrayBufferView_type)
 
     return true;
 }
 
 static JSObject*
 CreateDataView(JSContext* cx)
 {
     JS::Rooted<JSObject*> buffer(cx, JS_NewArrayBuffer(cx, 8));
-    if (!buffer)
+    if (!buffer) {
         return nullptr;
+    }
     return JS_NewDataView(cx, buffer, 0, 8);
 }
 
 template<JSObject * CreateTypedArray(JSContext* cx, uint32_t length),
          size_t Length>
 static JSObject*
 Create(JSContext* cx)
 {
--- a/js/src/jsapi-tests/testAssemblerBuffer.cpp
+++ b/js/src/jsapi-tests/testAssemblerBuffer.cpp
@@ -537,32 +537,34 @@ BEGIN_TEST(testAssemblerBuffer_ARM64)
 
     // Branches can reach the label, but the linked list of uses needs to be
     // rearranged. The final conditional branch cannot reach the first branch.
     Label lab2a;
     Label lab2b;
     masm.bind(&lab2a);
     masm.B(&lab2b);
     // Generate 1,100,000 bytes of NOPs.
-    for (unsigned n = 0; n < 1100000; n += 4)
+    for (unsigned n = 0; n < 1100000; n += 4) {
         masm.Nop();
+    }
     masm.branch(Assembler::LessThan, &lab2b);
     masm.bind(&lab2b);
     CHECK_EQUAL(masm.getInstructionAt(BufferOffset(lab2a.offset()))->InstructionBits(),
                 vixl::B | vixl::Assembler::ImmUncondBranch(1100000 / 4 + 2));
     CHECK_EQUAL(masm.getInstructionAt(BufferOffset(lab2b.offset() - 4))->InstructionBits(),
                 vixl::B_cond | vixl::Assembler::ImmCondBranch(1) | vixl::lt);
 
     // Generate a conditional branch that can't reach its label.
     Label lab3a;
     Label lab3b;
     masm.bind(&lab3a);
     masm.branch(Assembler::LessThan, &lab3b);
-    for (unsigned n = 0; n < 1100000; n += 4)
+    for (unsigned n = 0; n < 1100000; n += 4) {
         masm.Nop();
+    }
     masm.bind(&lab3b);
     masm.B(&lab3a);
     Instruction* bcond3 = masm.getInstructionAt(BufferOffset(lab3a.offset()));
     CHECK_EQUAL(bcond3->BranchType(), vixl::CondBranchType);
     ptrdiff_t delta = bcond3->ImmPCRawOffset() * 4;
     Instruction* veneer = masm.getInstructionAt(BufferOffset(lab3a.offset() + delta));
     CHECK_EQUAL(veneer->BranchType(), vixl::UncondBranchType);
     delta += veneer->ImmPCRawOffset() * 4;
--- a/js/src/jsapi-tests/testAtomicOperations.cpp
+++ b/js/src/jsapi-tests/testAtomicOperations.cpp
@@ -202,29 +202,31 @@ BEGIN_TEST(testAtomicOperationsI32)
     const int32_t A = 0x3bdc0588;
     const int32_t B = 0x27371843;
     ATOMIC_TESTS(int32_t, A, B);
 }
 END_TEST(testAtomicOperationsI32)
 
 BEGIN_TEST(testAtomicOperationsU64)
 {
-    if (!jit::AtomicOperations::hasAtomic8())
+    if (!jit::AtomicOperations::hasAtomic8()) {
         return true;
+    }
 
     const uint64_t A(0x9aadf00ddeadbeef);
     const uint64_t B(0x4eedbead1337f001);
     ATOMIC_TESTS(uint64_t, A, B);
 }
 END_TEST(testAtomicOperationsU64)
 
 BEGIN_TEST(testAtomicOperationsI64)
 {
-    if (!jit::AtomicOperations::hasAtomic8())
+    if (!jit::AtomicOperations::hasAtomic8()) {
         return true;
+    }
 
     const int64_t A(0x2aadf00ddeadbeef);
     const int64_t B(0x4eedbead1337f001);
     ATOMIC_TESTS(int64_t, A, B);
 }
 END_TEST(testAtomicOperationsI64)
 
 // T is the primitive float type we're testing, and A and B are references to
--- a/js/src/jsapi-tests/testBinASTReader.cpp
+++ b/js/src/jsapi-tests/testBinASTReader.cpp
@@ -44,18 +44,19 @@ extern void readFull(const char* path, j
 void
 readFull(JSContext* cx, const char* path, js::Vector<char16_t>& buf)
 {
     buf.shrinkTo(0);
 
     js::Vector<uint8_t> intermediate(cx);
     readFull(path, intermediate);
 
-    if (!buf.appendAll(intermediate))
+    if (!buf.appendAll(intermediate)) {
         MOZ_CRASH("Couldn't read data");
+    }
 }
 
 // Invariant: `path` must end with directory separator.
 template<typename Tok> void
 runTestFromPath(JSContext* cx, const char* path)
 {
     const char BIN_SUFFIX[] = ".binjs";
     const char TXT_SUFFIX[] = ".js";
@@ -64,35 +65,39 @@ runTestFromPath(JSContext* cx, const cha
 
 #if defined(XP_UNIX)
     MOZ_ASSERT(path[pathlen - 1] == '/');
 
     // Read the list of files in the directory.
     enterJsDirectory();
     DIR* dir = opendir(path);
     exitJsDirectory();
-    if (!dir)
+    if (!dir) {
         MOZ_CRASH("Couldn't open directory");
+    }
 
 
     while (auto entry = readdir(dir)) {
         const char* d_name = entry->d_name;
         const bool isDirectory = entry->d_type == DT_DIR;
 
 
 #elif defined(XP_WIN)
     MOZ_ASSERT(path[pathlen - 1] == '\\');
 
     Vector<char> pattern(cx);
-    if (!pattern.append(path, pathlen))
+    if (!pattern.append(path, pathlen)) {
+        MOZ_CRASH();
+    }
+    if (!pattern.append('*')) {
         MOZ_CRASH();
-    if (!pattern.append('*'))
+    }
+    if (!pattern.append('\0')) {
         MOZ_CRASH();
-    if (!pattern.append('\0'))
-        MOZ_CRASH();
+    }
 
     WIN32_FIND_DATA FindFileData;
     enterJsDirectory();
     HANDLE hFind = FindFirstFile(pattern.begin(), &FindFileData);
     exitJsDirectory();
     for (bool found = (hFind != INVALID_HANDLE_VALUE);
             found;
             found = FindNextFile(hFind, &FindFileData))
@@ -101,104 +106,120 @@ runTestFromPath(JSContext* cx, const cha
         const bool isDirectory = FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
 
 #endif // defined(XP_UNIX) || defined(XP_WIN)
 
         const size_t namlen = strlen(d_name);
 
         // Recurse through subdirectories.
         if (isDirectory) {
-            if (strcmp(d_name, ".") == 0)
+            if (strcmp(d_name, ".") == 0) {
                 continue;
-            if (strcmp(d_name, "..") == 0)
+            }
+            if (strcmp(d_name, "..") == 0) {
                 continue;
+            }
 
             Vector<char> subPath(cx);
             // Start with `path` (including directory separator).
-            if (!subPath.append(path, pathlen))
+            if (!subPath.append(path, pathlen)) {
                 MOZ_CRASH();
-            if (!subPath.append(d_name, namlen))
+            }
+            if (!subPath.append(d_name, namlen)) {
                 MOZ_CRASH();
+            }
             // Append same directory separator.
-            if (!subPath.append(path[pathlen - 1]))
+            if (!subPath.append(path[pathlen - 1])) {
                 MOZ_CRASH();
-            if (!subPath.append(0))
+            }
+            if (!subPath.append(0)) {
                 MOZ_CRASH();
+            }
             runTestFromPath<Tok>(cx, subPath.begin());
             continue;
         }
 
         {
             // Make sure that we run GC between two tests. Otherwise, since we're running
             // everything from the same cx and without returning to JS, there is nothing
             // to deallocate the ASTs.
             JS::PrepareForFullGC(cx);
             cx->runtime()->gc.gc(GC_NORMAL, JS::gcreason::NO_REASON);
         }
         LifoAllocScope allocScope(&cx->tempLifoAlloc());
 
         // Find files whose name ends with ".binjs".
         fprintf(stderr, "Considering %s\n", d_name);
-        if (namlen < sizeof(BIN_SUFFIX))
+        if (namlen < sizeof(BIN_SUFFIX)) {
             continue;
+        }
         if (strncmp(d_name + namlen - (sizeof(BIN_SUFFIX) - 1),
                     BIN_SUFFIX,
                     sizeof(BIN_SUFFIX)
             ) != 0)
             continue;
 
         // Find text file.
         Vector<char> txtPath(cx);
-        if (!txtPath.append(path, pathlen))
+        if (!txtPath.append(path, pathlen)) {
             MOZ_CRASH();
-        if (!txtPath.append(d_name, namlen))
+        }
+        if (!txtPath.append(d_name, namlen)) {
             MOZ_CRASH();
+        }
         txtPath.shrinkBy(sizeof(BIN_SUFFIX) - 1);
-        if (!txtPath.append(TXT_SUFFIX, sizeof(TXT_SUFFIX)))
+        if (!txtPath.append(TXT_SUFFIX, sizeof(TXT_SUFFIX))) {
             MOZ_CRASH();
+        }
         fprintf(stderr, "Testing %s\n", txtPath.begin());
 
         // Read text file.
         js::Vector<char16_t> txtSource(cx);
         readFull(cx, txtPath.begin(), txtSource);
 
         // Parse text file.
         CompileOptions txtOptions(cx);
         txtOptions.setFileAndLine(txtPath.begin(), 0);
 
         UsedNameTracker txtUsedNames(cx);
 
         RootedScriptSourceObject sourceObject(cx, frontend::CreateScriptSourceObject(
                                                   cx, txtOptions, mozilla::Nothing()));
-        if (!sourceObject)
+        if (!sourceObject) {
             MOZ_CRASH("Couldn't initialize ScriptSourceObject");
+        }
 
         js::frontend::Parser<js::frontend::FullParseHandler, char16_t> txtParser(
             cx, allocScope.alloc(), txtOptions, txtSource.begin(), txtSource.length(),
             /* foldConstants = */ false, txtUsedNames, nullptr,
             nullptr, sourceObject, frontend::ParseGoal::Script);
-        if (!txtParser.checkOptions())
+        if (!txtParser.checkOptions()) {
             MOZ_CRASH("Bad options");
+        }
 
         auto txtParsed = txtParser.parse(); // Will be deallocated once `parser` goes out of scope.
         RootedValue txtExn(cx);
         if (!txtParsed) {
             // Save exception for more detailed error message, if necessary.
-            if (!js::GetAndClearException(cx, &txtExn))
+            if (!js::GetAndClearException(cx, &txtExn)) {
                 MOZ_CRASH("Couldn't clear exception");
+            }
         }
 
         // Read binary file.
         Vector<char> binPath(cx);
-        if (!binPath.append(path, pathlen))
+        if (!binPath.append(path, pathlen)) {
+            MOZ_CRASH();
+        }
+        if (!binPath.append(d_name, namlen)) {
             MOZ_CRASH();
-        if (!binPath.append(d_name, namlen))
+        }
+        if (!binPath.append(0)) {
             MOZ_CRASH();
-        if (!binPath.append(0))
-            MOZ_CRASH();
+        }
 
         js::Vector<uint8_t> binSource(cx);
         readFull(binPath.begin(), binSource);
 
         // Parse binary file.
         CompileOptions binOptions(cx);
         binOptions.setFileAndLine(binPath.begin(), 0);
 
@@ -208,101 +229,114 @@ runTestFromPath(JSContext* cx, const cha
         frontend::GlobalSharedContext globalsc(cx, ScopeKind::Global, directives, false);
 
         frontend::BinASTParser<Tok> binParser(cx, allocScope.alloc(), binUsedNames, binOptions);
 
         auto binParsed = binParser.parse(&globalsc, binSource); // Will be deallocated once `reader` goes out of scope.
         RootedValue binExn(cx);
         if (binParsed.isErr()) {
             // Save exception for more detailed error message, if necessary.
-            if (!js::GetAndClearException(cx, &binExn))
+            if (!js::GetAndClearException(cx, &binExn)) {
                 MOZ_CRASH("Couldn't clear binExn");
+            }
         }
 
         // The binary parser should accept the file iff the text parser has.
         if (binParsed.isOk() && !txtParsed) {
             fprintf(stderr, "Text file parsing failed: ");
 
             js::ErrorReport report(cx);
-            if (!report.init(cx, txtExn, js::ErrorReport::WithSideEffects))
+            if (!report.init(cx, txtExn, js::ErrorReport::WithSideEffects)) {
                 MOZ_CRASH("Couldn't report txtExn");
+            }
 
             PrintError(cx, stderr, report.toStringResult(), report.report(), /* reportWarnings */ true);
             MOZ_CRASH("Binary parser accepted a file that text parser rejected");
         }
 
         if (binParsed.isErr() && txtParsed) {
             fprintf(stderr, "Binary file parsing failed: ");
 
             js::ErrorReport report(cx);
-            if (!report.init(cx, binExn, js::ErrorReport::WithSideEffects))
+            if (!report.init(cx, binExn, js::ErrorReport::WithSideEffects)) {
                 MOZ_CRASH("Couldn't report binExn");
+            }
 
             PrintError(cx, stderr, report.toStringResult(), report.report(), /* reportWarnings */ true);
             MOZ_CRASH("Binary parser rejected a file that text parser accepted");
         }
 
         if (binParsed.isErr()) {
             fprintf(stderr, "Binary parser and text parser agree that %s is invalid\n", txtPath.begin());
             continue;
         }
 
 #if defined(DEBUG) // Dumping an AST is only defined in DEBUG builds
         // Compare ASTs.
         Sprinter binPrinter(cx);
-        if (!binPrinter.init())
+        if (!binPrinter.init()) {
             MOZ_CRASH("Couldn't display binParsed");
+        }
         DumpParseTree(binParsed.unwrap(), binPrinter);
 
         Sprinter txtPrinter(cx);
-        if (!txtPrinter.init())
+        if (!txtPrinter.init()) {
             MOZ_CRASH("Couldn't display txtParsed");
+        }
         DumpParseTree(txtParsed, txtPrinter);
 
         if (strcmp(binPrinter.string(), txtPrinter.string()) != 0) {
             fprintf(stderr, "Got distinct ASTs when parsing %s (%p/%p):\n\tBINARY\n%s\n\n\tTEXT\n%s\n",
                 txtPath.begin(),
                 (void*)binPrinter.getOffset(), (void*)txtPrinter.getOffset(),
                 binPrinter.string(), txtPrinter.string());
 #if 0 // Not for release, but useful for debugging.
       // In case of error, this dumps files to /tmp, so they may
       // easily be diffed.
             auto fd = open("/tmp/bin.ast", O_CREAT | O_TRUNC | O_WRONLY, 0666);
-            if (!fd)
+            if (!fd) {
                 MOZ_CRASH("Could not open bin.ast");
+            }
             auto result = write(fd, binPrinter.string(), binPrinter.stringEnd() - binPrinter.string());
-            if (result <= 0)
+            if (result <= 0) {
                 MOZ_CRASH("Could not write to bin.ast");
+            }
             result = close(fd);
-            if (result != 0)
+            if (result != 0) {
                 MOZ_CRASH("Could not close bin.ast");
+            }
 
             fd = open("/tmp/txt.ast", O_CREAT | O_TRUNC | O_WRONLY, 0666);
-            if (!fd)
+            if (!fd) {
                 MOZ_CRASH("Could not open txt.ast");
+            }
             result = write(fd, txtPrinter.string(), txtPrinter.stringEnd() - txtPrinter.string());
-            if (result <= 0)
+            if (result <= 0) {
                 MOZ_CRASH("Could not write to txt.ast");
+            }
             result = close(fd);
-            if (result != 0)
+            if (result != 0) {
                 MOZ_CRASH("Could not close txt.ast");
+            }
 #endif // 0
             MOZ_CRASH("Got distinct ASTs");
         }
 
         fprintf(stderr, "Got the same AST when parsing %s\n", txtPath.begin());
 #endif // defined(DEBUG)
     }
 
 #if defined(XP_WIN)
-    if (!FindClose(hFind))
+    if (!FindClose(hFind)) {
         MOZ_CRASH("Could not close Find");
+    }
 #elif defined(XP_UNIX)
-    if (closedir(dir) != 0)
+    if (closedir(dir) != 0) {
         MOZ_CRASH("Could not close dir");
+    }
 #endif // defined(XP_WIN)
 }
 
 BEGIN_TEST(testBinASTReaderSimpleECMAScript2)
 {
 #if defined(XP_WIN)
     runTestFromPath<js::frontend::BinTokenReaderTester>(cx, "jsapi-tests\\binast\\parser\\tester\\");
 #else
--- a/js/src/jsapi-tests/testBinTokenReaderTester.cpp
+++ b/js/src/jsapi-tests/testBinTokenReaderTester.cpp
@@ -40,89 +40,102 @@ static int gJsDirectory(0);
 void enterJsDirectory() {
 // Save current directory.
     MOZ_ASSERT(gJsDirectory == 0);
     gJsDirectory = open(".", O_RDONLY);
     MOZ_ASSERT(gJsDirectory != 0, "Could not open directory '.'");
 // Go to the directory provided by the test harness, if any.
     const char* destination = getenv("CPP_UNIT_TESTS_DIR_JS_SRC");
     if (destination) {
-        if (chdir(destination) == -1)
+        if (chdir(destination) == -1) {
             MOZ_CRASH_UNSAFE_PRINTF("Could not chdir to %s", destination);
+        }
     }
 }
 
 void exitJsDirectory() {
     MOZ_ASSERT(gJsDirectory);
-    if (fchdir(gJsDirectory) == -1)
+    if (fchdir(gJsDirectory) == -1) {
         MOZ_CRASH("Could not return to original directory");
-    if (close(gJsDirectory) != 0)
+    }
+    if (close(gJsDirectory) != 0) {
         MOZ_CRASH("Could not close js directory");
+    }
     gJsDirectory = 0;
 }
 
 #else
 
 char gJsDirectory[MAX_PATH] = { 0 };
 
 void enterJsDirectory() {
     // Save current directory.
     MOZ_ASSERT(strlen(gJsDirectory) == 0);
     auto result = GetCurrentDirectory(MAX_PATH, gJsDirectory);
-    if (result <= 0)
+    if (result <= 0) {
         MOZ_CRASH("Could not get current directory");
-    if (result > MAX_PATH)
+    }
+    if (result > MAX_PATH) {
         MOZ_CRASH_UNSAFE_PRINTF("Could not get current directory: needed %ld bytes, got %ld\n", result, MAX_PATH);
+    }
 
     // Find destination directory, if any.
     char destination[MAX_PATH];
     result = GetEnvironmentVariable("CPP_UNIT_TESTS_DIR_JS_SRC", destination, MAX_PATH);
     if (result == 0) {
-        if (GetLastError() == ERROR_ENVVAR_NOT_FOUND)
+        if (GetLastError() == ERROR_ENVVAR_NOT_FOUND) {
             return; // No need to chdir
-        else
+        } else {
             MOZ_CRASH("Could not get CPP_UNIT_TESTS_DIR_JS_SRC");
+        }
     }
     if (result > MAX_PATH) {
         MOZ_CRASH_UNSAFE_PRINTF("Could not get CPP_UNIT_TESTS_DIR_JS_SRC: needed %ld bytes, got %ld\n", result, MAX_PATH);
     }
 
     // Go to the directory.
-    if (SetCurrentDirectory(destination) == 0)
+    if (SetCurrentDirectory(destination) == 0) {
         MOZ_CRASH_UNSAFE_PRINTF("Could not chdir to %s", destination);
+    }
 }
 
 void exitJsDirectory() {
     MOZ_ASSERT(strlen(gJsDirectory) > 0);
-    if (SetCurrentDirectory(gJsDirectory) == 0)
+    if (SetCurrentDirectory(gJsDirectory) == 0) {
         MOZ_CRASH("Could not return to original directory");
+    }
     gJsDirectory[0] = 0;
 }
 
 #endif // defined(XP_UNIX) || defined(XP_WIN)
 
 void readFull(const char* path, js::Vector<uint8_t>& buf) {
     enterJsDirectory();
     buf.shrinkTo(0);
     FILE* in = fopen(path, "rb");
-    if (!in)
+    if (!in) {
         MOZ_CRASH_UNSAFE_PRINTF("Could not open %s: %s", path, strerror(errno));
+    }
 
     struct stat info;
-    if (stat(path, &info) < 0)
+    if (stat(path, &info) < 0) {
         MOZ_CRASH_UNSAFE_PRINTF("Could not get stat on %s", path);
+    }
 
-    if (!buf.growBy(info.st_size))
+    if (!buf.growBy(info.st_size)) {
         MOZ_CRASH("OOM");
+    }
 
     int result = fread(buf.begin(), 1, info.st_size, in);
-    if (fclose(in) != 0)
+    if (fclose(in) != 0) {
         MOZ_CRASH("Could not close input file");
-    if (result != info.st_size)
+    }
+    if (result != info.st_size) {
         MOZ_CRASH_UNSAFE_PRINTF("Read error while reading %s: expected %llu bytes, got %llu", path, (unsigned long long)info.st_size, (unsigned long long)result);
+    }
     exitJsDirectory();
 }
 
 
 // Reading a simple string.
 BEGIN_TEST(testBinTokenReaderTesterSimpleString)
 {
     js::Vector<uint8_t> contents(cx);
--- a/js/src/jsapi-tests/testBug604087.cpp
+++ b/js/src/jsapi-tests/testBug604087.cpp
@@ -16,18 +16,19 @@ const js::Class OuterWrapperClass = PROX
     "Proxy",
     JSCLASS_HAS_RESERVED_SLOTS(1) /* additional class flags */);
 
 static JSObject*
 wrap(JSContext* cx, JS::HandleObject toWrap, JS::HandleObject target)
 {
     JSAutoRealm ar(cx, target);
     JS::RootedObject wrapper(cx, toWrap);
-    if (!JS_WrapObject(cx, &wrapper))
+    if (!JS_WrapObject(cx, &wrapper)) {
         return nullptr;
+    }
     return wrapper;
 }
 
 static void
 PreWrap(JSContext* cx, JS::HandleObject scope, JS::HandleObject obj,
         JS::HandleObject objectPassedToWrap,
         JS::MutableHandleObject retObj)
 {
--- a/js/src/jsapi-tests/testCallArgs.cpp
+++ b/js/src/jsapi-tests/testCallArgs.cpp
@@ -49,18 +49,19 @@ static bool
 CustomConstructor(JSContext* cx, unsigned argc, JS::Value* vp)
 {
     JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
 
     MOZ_RELEASE_ASSERT(!JS_IsExceptionPending(cx));
 
     if (args.isConstructing()) {
         JSObject* obj = JS_NewPlainObject(cx);
-        if (!obj)
+        if (!obj) {
             return false;
+        }
 
         args.rval().setObject(*obj);
 
         MOZ_RELEASE_ASSERT(args.isConstructing());
     } else {
         args.rval().setUndefined();
 
         MOZ_RELEASE_ASSERT(!args.isConstructing());
--- a/js/src/jsapi-tests/testCompileNonSyntactic.cpp
+++ b/js/src/jsapi-tests/testCompileNonSyntactic.cpp
@@ -16,18 +16,19 @@ struct OffThreadTask
 {
     OffThreadTask()
       : monitor(js::mutexid::ShellOffThreadState),
         token(nullptr)
     {}
 
     OffThreadToken* waitUntilDone(JSContext* cx)
     {
-        if (OffThreadParsingMustWaitForGC(cx->runtime()))
+        if (OffThreadParsingMustWaitForGC(cx->runtime())) {
             js::gc::FinishGC(cx);
+        }
 
         AutoLockMonitor alm(monitor);
         while (!token) {
             alm.wait();
         }
         OffThreadToken* result = token;
         token = nullptr;
         return result;
--- a/js/src/jsapi-tests/testDateToLocaleString.cpp
+++ b/js/src/jsapi-tests/testDateToLocaleString.cpp
@@ -12,18 +12,19 @@ BEGIN_TEST(testDateToLocaleString)
 {
     JSRuntime* rt = JS_GetRuntime(cx);
 
     // This test should only attempt to run if we have Intl support: necessary
     // to properly assume that changes to the default locale will predictably
     // affect the behavior of the locale-sensitive Date methods tested here.
     JS::Rooted<JS::Value> haveIntl(cx);
     EVAL("typeof Intl !== 'undefined'", &haveIntl);
-    if (!haveIntl.toBoolean())
+    if (!haveIntl.toBoolean()) {
         return true;
+    }
 
     // Pervasive assumption: our Intl support includes "de" (German) and
     // "en" (English) and treats them differently for purposes of
     // Date.prototype.toLocale{,Date,Time}String behavior.
 
     // Start with German.
     CHECK(JS_SetDefaultLocale(rt, "de"));
 
--- a/js/src/jsapi-tests/testDefineProperty.cpp
+++ b/js/src/jsapi-tests/testDefineProperty.cpp
@@ -11,13 +11,14 @@ BEGIN_TEST(testDefineProperty_bug564344)
 {
     JS::RootedValue x(cx);
     EVAL("function f() {}\n"
          "var x = {p: f};\n"
          "x.p();  // brand x's scope\n"
          "x;", &x);
 
     JS::RootedObject obj(cx, x.toObjectOrNull());
-    for (int i = 0; i < 2; i++)
+    for (int i = 0; i < 2; i++) {
         CHECK(JS_DefineProperty(cx, obj, "q", JS::UndefinedHandleValue, 0));
+    }
     return true;
 }
 END_TEST(testDefineProperty_bug564344)
--- a/js/src/jsapi-tests/testDefinePropertyIgnoredAttributes.cpp
+++ b/js/src/jsapi-tests/testDefinePropertyIgnoredAttributes.cpp
@@ -18,26 +18,31 @@ Getter(JSContext* cx, unsigned argc, JS:
 enum PropertyDescriptorKind {
     DataDescriptor, AccessorDescriptor
 };
 
 static bool
 CheckDescriptor(JS::Handle<JS::PropertyDescriptor> desc, PropertyDescriptorKind kind,
                 bool enumerable, bool writable, bool configurable)
 {
-    if (!desc.object())
+    if (!desc.object()) {
         return false;
-    if (!(kind == DataDescriptor ? desc.isDataDescriptor() : desc.isAccessorDescriptor()))
+    }
+    if (!(kind == DataDescriptor ? desc.isDataDescriptor() : desc.isAccessorDescriptor())) {
+        return false;
+    }
+    if (desc.enumerable() != enumerable) {
         return false;
-    if (desc.enumerable() != enumerable)
+    }
+    if (kind == DataDescriptor && desc.writable() != writable) {
         return false;
-    if (kind == DataDescriptor && desc.writable() != writable)
+    }
+    if (desc.configurable() != configurable) {
         return false;
-    if (desc.configurable() != configurable)
-        return false;
+    }
     return true;
 }
 
 BEGIN_TEST(testDefinePropertyIgnoredAttributes)
 {
     JS::RootedObject obj(cx, JS_NewPlainObject(cx));
     JS::Rooted<JS::PropertyDescriptor> desc(cx);
     JS::RootedValue defineValue(cx);
--- a/js/src/jsapi-tests/testErrorInterceptor.cpp
+++ b/js/src/jsapi-tests/testErrorInterceptor.cpp
@@ -9,28 +9,31 @@
 
 namespace {
 static JS::PersistentRootedString gLatestMessage;
 
 // An interceptor that stores the error in `gLatestMessage`.
 struct SimpleInterceptor: JSErrorInterceptor {
     virtual void interceptError(JSContext* cx, const JS::Value& val) override {
         js::StringBuffer buffer(cx);
-        if (!ValueToStringBuffer(cx, val, buffer))
+        if (!ValueToStringBuffer(cx, val, buffer)) {
             MOZ_CRASH("Could not convert to string buffer");
+        }
         gLatestMessage = buffer.finishString();
-        if (!gLatestMessage)
+        if (!gLatestMessage) {
             MOZ_CRASH("Could not convert to string");
+        }
     }
 };
 
 bool equalStrings(JSContext* cx, JSString* a, JSString* b) {
     int32_t result = 0;
-    if (!JS_CompareStrings(cx, a, b, &result))
+    if (!JS_CompareStrings(cx, a, b, &result)) {
         MOZ_CRASH("Could not compare strings");
+    }
     return result == 0;
 }
 }
 
 BEGIN_TEST(testErrorInterceptor)
 {
     // Run the following snippets.
     const char* SAMPLES[] = {
@@ -61,18 +64,19 @@ BEGIN_TEST(testErrorInterceptor)
     JSErrorInterceptor* original = JS_GetErrorInterceptorCallback(cx->runtime());
     gLatestMessage.init(cx);
 
     // Test without callback.
     JS_SetErrorInterceptorCallback(cx->runtime(), nullptr);
     CHECK(gLatestMessage == nullptr);
 
     for (auto sample: SAMPLES) {
-        if (execDontReport(sample, __FILE__, __LINE__))
+        if (execDontReport(sample, __FILE__, __LINE__)) {
             MOZ_CRASH("This sample should have failed");
+        }
         CHECK(JS_IsExceptionPending(cx));
         CHECK(gLatestMessage == nullptr);
         JS_ClearPendingException(cx);
     }
 
     // Test with callback.
     SimpleInterceptor simpleInterceptor;
     JS_SetErrorInterceptorCallback(cx->runtime(), &simpleInterceptor);
@@ -82,18 +86,19 @@ BEGIN_TEST(testErrorInterceptor)
 
     // This shouldn't cause any error.
     EXEC("function bar() {}");
     CHECK(gLatestMessage == nullptr);
 
     // Test error throwing with a callback that succeeds.
     for (size_t i = 0; i < mozilla::ArrayLength(SAMPLES); ++i) {
         // This should cause the appropriate error.
-        if (execDontReport(SAMPLES[i], __FILE__, __LINE__))
+        if (execDontReport(SAMPLES[i], __FILE__, __LINE__)) {
             MOZ_CRASH("This sample should have failed");
+        }
         CHECK(JS_IsExceptionPending(cx));
 
         // Check result of callback.
         CHECK(gLatestMessage != nullptr);
         CHECK(js::StringEqualsAscii(&gLatestMessage->asLinear(), TO_STRING[i]));
 
         // Check the final error.
         JS::RootedValue exn(cx);
@@ -107,18 +112,19 @@ BEGIN_TEST(testErrorInterceptor)
 
         // Cleanup.
         gLatestMessage = nullptr;
     }
 
     // Test again without callback.
     JS_SetErrorInterceptorCallback(cx->runtime(), nullptr);
     for (size_t i = 0; i < mozilla::ArrayLength(SAMPLES); ++i) {
-        if (execDontReport(SAMPLES[i], __FILE__, __LINE__))
+        if (execDontReport(SAMPLES[i], __FILE__, __LINE__)) {
             MOZ_CRASH("This sample should have failed");
+        }
         CHECK(JS_IsExceptionPending(cx));
 
         // Check that the callback wasn't called.
         CHECK(gLatestMessage == nullptr);
 
         // Check the final error.
         JS::RootedValue exn(cx);
         CHECK(JS_GetPendingException(cx, &exn));
--- a/js/src/jsapi-tests/testExecuteInJSMEnvironment.cpp
+++ b/js/src/jsapi-tests/testExecuteInJSMEnvironment.cpp
@@ -56,18 +56,19 @@ BEGIN_TEST(testExecuteInJSMEnvironment_B
     return true;
 }
 END_TEST(testExecuteInJSMEnvironment_Basic);
 
 static bool
 test_callback(JSContext* cx, unsigned argc, JS::Value* vp)
 {
     JS::RootedObject env(cx, js::GetJSMEnvironmentOfScriptedCaller(cx));
-    if (!env)
+    if (!env) {
         return false;
+    }
 
     JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
     args.rval().setObject(*env);
     return true;
 }
 
 static const JSFunctionSpec testFunctions[] = {
     JS_FN("callback", test_callback, 0, 0),
--- a/js/src/jsapi-tests/testFindSCCs.cpp
+++ b/js/src/jsapi-tests/testFindSCCs.cpp
@@ -34,18 +34,19 @@ struct TestComponentFinder : public Comp
 };
 
 static TestNode Vertex[MaxVertices];
 
 void
 TestNode::findOutgoingEdges(TestComponentFinder& finder)
 {
     for (unsigned i = 0; i < MaxVertices; ++i) {
-        if (hasEdge[i])
+        if (hasEdge[i]) {
             finder.addEdgeTo(&Vertex[i]);
+        }
     }
 }
 
 BEGIN_TEST(testFindSCCs)
 {
     // no vertices
 
     setup(0);
@@ -153,18 +154,19 @@ void setup(unsigned count)
 void edge(unsigned src_index, unsigned dest_index)
 {
     Vertex[src_index].hasEdge[dest_index] = true;
 }
 
 void run()
 {
     finder = new TestComponentFinder(cx->nativeStackLimit[JS::StackForSystemCode]);
-    for (unsigned i = 0; i < vertex_count; ++i)
+    for (unsigned i = 0; i < vertex_count; ++i) {
         finder->addNode(&Vertex[i]);
+    }
     resultsList = finder->getResultsList();
 }
 
 bool group(int vertex, ...)
 {
     TestNode* v = resultsList;
 
     va_list ap;
@@ -226,18 +228,19 @@ struct TestComponentFinder2 : public Com
     explicit TestComponentFinder2(uintptr_t sl)
       : ComponentFinder<TestNode2, TestComponentFinder2>(sl)
     {}
 };
 
 void
 TestNode2::findOutgoingEdges(TestComponentFinder2& finder)
 {
-    if (edge)
+    if (edge) {
         finder.addEdgeTo(edge);
+    }
 }
 
 BEGIN_TEST(testFindSCCsStackLimit)
 {
     /*
      * Test what happens if recusion causes the stack to become full while
      * traversing the graph.
      *
@@ -248,22 +251,24 @@ BEGIN_TEST(testFindSCCsStackLimit)
      * Such an arrangement with no cycles would normally result in one group for
      * each vertex, but since the stack is exhasted in processing a single group
      * is returned containing all the vertices.
      */
     const unsigned max = 1000000;
     const unsigned initial = 10;
 
     TestNode2* vertices = new TestNode2[max]();
-    for (unsigned i = initial; i < (max - 10); ++i)
+    for (unsigned i = initial; i < (max - 10); ++i) {
         vertices[i].edge = &vertices[i + 1];
+    }
 
     TestComponentFinder2 finder(cx->nativeStackLimit[JS::StackForSystemCode]);
-    for (unsigned i = 0; i < max; ++i)
+    for (unsigned i = 0; i < max; ++i) {
         finder.addNode(&vertices[i]);
+    }
 
     TestNode2* r = finder.getResultsList();
     CHECK(r);
     TestNode2* v = r;
 
     unsigned count = 0;
     while (v) {
         ++count;
--- a/js/src/jsapi-tests/testFreshGlobalEvalRedefinition.cpp
+++ b/js/src/jsapi-tests/testFreshGlobalEvalRedefinition.cpp
@@ -26,18 +26,19 @@ BEGIN_TEST(testRedefineGlobalEval)
     static const JSClass cls = {
         "global", JSCLASS_GLOBAL_FLAGS,
         &clsOps
     };
 
     /* Create the global object. */
     JS::RealmOptions options;
     JS::Rooted<JSObject*> g(cx, JS_NewGlobalObject(cx, &cls, nullptr, JS::FireOnNewGlobalHook, options));
-    if (!g)
+    if (!g) {
         return false;
+    }
 
     JSAutoRealm ar(cx, g);
     JS::Rooted<JS::Value> v(cx);
     CHECK(JS_GetProperty(cx, g, "Object", &v));
 
     static const char data[] = "Object.defineProperty(this, 'eval', { configurable: false });";
     JS::CompileOptions opts(cx);
     CHECK(JS::Evaluate(cx, opts.setFileAndLine(__FILE__, __LINE__),
--- a/js/src/jsapi-tests/testGCAllocator.cpp
+++ b/js/src/jsapi-tests/testGCAllocator.cpp
@@ -48,18 +48,19 @@ BEGIN_TEST(testGCAllocator)
 #endif
 
     /* Finish any ongoing background free activity. */
     js::gc::FinishGC(cx);
 
     bool growUp;
     CHECK(addressesGrowUp(&growUp));
 
-    if (growUp)
+    if (growUp) {
         return testGCAllocatorUp(PageSize);
+    }
     return testGCAllocatorDown(PageSize);
 }
 
 static const size_t Chunk = 512 * 1024;
 static const size_t Alignment = 2 * Chunk;
 static const int MaxTempChunks = 4096;
 static const size_t StagingSize = 16 * Chunk;
 
@@ -79,24 +80,26 @@ addressesGrowUp(bool* resultOut)
         chunks[i] = mapMemory(2 * Chunk);
         CHECK(chunks[i]);
     }
 
     int upCount = 0;
     int downCount = 0;
 
     for (unsigned i = 0; i < ChunksToTest - 1; i++) {
-        if (chunks[i] < chunks[i + 1])
+        if (chunks[i] < chunks[i + 1]) {
             upCount++;
-        else
+        } else {
             downCount++;
+        }
     }
 
-    for (unsigned i = 0; i < ChunksToTest; i++)
+    for (unsigned i = 0; i < ChunksToTest; i++) {
         unmapPages(chunks[i], 2 * Chunk);
+    }
 
     /* Check results were mostly consistent. */
     CHECK(abs(upCount - downCount) >= ThresholdCount);
 
     *resultOut = upCount > downCount;
 
     return true;
 }
@@ -114,30 +117,32 @@ enum AllocType {
 
 bool
 testGCAllocatorUp(const size_t PageSize)
 {
     const size_t UnalignedSize = StagingSize + Alignment - PageSize;
     void* chunkPool[MaxTempChunks];
     // Allocate a contiguous chunk that we can partition for testing.
     void* stagingArea = mapMemory(UnalignedSize);
-    if (!stagingArea)
+    if (!stagingArea) {
         return false;
+    }
     // Ensure that the staging area is aligned.
     unmapPages(stagingArea, UnalignedSize);
     if (offsetFromAligned(stagingArea)) {
         const size_t Offset = offsetFromAligned(stagingArea);
         // Place the area at the lowest aligned address.
         stagingArea = (void*)(uintptr_t(stagingArea) + (Alignment - Offset));
     }
     mapMemoryAt(stagingArea, StagingSize);
     // Make sure there are no available chunks below the staging area.
     int tempChunks;
-    if (!fillSpaceBeforeStagingArea(tempChunks, stagingArea, chunkPool, false))
+    if (!fillSpaceBeforeStagingArea(tempChunks, stagingArea, chunkPool, false)) {
         return false;
+    }
     // Unmap the staging area so we can set it up for testing.
     unmapPages(stagingArea, StagingSize);
     // Check that the first chunk is used if it is aligned.
     CHECK(positionIsCorrect("xxooxxx---------", stagingArea, chunkPool, tempChunks));
     // Check that the first chunk is used if it can be aligned.
     CHECK(positionIsCorrect("x-ooxxx---------", stagingArea, chunkPool, tempChunks));
     // Check that an aligned chunk after a single unalignable chunk is used.
     CHECK(positionIsCorrect("x--xooxxx-------", stagingArea, chunkPool, tempChunks));
@@ -151,43 +156,46 @@ testGCAllocatorUp(const size_t PageSize)
     // Check that we also fall back after an unalignable and an alignable chunk.
     CHECK(positionIsCorrect("x--xx---x-oo--x-", stagingArea, chunkPool, tempChunks));
 #endif
     // Check that the last ditch allocator works as expected.
     CHECK(positionIsCorrect("x--xx--xx-oox---", stagingArea, chunkPool, tempChunks,
                             UseLastDitchAllocator));
 
     // Clean up.
-    while (--tempChunks >= 0)
+    while (--tempChunks >= 0) {
         unmapPages(chunkPool[tempChunks], 2 * Chunk);
+    }
     return true;
 }
 
 bool
 testGCAllocatorDown(const size_t PageSize)
 {
     const size_t UnalignedSize = StagingSize + Alignment - PageSize;
     void* chunkPool[MaxTempChunks];
     // Allocate a contiguous chunk that we can partition for testing.
     void* stagingArea = mapMemory(UnalignedSize);
-    if (!stagingArea)
+    if (!stagingArea) {
         return false;
+    }
     // Ensure that the staging area is aligned.
     unmapPages(stagingArea, UnalignedSize);
     if (offsetFromAligned(stagingArea)) {
         void* stagingEnd = (void*)(uintptr_t(stagingArea) + UnalignedSize);
         const size_t Offset = offsetFromAligned(stagingEnd);
         // Place the area at the highest aligned address.
         stagingArea = (void*)(uintptr_t(stagingEnd) - Offset - StagingSize);
     }
     mapMemoryAt(stagingArea, StagingSize);
     // Make sure there are no available chunks above the staging area.
     int tempChunks;
-    if (!fillSpaceBeforeStagingArea(tempChunks, stagingArea, chunkPool, true))
+    if (!fillSpaceBeforeStagingArea(tempChunks, stagingArea, chunkPool, true)) {
         return false;
+    }
     // Unmap the staging area so we can set it up for testing.
     unmapPages(stagingArea, StagingSize);
     // Check that the first chunk is used if it is aligned.
     CHECK(positionIsCorrect("---------xxxooxx", stagingArea, chunkPool, tempChunks));
     // Check that the first chunk is used if it can be aligned.
     CHECK(positionIsCorrect("---------xxxoo-x", stagingArea, chunkPool, tempChunks));
     // Check that an aligned chunk after a single unalignable chunk is used.
     CHECK(positionIsCorrect("-------xxxoox--x", stagingArea, chunkPool, tempChunks));
@@ -195,47 +203,51 @@ testGCAllocatorDown(const size_t PageSiz
     CHECK(positionIsCorrect("-xxx--oox--xx--x", stagingArea, chunkPool, tempChunks));
     // Check that we also fall back after an unalignable and an alignable chunk.
     CHECK(positionIsCorrect("-x--oo-x---xx--x", stagingArea, chunkPool, tempChunks));
     // Check that the last ditch allocator works as expected.
     CHECK(positionIsCorrect("---xoo-xx--xx--x", stagingArea, chunkPool, tempChunks,
                             UseLastDitchAllocator));
 
     // Clean up.
-    while (--tempChunks >= 0)
+    while (--tempChunks >= 0) {
         unmapPages(chunkPool[tempChunks], 2 * Chunk);
+    }
     return true;
 }
 
 bool
 fillSpaceBeforeStagingArea(int& tempChunks, void* stagingArea,
                            void** chunkPool, bool addressesGrowDown)
 {
     // Make sure there are no available chunks before the staging area.
     tempChunks = 0;
     chunkPool[tempChunks++] = mapMemory(2 * Chunk);
     while (tempChunks < MaxTempChunks && chunkPool[tempChunks - 1] &&
            (chunkPool[tempChunks - 1] < stagingArea) ^ addressesGrowDown) {
         chunkPool[tempChunks++] = mapMemory(2 * Chunk);
-        if (!chunkPool[tempChunks - 1])
+        if (!chunkPool[tempChunks - 1]) {
             break; // We already have our staging area, so OOM here is okay.
-        if ((chunkPool[tempChunks - 1] < chunkPool[tempChunks - 2]) ^ addressesGrowDown)
+        }
+        if ((chunkPool[tempChunks - 1] < chunkPool[tempChunks - 2]) ^ addressesGrowDown) {
             break; // The address growth direction is inconsistent!
+        }
     }
     // OOM also means success in this case.
     if (!chunkPool[tempChunks - 1]) {
         --tempChunks;
         return true;
     }
     // Bail if we can't guarantee the right address space layout.
     if ((chunkPool[tempChunks - 1] < stagingArea) ^ addressesGrowDown || (tempChunks > 1 &&
             (chunkPool[tempChunks - 1] < chunkPool[tempChunks - 2]) ^ addressesGrowDown))
     {
-        while (--tempChunks >= 0)
+        while (--tempChunks >= 0) {
             unmapPages(chunkPool[tempChunks], 2 * Chunk);
+        }
         unmapPages(stagingArea, StagingSize);
         return false;
     }
     return true;
 }
 
 bool
 positionIsCorrect(const char* str, void* base, void** chunkPool, int tempChunks,
@@ -250,36 +262,41 @@ positionIsCorrect(const char* str, void*
     // large enough to hold strlen(str) chunks of Chunk bytes.
     int len = strlen(str);
     int i;
     // Find the index of the desired address.
     for (i = 0; i < len && str[i] != 'o'; ++i);
     void* desired = (void*)(uintptr_t(base) + i * Chunk);
     // Map the regions indicated by str.
     for (i = 0; i < len; ++i) {
-        if (str[i] == 'x')
+        if (str[i] == 'x') {
             mapMemoryAt((void*)(uintptr_t(base) +  i * Chunk), Chunk);
+        }
     }
     // Allocate using the GC's allocator.
     void* result;
-    if (allocator == UseNormalAllocator)
+    if (allocator == UseNormalAllocator) {
         result = js::gc::MapAlignedPages(2 * Chunk, Alignment);
-    else
+    } else {
         result = js::gc::TestMapAlignedPagesLastDitch(2 * Chunk, Alignment);
+    }
     // Clean up the mapped regions.
-    if (result)
+    if (result) {
         js::gc::UnmapPages(result, 2 * Chunk);
+    }
     for (--i; i >= 0; --i) {
-        if (str[i] == 'x')
+        if (str[i] == 'x') {
             js::gc::UnmapPages((void*)(uintptr_t(base) +  i * Chunk), Chunk);
+        }
     }
     // CHECK returns, so clean up on failure.
     if (result != desired) {
-        while (--tempChunks >= 0)
+        while (--tempChunks >= 0) {
             js::gc::UnmapPages(chunkPool[tempChunks], 2 * Chunk);
+        }
     }
     return result == desired;
 }
 
 #if defined(XP_WIN)
 #  if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
 
 void*
@@ -319,41 +336,45 @@ void*
 mapMemoryAt(void* desired, size_t length)
 {
 
 #if defined(__ia64__) || defined(__aarch64__) || \
     (defined(__sparc__) && defined(__arch64__) && (defined(__NetBSD__) || defined(__linux__)))
     MOZ_RELEASE_ASSERT((0xffff800000000000ULL & (uintptr_t(desired) + length - 1)) == 0);
 #endif
     void* region = mmap(desired, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
-    if (region == MAP_FAILED)
+    if (region == MAP_FAILED) {
         return nullptr;
+    }
     if (region != desired) {
-        if (munmap(region, length))
+        if (munmap(region, length)) {
             MOZ_RELEASE_ASSERT(errno == ENOMEM);
+        }
         return nullptr;
     }
     return region;
 }
 
 void*
 mapMemory(size_t length)
 {
     int prot = PROT_READ | PROT_WRITE;
     int flags = MAP_PRIVATE | MAP_ANON;
     int fd = -1;
     off_t offset = 0;
     // The test code must be aligned with the implementation in gc/Memory.cpp.
 #if defined(__ia64__) || (defined(__sparc__) && defined(__arch64__) && defined(__NetBSD__))
     void* region = mmap((void*)0x0000070000000000, length, prot, flags, fd, offset);
-    if (region == MAP_FAILED)
+    if (region == MAP_FAILED) {
         return nullptr;
+    }
     if ((uintptr_t(region) + (length - 1)) & 0xffff800000000000) {
-        if (munmap(region, length))
+        if (munmap(region, length)) {
             MOZ_RELEASE_ASSERT(errno == ENOMEM);
+        }
         return nullptr;
     }
     return region;
 #elif defined(__aarch64__) || (defined(__sparc__) && defined(__arch64__) && defined(__linux__))
     const uintptr_t start = UINT64_C(0x0000070000000000);
     const uintptr_t end   = UINT64_C(0x0000800000000000);
     const uintptr_t step  = js::gc::ChunkSize;
     uintptr_t hint;
@@ -367,25 +388,27 @@ mapMemory(size_t length)
                 }
                 region = MAP_FAILED;
             }
         }
     }
     return region == MAP_FAILED ? nullptr : region;
 #else
     void* region = mmap(nullptr, length, prot, flags, fd, offset);
-    if (region == MAP_FAILED)
+    if (region == MAP_FAILED) {
         return nullptr;
+    }
     return region;
 #endif
 }
 
 void
 unmapPages(void* p, size_t size)
 {
-    if (munmap(p, size))
+    if (munmap(p, size)) {
         MOZ_RELEASE_ASSERT(errno == ENOMEM);
+    }
 }
 
 #else // !defined(XP_WIN) && !defined(SOLARIS) && !defined(XP_UNIX)
 #error "Memory mapping functions are not defined for your OS."
 #endif
 END_TEST(testGCAllocator)
--- a/js/src/jsapi-tests/testGCChunkPool.cpp
+++ b/js/src/jsapi-tests/testGCChunkPool.cpp
@@ -22,18 +22,19 @@ BEGIN_TEST(testGCChunkPool)
         js::gc::Chunk* chunk = js::gc::Chunk::allocate(cx->runtime());
         CHECK(chunk);
         pool.push(chunk);
     }
     MOZ_ASSERT(pool.verify());
 
     // Iterate.
     uint32_t i = 0;
-    for (js::gc::ChunkPool::Iter iter(pool); !iter.done(); iter.next(), ++i)
+    for (js::gc::ChunkPool::Iter iter(pool); !iter.done(); iter.next(), ++i) {
         CHECK(iter.get());
+    }
     CHECK(i == pool.count());
     MOZ_ASSERT(pool.verify());
 
     // Push/Pop.
     for (int i = 0; i < N; ++i) {
         js::gc::Chunk* chunkA = pool.pop();
         js::gc::Chunk* chunkB = pool.pop();
         js::gc::Chunk* chunkC = pool.pop();
--- a/js/src/jsapi-tests/testGCExactRooting.cpp
+++ b/js/src/jsapi-tests/testGCExactRooting.cpp
@@ -177,31 +177,34 @@ FillMyHashMap(JSContext* cx, MutableHand
     for (size_t i = 0; i < 10; ++i) {
         RootedObject obj(cx, JS_NewObject(cx, nullptr));
         RootedValue val(cx, UndefinedValue());
         // Construct a unique property name to ensure that the object creates a
         // new shape.
         char buffer[2];
         buffer[0] = 'a' + i;
         buffer[1] = '\0';
-        if (!JS_SetProperty(cx, obj, buffer, val))
+        if (!JS_SetProperty(cx, obj, buffer, val)) {
             return false;
-        if (!map.putNew(obj->as<NativeObject>().lastProperty(), obj))
+        }
+        if (!map.putNew(obj->as<NativeObject>().lastProperty(), obj)) {
             return false;
+        }
     }
     return true;
 }
 
 static bool
 CheckMyHashMap(JSContext* cx, Handle<MyHashMap> map)
 {
     for (auto r = map.all(); !r.empty(); r.popFront()) {
         RootedObject obj(cx, r.front().value());
-        if (obj->as<NativeObject>().lastProperty() != r.front().key())
+        if (obj->as<NativeObject>().lastProperty() != r.front().key()) {
             return false;
+        }
     }
     return true;
 }
 
 BEGIN_TEST(testGCHandleHashMap)
 {
     JS::Rooted<MyHashMap> map(cx, MyHashMap(cx, 15));
 
@@ -243,52 +246,56 @@ BEGIN_TEST(testGCRootedVector)
         buffer[0] = 'a' + i;
         buffer[1] = '\0';
         bool match;
         CHECK(JS_StringEqualsAscii(cx, JSID_TO_STRING(shapes[i]->propid()), buffer, &match));
         CHECK(match);
     }
 
     // Ensure iterator enumeration works through the rooted.
-    for (auto shape : shapes)
+    for (auto shape : shapes) {
         CHECK(shape);
+    }
 
     CHECK(receiveConstRefToShapeVector(shapes));
 
     // Ensure rooted converts to handles.
     CHECK(receiveHandleToShapeVector(shapes));
     CHECK(receiveMutableHandleToShapeVector(&shapes));
 
     return true;
 }
 
 bool
 receiveConstRefToShapeVector(const JS::Rooted<GCVector<Shape*>>& rooted)
 {
     // Ensure range enumeration works through the reference.
-    for (auto shape : rooted)
+    for (auto shape : rooted) {
         CHECK(shape);
+    }
     return true;
 }
 
 bool
 receiveHandleToShapeVector(JS::Handle<GCVector<Shape*>> handle)
 {
     // Ensure range enumeration works through the handle.
-    for (auto shape : handle)
+    for (auto shape : handle) {
         CHECK(shape);
+    }
     return true;
 }
 
 bool
 receiveMutableHandleToShapeVector(JS::MutableHandle<GCVector<Shape*>> handle)
 {
     // Ensure range enumeration works through the handle.
-    for (auto shape : handle)
+    for (auto shape : handle) {
         CHECK(shape);
+    }
     return true;
 }
 END_TEST(testGCRootedVector)
 
 BEGIN_TEST(testTraceableFifo)
 {
     using ShapeFifo = TraceableFifo<Shape*>;
     JS::Rooted<ShapeFifo> shapes(cx, ShapeFifo(cx));
@@ -335,50 +342,56 @@ FillVector(JSContext* cx, MutableHandle<
     for (size_t i = 0; i < 10; ++i) {
         RootedObject obj(cx, JS_NewObject(cx, nullptr));
         RootedValue val(cx, UndefinedValue());
         // Construct a unique property name to ensure that the object creates a
         // new shape.
         char buffer[2];
         buffer[0] = 'a' + i;
         buffer[1] = '\0';
-        if (!JS_SetProperty(cx, obj, buffer, val))
+        if (!JS_SetProperty(cx, obj, buffer, val)) {
             return false;
-        if (!shapes.append(obj->as<NativeObject>().lastProperty()))
+        }
+        if (!shapes.append(obj->as<NativeObject>().lastProperty())) {
             return false;
+        }
     }
 
     // Ensure iterator enumeration works through the mutable handle.
     for (auto shape : shapes) {
-        if (!shape)
+        if (!shape) {
             return false;
+        }
     }
 
     return true;
 }
 
 static bool
 CheckVector(JSContext* cx, Handle<ShapeVec> shapes)
 {
     for (size_t i = 0; i < 10; ++i) {
         // Check the shape to ensure it did not get collected.
         char buffer[2];
         buffer[0] = 'a' + i;
         buffer[1] = '\0';
         bool match;
-        if (!JS_StringEqualsAscii(cx, JSID_TO_STRING(shapes[i]->propid()), buffer, &match))
+        if (!JS_StringEqualsAscii(cx, JSID_TO_STRING(shapes[i]->propid()), buffer, &match)) {
             return false;
-        if (!match)
+        }
+        if (!match) {
             return false;
+        }
     }
 
     // Ensure iterator enumeration works through the handle.
     for (auto shape : shapes) {
-        if (!shape)
+        if (!shape) {
             return false;
+        }
     }
 
     return true;
 }
 
 BEGIN_TEST(testGCHandleVector)
 {
     JS::Rooted<ShapeVec> vec(cx, ShapeVec(cx));
--- a/js/src/jsapi-tests/testGCFinalizeCallback.cpp
+++ b/js/src/jsapi-tests/testGCFinalizeCallback.cpp
@@ -103,18 +103,19 @@ BEGIN_TEST(testGCFinalizeCallback)
     js::SliceBudget budget(js::WorkBudget(1));
     cx->runtime()->gc.startDebugGC(GC_NORMAL, budget);
     CHECK(cx->runtime()->gc.state() == js::gc::State::Mark);
     CHECK(cx->runtime()->gc.isFullGc());
 
     JS::RootedObject global4(cx, createTestGlobal());
     budget = js::SliceBudget(js::WorkBudget(1));
     cx->runtime()->gc.debugGCSlice(budget);
-    while (cx->runtime()->gc.isIncrementalGCInProgress())
+    while (cx->runtime()->gc.isIncrementalGCInProgress()) {
         cx->runtime()->gc.debugGCSlice(budget);
+    }
     CHECK(!cx->runtime()->gc.isIncrementalGCInProgress());
     CHECK(checkSingleGroup());
     CHECK(checkFinalizeStatus());
 
     JS_SetGCZeal(cx, 0, 0);
 
 #endif
 
@@ -133,18 +134,19 @@ BEGIN_TEST(testGCFinalizeCallback)
 JSObject* createTestGlobal()
 {
     JS::RealmOptions options;
     return JS_NewGlobalObject(cx, getGlobalClass(), nullptr, JS::FireOnNewGlobalHook, options);
 }
 
 virtual bool init() override
 {
-    if (!JSAPITest::init())
+    if (!JSAPITest::init()) {
         return false;
+    }
 
     JS_AddFinalizeCallback(cx, FinalizeCallback, nullptr);
     return true;
 }
 
 virtual void uninit() override
 {
     JS_RemoveFinalizeCallback(cx, FinalizeCallback);
@@ -183,13 +185,14 @@ bool checkFinalizeStatus()
     CHECK(StatusBuffer[FinalizeCalls - 1] == JSFINALIZE_COLLECTION_END);
 
     return true;
 }
 
 static void
 FinalizeCallback(JSFreeOp* fop, JSFinalizeStatus status, void* data)
 {
-    if (FinalizeCalls < BufferSize)
+    if (FinalizeCalls < BufferSize) {
         StatusBuffer[FinalizeCalls] = status;
+    }
     ++FinalizeCalls;
 }
 END_TEST(testGCFinalizeCallback)
--- a/js/src/jsapi-tests/testGCGrayMarking.cpp
+++ b/js/src/jsapi-tests/testGCGrayMarking.cpp
@@ -564,31 +564,35 @@ struct ColorCheckFunctor
 
     ColorCheckFunctor(MarkColor colorArg, size_t* countArg)
       : color(colorArg), count(*countArg)
     {
         count = 0;
     }
 
     bool operator()(JSObject* obj) {
-        if (!CheckCellColor(obj, color))
+        if (!CheckCellColor(obj, color)) {
             return false;
+        }
 
         NativeObject& nobj = obj->as<NativeObject>();
-        if (!CheckCellColor(nobj.shape(), color))
+        if (!CheckCellColor(nobj.shape(), color)) {
             return false;
+        }
 
         Shape* shape = nobj.shape();
-        if (!CheckCellColor(shape, color))
+        if (!CheckCellColor(shape, color)) {
             return false;
+        }
 
         // Shapes and symbols are never marked gray.
         jsid id = shape->propid();
-        if (JSID_IS_GCTHING(id) && !CheckCellColor(JSID_TO_GCTHING(id).asCell(), MarkColor::Black))
+        if (JSID_IS_GCTHING(id) && !CheckCellColor(JSID_TO_GCTHING(id).asCell(), MarkColor::Black)) {
             return false;
+        }
 
         count++;
         return true;
     }
 };
 
 JS::PersistentRootedObject global1;
 JS::PersistentRootedObject global2;
@@ -600,18 +604,19 @@ struct GrayRoots
 };
 
 GrayRoots grayRoots;
 
 bool
 InitGlobals()
 {
     global1.init(cx, global);
-    if (!createGlobal())
+    if (!createGlobal()) {
         return false;
+    }
     global2.init(cx, global);
     return global2 != nullptr;
 }
 
 void
 InitGrayRootTracer()
 {
     grayRoots.grayRoot1 = nullptr;
@@ -644,37 +649,40 @@ AllocPlainObject()
     MOZ_ASSERT(obj->compartment() == global1->compartment());
     return obj;
 }
 
 JSObject*
 AllocSameCompartmentSourceObject(JSObject* target)
 {
     JS::RootedObject source(cx, JS_NewPlainObject(cx));
-    if (!source)
+    if (!source) {
         return nullptr;
+    }
 
     JS::RootedObject obj(cx, target);
-    if (!JS_DefineProperty(cx, source, "ptr", obj, 0))
+    if (!JS_DefineProperty(cx, source, "ptr", obj, 0)) {
         return nullptr;
+    }
 
     EvictNursery();
 
     MOZ_ASSERT(source->compartment() == global1->compartment());
     return source;
 }
 
 JSObject*
 GetCrossCompartmentWrapper(JSObject* target)
 {
     MOZ_ASSERT(target->compartment() == global1->compartment());
     JS::RootedObject obj(cx, target);
     JSAutoRealm ar(cx, global2);
-    if (!JS_WrapObject(cx, &obj))
+    if (!JS_WrapObject(cx, &obj)) {
         return nullptr;
+    }
 
     EvictNursery();
 
     MOZ_ASSERT(obj->compartment() == global2->compartment());
     return obj;
 }
 
 static JSObject*
@@ -695,18 +703,19 @@ AllocWeakmapKeyObject()
         JSCLASS_HAS_PRIVATE,
         JS_NULL_CLASS_OPS,
         JS_NULL_CLASS_SPEC,
         &KeyClassExtension,
         JS_NULL_OBJECT_OPS
     };
 
     JS::RootedObject key(cx, JS_NewObject(cx, Jsvalify(&KeyClass)));
-    if (!key)
+    if (!key) {
         return nullptr;
+    }
 
     EvictNursery();
     return key;
 }
 
 JSObject*
 AllocDelegateForKey(JSObject* key)
 {
@@ -721,39 +730,43 @@ JSObject*
 AllocObjectChain(size_t length)
 {
     // Allocate a chain of linked JSObjects.
 
     // Use a unique property name so the shape is not shared with any other
     // objects.
     RootedString nextPropName(cx, JS_NewStringCopyZ(cx, "unique14142135"));
     RootedId nextId(cx);
-    if (!JS_StringToId(cx, nextPropName, &nextId))
+    if (!JS_StringToId(cx, nextPropName, &nextId)) {
         return nullptr;
+    }
 
     RootedObject head(cx);
     for (size_t i = 0; i < length; i++) {
         RootedValue next(cx, ObjectOrNullValue(head));
         head = AllocPlainObject();
-        if (!head)
+        if (!head) {
             return nullptr;
-        if (!JS_DefinePropertyById(cx, head, nextId, next, 0))
+        }
+        if (!JS_DefinePropertyById(cx, head, nextId, next, 0)) {
             return nullptr;
+        }
     }
 
     return head;
 }
 
 template <typename F>
 bool IterateObjectChain(JSObject* chain, F f)
 {
     RootedObject obj(cx, chain);
     while (obj) {
-        if (!f(obj))
+        if (!f(obj)) {
             return false;
+        }
 
         // Access the 'next' property via the object's slots to avoid triggering
         // gray marking assertions when calling JS_GetPropertyById.
         NativeObject& nobj = obj->as<NativeObject>();
         MOZ_ASSERT(nobj.slotSpan() == 1);
         obj = nobj.getSlot(0).toObjectOrNull();
     }
 
--- a/js/src/jsapi-tests/testGCHeapPostBarriers.cpp
+++ b/js/src/jsapi-tests/testGCHeapPostBarriers.cpp
@@ -47,18 +47,19 @@ static T* CreateGCThing(JSContext* cx)
     MOZ_CRASH();
     return nullptr;
 }
 
 template <>
 JSObject* CreateGCThing(JSContext* cx)
 {
     JS::RootedObject obj(cx, JS_NewPlainObject(cx));
-    if (!obj)
+    if (!obj) {
         return nullptr;
+    }
     JS_DefineProperty(cx, obj, "x", 42, 0);
     return obj;
 }
 
 template <>
 JSFunction* CreateGCThing(JSContext* cx)
 {
     /*
--- a/js/src/jsapi-tests/testGCMarking.cpp
+++ b/js/src/jsapi-tests/testGCMarking.cpp
@@ -75,18 +75,19 @@ class CCWTestTracer : public JS::Callbac
         numberOfThingsTraced++;
 
         printf("*thingp         = %p\n", thing.asCell());
         printf("*expectedThingp = %p\n", *expectedThingp);
 
         printf("kind         = %d\n", static_cast<int>(thing.kind()));
         printf("expectedKind = %d\n", static_cast<int>(expectedKind));
 
-        if (thing.asCell() != *expectedThingp || thing.kind() != expectedKind)
+        if (thing.asCell() != *expectedThingp || thing.kind() != expectedKind) {
             okay = false;
+        }
     }
 
   public:
     bool          okay;
     size_t        numberOfThingsTraced;
     void**        expectedThingp;
     JS::TraceKind expectedKind;
 
@@ -133,18 +134,19 @@ BEGIN_TEST(testTracingIncomingCCWs)
     return true;
 }
 END_TEST(testTracingIncomingCCWs)
 
 static size_t
 countWrappers(JS::Compartment* comp)
 {
     size_t count = 0;
-    for (JS::Compartment::WrapperEnum e(comp); !e.empty(); e.popFront())
+    for (JS::Compartment::WrapperEnum e(comp); !e.empty(); e.popFront()) {
         ++count;
+    }
     return count;
 }
 
 BEGIN_TEST(testDeadNurseryCCW)
 {
 #ifdef JS_GC_ZEAL
     // Disable zeal modes because this test needs to control exactly when the GC happens.
     JS_SetGCZeal(cx, 0, 100);
@@ -289,48 +291,54 @@ BEGIN_TEST(testIncrementalRoots)
     //
     //   leaf = {};
     //   leaf2 = {};
     //   root = { 'obj': { 'obj': ... { 'obj': leaf, 'leaf2': leaf2 } ... } }
     //
     // with leafOwner the object that has the 'obj' and 'leaf2' properties.
 
     JS::RootedObject obj(cx, JS_NewObject(cx, nullptr));
-    if (!obj)
+    if (!obj) {
         return false;
+    }
 
     JS::RootedObject root(cx, obj);
 
     JS::RootedObject leaf(cx);
     JS::RootedObject leafOwner(cx);
 
     for (size_t i = 0; i < 3000; i++) {
         JS::RootedObject subobj(cx, JS_NewObject(cx, nullptr));
-        if (!subobj)
+        if (!subobj) {
             return false;
-        if (!JS_DefineProperty(cx, obj, "obj", subobj, 0))
+        }
+        if (!JS_DefineProperty(cx, obj, "obj", subobj, 0)) {
             return false;
+        }
         leafOwner = obj;
         obj = subobj;
         leaf = subobj;
     }
 
     // Give the leaf owner a second leaf.
     {
         JS::RootedObject leaf2(cx, JS_NewObject(cx, nullptr));
-        if (!leaf2)
+        if (!leaf2) {
             return false;
-        if (!JS_DefineProperty(cx, leafOwner, "leaf2", leaf2, 0))
+        }
+        if (!JS_DefineProperty(cx, leafOwner, "leaf2", leaf2, 0)) {
             return false;
+        }
     }
 
     // This is marked during markRuntime
     JS::AutoObjectVector vec(cx);
-    if (!vec.append(root))
+    if (!vec.append(root)) {
         return false;
+    }
 
     // Tenure everything so intentionally unrooted objects don't move before we
     // can use them.
     cx->runtime()->gc.minorGC(JS::gcreason::API);
 
     // Release all roots except for the AutoObjectVector.
     obj = root = nullptr;
 
@@ -375,48 +383,53 @@ BEGIN_TEST(testIncrementalRoots)
     // between operations.
     auto currentGCNumber = rt->gc.gcNumber();
 #endif
 
     // Now do the incremental GC's worst nightmare: rip an unmarked object
     // 'leaf' out of the graph and stick it into an already-marked region (hang
     // it off the un-prebarriered root, in fact). The pre-barrier on the
     // overwrite of the source location should cause this object to be marked.
-    if (!JS_SetProperty(cx, leafOwnerHandle, "obj", JS::UndefinedHandleValue))
+    if (!JS_SetProperty(cx, leafOwnerHandle, "obj", JS::UndefinedHandleValue)) {
         return false;
+    }
     MOZ_ASSERT(rt->gc.gcNumber() == currentGCNumber);
-    if (!JS_SetProperty(cx, vec[0], "newobj", leafValueHandle))
+    if (!JS_SetProperty(cx, vec[0], "newobj", leafValueHandle)) {
         return false;
+    }
     MOZ_ASSERT(rt->gc.gcNumber() == currentGCNumber);
     MOZ_ASSERT(leafHandle->asTenured().isMarkedBlack());
 
     // Also take an unmarked object 'leaf2' from the graph and add an
     // additional edge from the root to it. This will not be marked by any
     // pre-barrier, but it is still in the live graph so it will eventually get
     // marked.
     //
     // Note that the root->leaf2 edge will *not* be marked through, since the
     // root is already marked, but that only matters if doing a compacting GC
     // and the compacting GC repeats the whole marking phase to update
     // pointers.
     {
         JS::RootedValue leaf2(cx);
-        if (!JS_GetProperty(cx, leafOwnerHandle, "leaf2", &leaf2))
+        if (!JS_GetProperty(cx, leafOwnerHandle, "leaf2", &leaf2)) {
             return false;
+        }
         MOZ_ASSERT(rt->gc.gcNumber() == currentGCNumber);
         MOZ_ASSERT(!leaf2.toObject().asTenured().isMarkedBlack());
-        if (!JS_SetProperty(cx, vec[0], "leafcopy", leaf2))
+        if (!JS_SetProperty(cx, vec[0], "leafcopy", leaf2)) {
             return false;
+        }
         MOZ_ASSERT(rt->gc.gcNumber() == currentGCNumber);
         MOZ_ASSERT(!leaf2.toObject().asTenured().isMarkedBlack());
     }
 
     // Finish the GC using an unlimited budget.
     auto unlimited = js::SliceBudget::unlimited();
     rt->gc.debugGCSlice(unlimited);
 
     // Access the leaf object to try to trigger a crash if it is dead.
-    if (!JS_SetProperty(cx, leafHandle, "toes", JS::UndefinedHandleValue))
+    if (!JS_SetProperty(cx, leafHandle, "toes", JS::UndefinedHandleValue)) {
         return false;
+    }
 
     return true;
 }
 END_TEST(testIncrementalRoots)
--- a/js/src/jsapi-tests/testGCOutOfMemory.cpp
+++ b/js/src/jsapi-tests/testGCOutOfMemory.cpp
@@ -52,18 +52,19 @@ virtual JSContext* createContext() overr
     // Note that the max nursery size must be less than the whole heap size, or
     // the test will fail because 'max' (the number of allocations required for
     // OOM) will be based on the nursery size, and that will overflow the
     // tenured heap, which will cause the second pass with max/4 allocations to
     // OOM. (Actually, this only happens with nursery zeal, because normally
     // the nursery will start out with only a single chunk before triggering a
     // major GC.)
     JSContext* cx = JS_NewContext(1024 * 1024, 128 * 1024);
-    if (!cx)
+    if (!cx) {
         return nullptr;
+    }
     setNativeStackQuota(cx);
     return cx;
 }
 
 virtual void destroyContext() override {
     JS_DestroyContext(cx);
 }
 
--- a/js/src/jsapi-tests/testGCUniqueId.cpp
+++ b/js/src/jsapi-tests/testGCUniqueId.cpp
@@ -92,18 +92,19 @@ BEGIN_TEST(testGCUID)
     }
 
     // Transfer our vector to tenured if it isn't there already.
     MinimizeHeap(cx);
 
     // Tear holes in the heap by unrooting the even objects and collecting.
     JS::Rooted<ObjectVector> vec2(cx, ObjectVector(cx));
     for (size_t i = 0; i < N; ++i) {
-        if (i % 2 == 1)
+        if (i % 2 == 1) {
             CHECK(vec2.append(vec[i]));
+        }
     }
     vec.clear();
     MinimizeHeap(cx);
 
     // Grab the last object in the vector as our object of interest.
     obj = vec2.back();
     CHECK(obj);
     tenuredAddr = uintptr_t(obj.get());
--- a/js/src/jsapi-tests/testGCWeakCache.cpp
+++ b/js/src/jsapi-tests/testGCWeakCache.cpp
@@ -679,26 +679,28 @@ TestUniqueIDLookups()
     Cache cache(JS::GetObjectZone(global), cx);
 
     Rooted<GCVector<JSObject*, 0, SystemAllocPolicy>> liveObjects(cx);
 
     for (size_t j = 0; j < ObjectCount; j++) {
         JSObject* obj = JS_NewPlainObject(cx);
         CHECK(obj);
         CHECK(cache.put(obj));
-        if (j % DeadFactor == 0)
+        if (j % DeadFactor == 0) {
             CHECK(liveObjects.get().append(obj));
+        }
     }
 
     CHECK(cache.count() == ObjectCount);
 
     CHECK(GCUntilCacheSweep(cx, cache));
 
-    for (size_t j = 0; j < liveObjects.length(); j++)
+    for (size_t j = 0; j < liveObjects.length(); j++) {
         CHECK(cache.has(liveObjects[j]));
+    }
 
     CHECK(SweepCacheAndFinishGC(cx, cache));
 
     CHECK(cache.count() == liveObjects.length());
 
     return true;
 }
 
--- a/js/src/jsapi-tests/testHashTable.cpp
+++ b/js/src/jsapi-tests/testHashTable.cpp
@@ -26,37 +26,40 @@ const size_t TestSize = 10000;
 const size_t TestIterations = 10;
 #endif
 
 JS_STATIC_ASSERT(TestSize <= 0x0000FFFF / 2);
 
 struct LowToHigh
 {
     static uint32_t rekey(uint32_t initial) {
-        if (initial > uint32_t(0x0000FFFF))
+        if (initial > uint32_t(0x0000FFFF)) {
             return initial;
+        }
         return initial << 16;
     }
 
     static bool shouldBeRemoved(uint32_t initial) {
         return false;
     }
 };
 
 struct LowToHighWithRemoval
 {
     static uint32_t rekey(uint32_t initial) {
-        if (initial > uint32_t(0x0000FFFF))
+        if (initial > uint32_t(0x0000FFFF)) {
             return initial;
+        }
         return initial << 16;
     }
 
     static bool shouldBeRemoved(uint32_t initial) {
-        if (initial >= 0x00010000)
+        if (initial >= 0x00010000) {
             return (initial >> 16) % 2 == 0;
+        }
         return initial % 2 == 0;
     }
 };
 
 static bool
 MapsAreEqual(IntMap& am, IntMap& bm)
 {
     bool equal = true;
@@ -105,88 +108,100 @@ SetsAreEqual(IntSet& am, IntSet& bm)
 static bool
 AddLowKeys(IntMap* am, IntMap* bm, int seed)
 {
     size_t i = 0;
     srand(seed);
     while (i < TestSize) {
         uint32_t n = rand() & 0x0000FFFF;
         if (!am->has(n)) {
-            if (bm->has(n))
+            if (bm->has(n)) {
                 return false;
+            }
 
-            if (!am->putNew(n, n) || !bm->putNew(n, n))
+            if (!am->putNew(n, n) || !bm->putNew(n, n)) {
                 return false;
+            }
             i++;
         }
     }
     return true;
 }
 
 static bool
 AddLowKeys(IntSet* as, IntSet* bs, int seed)
 {
     size_t i = 0;
     srand(seed);
     while (i < TestSize) {
         uint32_t n = rand() & 0x0000FFFF;
         if (!as->has(n)) {
-            if (bs->has(n))
+            if (bs->has(n)) {
                 return false;
-            if (!as->putNew(n) || !bs->putNew(n))
+            }
+            if (!as->putNew(n) || !bs->putNew(n)) {
                 return false;
+            }
             i++;
         }
     }
     return true;
 }
 
 template <class NewKeyFunction>
 static bool
 SlowRekey(IntMap* m) {
     IntMap tmp;
 
     for (auto iter = m->iter(); !iter.done(); iter.next()) {
-        if (NewKeyFunction::shouldBeRemoved(iter.get().key()))
+        if (NewKeyFunction::shouldBeRemoved(iter.get().key())) {
             continue;
+        }
         uint32_t hi = NewKeyFunction::rekey(iter.get().key());
-        if (tmp.has(hi))
+        if (tmp.has(hi)) {
             return false;
-        if (!tmp.putNew(hi, iter.get().value()))
+        }
+        if (!tmp.putNew(hi, iter.get().value())) {
             return false;
+        }
     }
 
     m->clear();
     for (auto iter = tmp.iter(); !iter.done(); iter.next()) {
-        if (!m->putNew(iter.get().key(), iter.get().value()))
+        if (!m->putNew(iter.get().key(), iter.get().value())) {
             return false;
+        }
     }
 
     return true;
 }
 
 template <class NewKeyFunction>
 static bool
 SlowRekey(IntSet* s) {
     IntSet tmp;
 
     for (auto iter = s->iter(); !iter.done(); iter.next()) {
-        if (NewKeyFunction::shouldBeRemoved(iter.get()))
+        if (NewKeyFunction::shouldBeRemoved(iter.get())) {
             continue;
+        }
         uint32_t hi = NewKeyFunction::rekey(iter.get());
-        if (tmp.has(hi))
+        if (tmp.has(hi)) {
             return false;
-        if (!tmp.putNew(hi))
+        }
+        if (!tmp.putNew(hi)) {
             return false;
+        }
     }
 
     s->clear();
     for (auto iter = tmp.iter(); !iter.done(); iter.next()) {
-        if (!s->putNew(iter.get()))
+        if (!s->putNew(iter.get())) {
             return false;
+        }
     }
 
     return true;
 }
 
 BEGIN_TEST(testHashRekeyManual)
 {
     IntMap am, bm;
@@ -194,18 +209,19 @@ BEGIN_TEST(testHashRekeyManual)
 #ifdef FUZZ
         fprintf(stderr, "map1: %lu\n", i);
 #endif
         CHECK(AddLowKeys(&am, &bm, i));
         CHECK(MapsAreEqual(am, bm));
 
         for (auto iter = am.modIter(); !iter.done(); iter.next()) {
             uint32_t tmp = LowToHigh::rekey(iter.get().key());
-            if (tmp != iter.get().key())
+            if (tmp != iter.get().key()) {
                 iter.rekey(tmp);
+            }
         }
         CHECK(SlowRekey<LowToHigh>(&bm));
 
         CHECK(MapsAreEqual(am, bm));
         am.clear();
         bm.clear();
     }
 
@@ -214,18 +230,19 @@ BEGIN_TEST(testHashRekeyManual)
 #ifdef FUZZ
         fprintf(stderr, "set1: %lu\n", i);
 #endif
         CHECK(AddLowKeys(&as, &bs, i));
         CHECK(SetsAreEqual(as, bs));
 
         for (auto iter = as.modIter(); !iter.done(); iter.next()) {
             uint32_t tmp = LowToHigh::rekey(iter.get());
-            if (tmp != iter.get())
+            if (tmp != iter.get()) {
                 iter.rekey(tmp);
+            }
         }
         CHECK(SlowRekey<LowToHigh>(&bs));
 
         CHECK(SetsAreEqual(as, bs));
         as.clear();
         bs.clear();
     }
 
@@ -243,18 +260,19 @@ BEGIN_TEST(testHashRekeyManualRemoval)
         CHECK(AddLowKeys(&am, &bm, i));
         CHECK(MapsAreEqual(am, bm));
 
         for (auto iter = am.modIter(); !iter.done(); iter.next()) {
             if (LowToHighWithRemoval::shouldBeRemoved(iter.get().key())) {
                 iter.remove();
             } else {
                 uint32_t tmp = LowToHighWithRemoval::rekey(iter.get().key());
-                if (tmp != iter.get().key())
+                if (tmp != iter.get().key()) {
                     iter.rekey(tmp);
+                }
             }
         }
         CHECK(SlowRekey<LowToHighWithRemoval>(&bm));
 
         CHECK(MapsAreEqual(am, bm));
         am.clear();
         bm.clear();
     }
@@ -267,18 +285,19 @@ BEGIN_TEST(testHashRekeyManualRemoval)
         CHECK(AddLowKeys(&as, &bs, i));
         CHECK(SetsAreEqual(as, bs));
 
         for (auto iter = as.modIter(); !iter.done(); iter.next()) {
             if (LowToHighWithRemoval::shouldBeRemoved(iter.get())) {
                 iter.remove();
             } else {
                 uint32_t tmp = LowToHighWithRemoval::rekey(iter.get());
-                if (tmp != iter.get())
+                if (tmp != iter.get()) {
                     iter.rekey(tmp);
+                }
             }
         }
         CHECK(SlowRekey<LowToHighWithRemoval>(&bs));
 
         CHECK(SetsAreEqual(as, bs));
         as.clear();
         bs.clear();
     }
@@ -345,18 +364,19 @@ GrowUntilResize()
     IntMap m;
 
     // Add entries until we've resized the table four times.
     size_t lastCapacity = m.capacity();
     size_t resizes = 0;
     uint32_t key = 0;
     while (resizes < 4) {
         auto p = m.lookupForAdd(key);
-        if (!p && !m.add(p, key, 0))
+        if (!p && !m.add(p, key, 0)) {
             return false;   // OOM'd in lookupForAdd() or add()
+        }
 
         size_t capacity = m.capacity();
         if (capacity != lastCapacity) {
             resizes++;
             lastCapacity = capacity;
         }
         key++;
     }
@@ -381,18 +401,19 @@ END_TEST(testHashMapGrowOOM)
 
 BEGIN_TEST(testHashTableMovableModIterator)
 {
     IntSet set;
 
     // Exercise returning a hash table ModIterator object from a function.
 
     CHECK(set.put(1));
-    for (auto iter = setModIter(set); !iter.done(); iter.next())
+    for (auto iter = setModIter(set); !iter.done(); iter.next()) {
         iter.remove();
+    }
     CHECK(set.count() == 0);
 
     // Test moving an ModIterator object explicitly.
 
     CHECK(set.put(1));
     CHECK(set.put(2));
     CHECK(set.put(3));
     CHECK(set.count() == 3);
--- a/js/src/jsapi-tests/testIndexToString.cpp
+++ b/js/src/jsapi-tests/testIndexToString.cpp
@@ -50,18 +50,19 @@ static const struct TestPair {
 
 BEGIN_TEST(testIndexToString)
 {
     for (size_t i = 0, sz = ArrayLength(tests); i < sz; i++) {
         uint32_t u = tests[i].num;
         JSString* str = js::IndexToString(cx, u);
         CHECK(str);
 
-        if (!js::StaticStrings::hasUint(u))
+        if (!js::StaticStrings::hasUint(u)) {
             CHECK(cx->realm()->dtoaCache.lookup(10, u) == str);
+        }
 
         bool match = false;
         CHECK(JS_StringEqualsAscii(cx, str, tests[i].expected, &match));
         CHECK(match);
     }
 
     return true;
 }
--- a/js/src/jsapi-tests/testIntern.cpp
+++ b/js/src/jsapi-tests/testIntern.cpp
@@ -37,12 +37,13 @@ BEGIN_TEST(testPinAcrossGC)
     JS_GC(cx);
     CHECK(sw.strOk);
     return true;
 }
 
 static void
 FinalizeCallback(JSFreeOp* fop, JSFinalizeStatus status, void* data)
 {
-    if (status == JSFINALIZE_GROUP_START)
+    if (status == JSFINALIZE_GROUP_START) {
         sw.strOk = js::gc::IsMarkedUnbarriered(fop->runtime(), &sw.str);
+    }
 }
 END_TEST(testPinAcrossGC)
--- a/js/src/jsapi-tests/testIntlAvailableLocales.cpp
+++ b/js/src/jsapi-tests/testIntlAvailableLocales.cpp
@@ -10,18 +10,19 @@
 
 BEGIN_TEST(testIntlAvailableLocales)
 {
     JSRuntime* rt = JS_GetRuntime(cx);
 
     // This test should only attempt to run if we have Intl support.
     JS::Rooted<JS::Value> haveIntl(cx);
     EVAL("typeof Intl !== 'undefined'", &haveIntl);
-    if (!haveIntl.toBoolean())
+    if (!haveIntl.toBoolean()) {
         return true;
+    }
 
     // Assumption: our Intl support always includes "de" (German) support,
     // and our Intl support *does not* natively support de-ZA-ghijk.  :-)
     CHECK(JS_SetDefaultLocale(rt, "de-ZA-abcde-x-private"));
 
     EXEC("if (Intl.Collator().resolvedOptions().locale !== 'de-ZA-abcde-x-private') \n"
          "    throw 'unexpected default locale';");
     EXEC("var used = Intl.Collator('de-ZA-abcde').resolvedOptions().locale; \n"
--- a/js/src/jsapi-tests/testJitDCEinGVN.cpp
+++ b/js/src/jsapi-tests/testJitDCEinGVN.cpp
@@ -23,27 +23,30 @@ BEGIN_TEST(testJitDCEinGVN_ins)
 
     // mul0 = p * p
     // mul1 = mul0 * mul0
     // return p
     MParameter* p = func.createParameter();
     block->add(p);
     MMul* mul0 = MMul::New(func.alloc, p, p, MIRType::Double);
     block->add(mul0);
-    if (!mul0->typePolicy()->adjustInputs(func.alloc, mul0))
+    if (!mul0->typePolicy()->adjustInputs(func.alloc, mul0)) {
         return false;
+    }
     MMul* mul1 = MMul::New(func.alloc, mul0, mul0, MIRType::Double);
     block->add(mul1);
-    if (!mul1->typePolicy()->adjustInputs(func.alloc, mul1))
+    if (!mul1->typePolicy()->adjustInputs(func.alloc, mul1)) {
         return false;
+    }
     MReturn* ret = MReturn::New(func.alloc, p);
     block->end(ret);
 
-    if (!func.runGVN())
+    if (!func.runGVN()) {
         return false;
+    }
 
     // mul0 and mul1 should be deleted.
     for (MInstructionIterator ins = block->begin(); ins != block->end(); ins++) {
         CHECK(!ins->isMul() || (ins->getOperand(0) != p && ins->getOperand(1) != p));
         CHECK(!ins->isMul() || (ins->getOperand(0) != mul0 && ins->getOperand(1) != mul0));
     }
     return true;
 }
@@ -126,18 +129,19 @@ BEGIN_TEST(testJitDCEinGVN_phi)
     // return y
     joinBlock->addPhi(x);
     joinBlock->addPhi(y);
     MMul* z = MMul::New(func.alloc, x, y, MIRType::Double);
     joinBlock->add(z);
     MReturn* ret = MReturn::New(func.alloc, y);
     joinBlock->end(ret);
 
-    if (!func.runGVN())
+    if (!func.runGVN()) {
         return false;
+    }
 
     // c1 should be deleted.
     for (MInstructionIterator ins = block->begin(); ins != block->end(); ins++) {
         CHECK(!ins->isConstant() || (ins->toConstant()->numberToDouble() != 1.0));
     }
     return true;
 }
 END_TEST(testJitDCEinGVN_phi)
--- a/js/src/jsapi-tests/testJitFoldsTo.cpp
+++ b/js/src/jsapi-tests/testJitFoldsTo.cpp
@@ -23,24 +23,26 @@ BEGIN_TEST(testJitFoldsTo_DivReciprocal)
 
     // return p / 4.0
     MParameter* p = func.createParameter();
     block->add(p);
     MConstant* c = MConstant::New(func.alloc, DoubleValue(4.0));
     block->add(c);
     MDiv* div = MDiv::New(func.alloc, p, c, MIRType::Double);
     block->add(div);
-    if (!div->typePolicy()->adjustInputs(func.alloc, div))
+    if (!div->typePolicy()->adjustInputs(func.alloc, div)) {
         return false;
+    }
     MDefinition* left = div->getOperand(0);
     MReturn* ret = MReturn::New(func.alloc, div);
     block->end(ret);
 
-    if (!func.runGVN())
+    if (!func.runGVN()) {
         return false;
+    }
 
     // Test that the div got folded to p * 0.25.
     MDefinition* op = ret->getOperand(0);
     CHECK(op->isMul());
     CHECK(op->getOperand(0) == left);
     CHECK(op->getOperand(1)->isConstant());
     CHECK(op->getOperand(1)->toConstant()->numberToDouble() == 0.25);
     return true;
@@ -54,25 +56,27 @@ BEGIN_TEST(testJitFoldsTo_NoDivReciproca
 
     // return p / 5.0
     MParameter* p = func.createParameter();
     block->add(p);
     MConstant* c = MConstant::New(func.alloc, DoubleValue(5.0));
     block->add(c);
     MDiv* div = MDiv::New(func.alloc, p, c, MIRType::Double);
     block->add(div);
-    if (!div->typePolicy()->adjustInputs(func.alloc, div))
+    if (!div->typePolicy()->adjustInputs(func.alloc, div)) {
         return false;
+    }
     MDefinition* left = div->getOperand(0);
     MDefinition* right = div->getOperand(1);
     MReturn* ret = MReturn::New(func.alloc, div);
     block->end(ret);
 
-    if (!func.runGVN())
+    if (!func.runGVN()) {
         return false;
+    }
 
     // Test that the div didn't get folded.
     MDefinition* op = ret->getOperand(0);
     CHECK(op->isDiv());
     CHECK(op->getOperand(0) == left);
     CHECK(op->getOperand(1) == right);
     return true;
 }
@@ -88,18 +92,19 @@ BEGIN_TEST(testJitNotNot)
     block->add(p);
     MNot* not0 = MNot::New(func.alloc, p);
     block->add(not0);
     MNot* not1 = MNot::New(func.alloc, not0);
     block->add(not1);
     MReturn* ret = MReturn::New(func.alloc, not1);
     block->end(ret);
 
-    if (!func.runGVN())
+    if (!func.runGVN()) {
         return false;
+    }
 
     // Test that the nots did not get folded.
     MDefinition* op = ret->getOperand(0);
     CHECK(op->isNot());
     CHECK(op->getOperand(0)->isNot());
     CHECK(op->getOperand(0)->getOperand(0) == p);
     return true;
 }
@@ -117,18 +122,19 @@ BEGIN_TEST(testJitNotNotNot)
     block->add(not0);
     MNot* not1 = MNot::New(func.alloc, not0);
     block->add(not1);
     MNot* not2 = MNot::New(func.alloc, not1);
     block->add(not2);
     MReturn* ret = MReturn::New(func.alloc, not2);
     block->end(ret);
 
-    if (!func.runGVN())
+    if (!func.runGVN()) {
         return false;
+    }
 
     // Test that the nots got folded.
     MDefinition* op = ret->getOperand(0);
     CHECK(op->isNot());
     CHECK(op->getOperand(0) == p);
     return true;
 }
 END_TEST(testJitNotNotNot)
@@ -153,18 +159,19 @@ BEGIN_TEST(testJitNotTest)
 
     else_->end(MGoto::New(func.alloc, exit));
 
     MReturn* ret = MReturn::New(func.alloc, p);
     exit->end(ret);
 
     MOZ_ALWAYS_TRUE(exit->addPredecessorWithoutPhis(then));
 
-    if (!func.runGVN())
+    if (!func.runGVN()) {
         return false;
+    }
 
     // Test that the not got folded.
     test = block->lastIns()->toTest();
     CHECK(test->getOperand(0) == p);
     CHECK(test->getSuccessor(0) == else_);
     CHECK(test->getSuccessor(1) == then);
     return true;
 }
@@ -192,18 +199,19 @@ BEGIN_TEST(testJitNotNotTest)
 
     else_->end(MGoto::New(func.alloc, exit));
 
     MReturn* ret = MReturn::New(func.alloc, p);
     exit->end(ret);
 
     MOZ_ALWAYS_TRUE(exit->addPredecessorWithoutPhis(then));
 
-    if (!func.runGVN())
+    if (!func.runGVN()) {
         return false;
+    }
 
     // Test that the nots got folded.
     test = block->lastIns()->toTest();
     CHECK(test->getOperand(0) == p);
     CHECK(test->getSuccessor(0) == then);
     CHECK(test->getSuccessor(1) == else_);
     return true;
 }
@@ -219,18 +227,19 @@ BEGIN_TEST(testJitFoldsTo_UnsignedDiv)
     block->add(c0);
     MConstant* c1 = MConstant::New(func.alloc, Int32Value(0xffffffff));
     block->add(c1);
     MDiv* div = MDiv::New(func.alloc, c0, c1, MIRType::Int32, /*unsignd=*/true);
     block->add(div);
     MReturn* ret = MReturn::New(func.alloc, div);
     block->end(ret);
 
-    if (!func.runGVN())
+    if (!func.runGVN()) {
         return false;
+    }
 
     // Test that the div got folded to 0.
     MConstant* op = ret->getOperand(0)->toConstant();
     CHECK(mozilla::NumbersAreIdentical(op->numberToDouble(), 0.0));
     return true;
 }
 END_TEST(testJitFoldsTo_UnsignedDiv)
 
@@ -244,17 +253,18 @@ BEGIN_TEST(testJitFoldsTo_UnsignedMod)
     block->add(c0);
     MConstant* c1 = MConstant::New(func.alloc, Int32Value(0xffffffff));
     block->add(c1);
     MMod* mod = MMod::New(func.alloc, c0, c1, MIRType::Int32, /*unsignd=*/true);
     block->add(mod);
     MReturn* ret = MReturn::New(func.alloc, mod);
     block->end(ret);
 
-    if (!func.runGVN())
+    if (!func.runGVN()) {
         return false;
+    }
 
     // Test that the mod got folded to 1.
     MConstant* op = ret->getOperand(0)->toConstant();
     CHECK(mozilla::NumbersAreIdentical(op->numberToDouble(), 1.0));
     return true;
 }
 END_TEST(testJitFoldsTo_UnsignedMod)
--- a/js/src/jsapi-tests/testJitGVN.cpp
+++ b/js/src/jsapi-tests/testJitGVN.cpp
@@ -15,18 +15,19 @@
 #include "jsapi-tests/tests.h"
 
 using namespace js;
 using namespace js::jit;
 
 static MBasicBlock*
 FollowTrivialGotos(MBasicBlock* block)
 {
-    while (block->phisEmpty() && *block->begin() == block->lastIns() && block->lastIns()->isGoto())
+    while (block->phisEmpty() && *block->begin() == block->lastIns() && block->lastIns()->isGoto()) {
         block = block->lastIns()->toGoto()->getSuccessor(0);
+    }
     return block;
 }
 
 BEGIN_TEST(testJitGVN_FixupOSROnlyLoop)
 {
     // This is a testcase which constructs the very rare circumstances that
     // require the FixupOSROnlyLoop logic.
 
@@ -71,33 +72,35 @@ BEGIN_TEST(testJitGVN_FixupOSROnlyLoop)
     MOZ_ALWAYS_TRUE(innerHeader->addPredecessorWithoutPhis(innerBackedge));
     MOZ_ALWAYS_TRUE(outerHeader->addPredecessorWithoutPhis(outerBackedge));
     MOZ_ALWAYS_TRUE(exit->addPredecessorWithoutPhis(entry));
     MOZ_ALWAYS_TRUE(merge->addPredecessorWithoutPhis(osrEntry));
 
     outerHeader->setLoopHeader(outerBackedge);
     innerHeader->setLoopHeader(innerBackedge);
 
-    if (!func.runGVN())
+    if (!func.runGVN()) {
         return false;
+    }
 
     // The loops are no longer reachable from the normal entry. They are
     // doinated by the osrEntry.
     MOZ_RELEASE_ASSERT(func.graph.osrBlock() == osrEntry);
     MBasicBlock* newInner = FollowTrivialGotos(osrEntry->lastIns()->toGoto()->target());
     MBasicBlock* newOuter = FollowTrivialGotos(newInner->lastIns()->toTest()->ifFalse());
     MBasicBlock* newExit = FollowTrivialGotos(entry);
     MOZ_RELEASE_ASSERT(newInner->isLoopHeader());
     MOZ_RELEASE_ASSERT(newOuter->isLoopHeader());
     MOZ_RELEASE_ASSERT(newExit->lastIns()->isReturn());
 
     // One more time.
     ClearDominatorTree(func.graph);
-    if (!func.runGVN())
+    if (!func.runGVN()) {
         return false;
+    }
 
     // The loops are no longer reachable from the normal entry. They are
     // doinated by the osrEntry.
     MOZ_RELEASE_ASSERT(func.graph.osrBlock() == osrEntry);
     newInner = FollowTrivialGotos(osrEntry->lastIns()->toGoto()->target());
     newOuter = FollowTrivialGotos(newInner->lastIns()->toTest()->ifFalse());
     newExit = FollowTrivialGotos(entry);
     MOZ_RELEASE_ASSERT(newInner->isLoopHeader());
@@ -165,35 +168,37 @@ BEGIN_TEST(testJitGVN_FixupOSROnlyLoopNe
     MOZ_ALWAYS_TRUE(outerHeader->addPredecessorWithoutPhis(outerBackedge));
     MOZ_ALWAYS_TRUE(exit->addPredecessorWithoutPhis(entry));
     MOZ_ALWAYS_TRUE(merge->addPredecessorWithoutPhis(osrEntry));
 
     outerHeader->setLoopHeader(outerBackedge);
     middleHeader->setLoopHeader(middleBackedge);
     innerHeader->setLoopHeader(innerBackedge);
 
-    if (!func.runGVN())
+    if (!func.runGVN()) {
         return false;
+    }
 
     // The loops are no longer reachable from the normal entry. They are
     // doinated by the osrEntry.
     MOZ_RELEASE_ASSERT(func.graph.osrBlock() == osrEntry);
     MBasicBlock* newInner = FollowTrivialGotos(osrEntry->lastIns()->toGoto()->target());
     MBasicBlock* newMiddle = FollowTrivialGotos(newInner->lastIns()->toTest()->ifFalse());
     MBasicBlock* newOuter = FollowTrivialGotos(newMiddle->lastIns()->toTest()->ifFalse());
     MBasicBlock* newExit = FollowTrivialGotos(entry);
     MOZ_RELEASE_ASSERT(newInner->isLoopHeader());
     MOZ_RELEASE_ASSERT(newMiddle->isLoopHeader());
     MOZ_RELEASE_ASSERT(newOuter->isLoopHeader());
     MOZ_RELEASE_ASSERT(newExit->lastIns()->isReturn());
 
     // One more time.
     ClearDominatorTree(func.graph);
-    if (!func.runGVN())
+    if (!func.runGVN()) {
         return false;
+    }
 
     // The loops are no longer reachable from the normal entry. They are
     // doinated by the osrEntry.
     MOZ_RELEASE_ASSERT(func.graph.osrBlock() == osrEntry);
     newInner = FollowTrivialGotos(osrEntry->lastIns()->toGoto()->target());
     newMiddle = FollowTrivialGotos(newInner->lastIns()->toTest()->ifFalse());
     newOuter = FollowTrivialGotos(newMiddle->lastIns()->toTest()->ifFalse());
     newExit = FollowTrivialGotos(entry);
@@ -270,17 +275,18 @@ BEGIN_TEST(testJitGVN_PinnedPhis)
     exit->end(MGoto::New(func.alloc, outerHeader));
 
     MOZ_ALWAYS_TRUE(innerHeader->addPredecessorWithoutPhis(innerBackedge));
     MOZ_ALWAYS_TRUE(outerHeader->addPredecessorWithoutPhis(exit));
 
     outerHeader->setLoopHeader(exit);
     innerHeader->setLoopHeader(innerBackedge);
 
-    if (!func.runGVN())
+    if (!func.runGVN()) {
         return false;
+    }
 
     MOZ_RELEASE_ASSERT(innerHeader->phisEmpty());
     MOZ_RELEASE_ASSERT(exit->isDead());
 
     return true;
 }
 END_TEST(testJitGVN_PinnedPhis)
--- a/js/src/jsapi-tests/testJitMacroAssembler.cpp
+++ b/js/src/jsapi-tests/testJitMacroAssembler.cpp
@@ -37,38 +37,42 @@ static bool Prepare(MacroAssembler& masm
 
 static bool Execute(JSContext* cx, MacroAssembler& masm)
 {
     AllocatableRegisterSet regs(RegisterSet::All());
     LiveRegisterSet save(regs.asLiveSet());
     masm.PopRegsInMask(save);
     masm.ret(); // Add return statement to be sure.
 
-    if (masm.oom())
+    if (masm.oom()) {
         return false;
+    }
 
     Linker linker(masm);
     JitCode* code = linker.newCode(cx, CodeKind::Other);
-    if (!code)
+    if (!code) {
         return false;
-    if (!ExecutableAllocator::makeExecutable(code->raw(), code->bufferSize()))
+    }
+    if (!ExecutableAllocator::makeExecutable(code->raw(), code->bufferSize())) {
         return false;
+    }
 
     JS::AutoSuppressGCAnalysis suppress;
     EnterTest test = code->as<EnterTest>();
     test();
     return true;
 }
 
 BEGIN_TEST(testJitMacroAssembler_flexibleDivMod)
 {
     StackMacroAssembler masm(cx);
 
-    if (!Prepare(masm))
+    if (!Prepare(masm)) {
         return false;
+    }
 
     // Test case divides 9/2;
     const uintptr_t quotient_result = 4;
     const uintptr_t remainder_result = 1;
     const uintptr_t dividend = 9;
     const uintptr_t divisor = 2;
 
     AllocatableGeneralRegisterSet leftOutputHandSides(GeneralRegisterSet::All());
@@ -78,18 +82,19 @@ BEGIN_TEST(testJitMacroAssembler_flexibl
 
         AllocatableGeneralRegisterSet rightHandSides(GeneralRegisterSet::All());
         while (!rightHandSides.empty()) {
             Register rhs = rightHandSides.takeAny();
 
             AllocatableGeneralRegisterSet remainders(GeneralRegisterSet::All());
             while (!remainders.empty()) {
                 Register remainderOutput = remainders.takeAny();
-                if (lhsOutput == rhs || lhsOutput == remainderOutput || rhs == remainderOutput)
+                if (lhsOutput == rhs || lhsOutput == remainderOutput || rhs == remainderOutput) {
                     continue;
+                }
 
                 AllocatableRegisterSet regs(RegisterSet::Volatile());
                 LiveRegisterSet save(regs.asLiveSet());
 
                 Label next, fail;
                 masm.mov(ImmWord(dividend), lhsOutput);
                 masm.mov(ImmWord(divisor), rhs);
                 masm.flexibleDivMod32(rhs, lhsOutput, remainderOutput, false, save);
@@ -110,35 +115,37 @@ BEGIN_TEST(testJitMacroAssembler_flexibl
     return Execute(cx, masm);
 }
 END_TEST(testJitMacroAssembler_flexibleDivMod)
 
 BEGIN_TEST(testJitMacroAssembler_flexibleRemainder)
 {
     StackMacroAssembler masm(cx);
 
-    if (!Prepare(masm))
+    if (!Prepare(masm)) {
         return false;
+    }
 
     // Test case divides 9/2;
     const uintptr_t dividend = 9;
     const uintptr_t divisor = 2;
     const uintptr_t remainder_result  = 1;
 
     AllocatableGeneralRegisterSet leftOutputHandSides(GeneralRegisterSet::All());
 
     while (!leftOutputHandSides.empty()) {
         Register lhsOutput = leftOutputHandSides.takeAny();
 
         AllocatableGeneralRegisterSet rightHandSides(GeneralRegisterSet::All());
         while (!rightHandSides.empty()) {
             Register rhs = rightHandSides.takeAny();
 
-            if (lhsOutput == rhs)
+            if (lhsOutput == rhs) {
                 continue;
+            }
 
             AllocatableRegisterSet regs(RegisterSet::Volatile());
             LiveRegisterSet save(regs.asLiveSet());
 
             Label next, fail;
             masm.mov(ImmWord(dividend), lhsOutput);
             masm.mov(ImmWord(divisor), rhs);
             masm.flexibleRemainder32(rhs, lhsOutput, false, save);
@@ -157,35 +164,37 @@ BEGIN_TEST(testJitMacroAssembler_flexibl
     return Execute(cx, masm);
 }
 END_TEST(testJitMacroAssembler_flexibleRemainder)
 
 BEGIN_TEST(testJitMacroAssembler_flexibleQuotient)
 {
     StackMacroAssembler masm(cx);
 
-    if (!Prepare(masm))
+    if (!Prepare(masm)) {
         return false;
+    }
 
     // Test case divides 9/2;
     const uintptr_t dividend = 9;
     const uintptr_t divisor = 2;
     const uintptr_t quotient_result  = 4;
 
     AllocatableGeneralRegisterSet leftOutputHandSides(GeneralRegisterSet::All());
 
     while (!leftOutputHandSides.empty()) {
         Register lhsOutput = leftOutputHandSides.takeAny();
 
         AllocatableGeneralRegisterSet rightHandSides(GeneralRegisterSet::All());
         while (!rightHandSides.empty()) {
             Register rhs = rightHandSides.takeAny();
 
-            if (lhsOutput == rhs)
+            if (lhsOutput == rhs) {
                 continue;
+            }
 
             AllocatableRegisterSet regs(RegisterSet::Volatile());
             LiveRegisterSet save(regs.asLiveSet());
 
             Label next, fail;
             masm.mov(ImmWord(dividend), lhsOutput);
             masm.mov(ImmWord(divisor), rhs);
             masm.flexibleQuotient32(rhs, lhsOutput, false, save);
@@ -204,18 +213,19 @@ BEGIN_TEST(testJitMacroAssembler_flexibl
     return Execute(cx, masm);
 }
 END_TEST(testJitMacroAssembler_flexibleQuotient)
 
 BEGIN_TEST(testJitMacroAssembler_truncateDoubleToInt64)
 {
     StackMacroAssembler masm(cx);
 
-    if (!Prepare(masm))
+    if (!Prepare(masm)) {
         return false;
+    }
 
     AllocatableGeneralRegisterSet allRegs(GeneralRegisterSet::All());
     AllocatableFloatRegisterSet allFloatRegs(FloatRegisterSet::All());
     FloatRegister input = allFloatRegs.takeAny();
 #ifdef JS_NUNBOX32
     Register64 output(allRegs.takeAny(), allRegs.takeAny());
 #else
     Register64 output(allRegs.takeAny());
@@ -252,18 +262,19 @@ BEGIN_TEST(testJitMacroAssembler_truncat
     return Execute(cx, masm);
 }
 END_TEST(testJitMacroAssembler_truncateDoubleToInt64)
 
 BEGIN_TEST(testJitMacroAssembler_truncateDoubleToUInt64)
 {
     StackMacroAssembler masm(cx);
 
-    if (!Prepare(masm))
+    if (!Prepare(masm)) {
         return false;
+    }
 
     AllocatableGeneralRegisterSet allRegs(GeneralRegisterSet::All());
     AllocatableFloatRegisterSet allFloatRegs(FloatRegisterSet::All());
     FloatRegister input = allFloatRegs.takeAny();
     FloatRegister floatTemp = allFloatRegs.takeAny();
 #ifdef JS_NUNBOX32
     Register64 output(allRegs.takeAny(), allRegs.takeAny());
 #else
@@ -304,18 +315,19 @@ BEGIN_TEST(testJitMacroAssembler_truncat
     return Execute(cx, masm);
 }
 END_TEST(testJitMacroAssembler_truncateDoubleToUInt64)
 
 BEGIN_TEST(testJitMacroAssembler_branchDoubleNotInInt64Range)
 {
     StackMacroAssembler masm(cx);
 
-    if (!Prepare(masm))
+    if (!Prepare(masm)) {
         return false;
+    }
 
     AllocatableGeneralRegisterSet allRegs(GeneralRegisterSet::All());
     AllocatableFloatRegisterSet allFloatRegs(FloatRegisterSet::All());
     FloatRegister input = allFloatRegs.takeAny();
 #ifdef JS_NUNBOX32
     Register64 output(allRegs.takeAny(), allRegs.takeAny());
 #else
     Register64 output(allRegs.takeAny());
@@ -358,18 +370,19 @@ BEGIN_TEST(testJitMacroAssembler_branchD
     return Execute(cx, masm);
 }
 END_TEST(testJitMacroAssembler_branchDoubleNotInInt64Range)
 
 BEGIN_TEST(testJitMacroAssembler_branchDoubleNotInUInt64Range)
 {
     StackMacroAssembler masm(cx);
 
-    if (!Prepare(masm))
+    if (!Prepare(masm)) {
         return false;
+    }
 
     AllocatableGeneralRegisterSet allRegs(GeneralRegisterSet::All());
     AllocatableFloatRegisterSet allFloatRegs(FloatRegisterSet::All());
     FloatRegister input = allFloatRegs.takeAny();
 #ifdef JS_NUNBOX32
     Register64 output(allRegs.takeAny(), allRegs.takeAny());
 #else
     Register64 output(allRegs.takeAny());
@@ -415,18 +428,19 @@ BEGIN_TEST(testJitMacroAssembler_branchD
     return Execute(cx, masm);
 }
 END_TEST(testJitMacroAssembler_branchDoubleNotInUInt64Range)
 
 BEGIN_TEST(testJitMacroAssembler_lshift64)
 {
     StackMacroAssembler masm(cx);
 
-    if (!Prepare(masm))
+    if (!Prepare(masm)) {
         return false;
+    }
 
     AllocatableGeneralRegisterSet allRegs(GeneralRegisterSet::All());
     AllocatableFloatRegisterSet allFloatRegs(FloatRegisterSet::All());
 #if defined(JS_CODEGEN_X86)
     Register shift = ecx;
     allRegs.take(shift);
 #elif defined(JS_CODEGEN_X64)
     Register shift = rcx;
@@ -484,18 +498,19 @@ BEGIN_TEST(testJitMacroAssembler_lshift6
     return Execute(cx, masm);
 }
 END_TEST(testJitMacroAssembler_lshift64)
 
 BEGIN_TEST(testJitMacroAssembler_rshift64Arithmetic)
 {
     StackMacroAssembler masm(cx);
 
-    if (!Prepare(masm))
+    if (!Prepare(masm)) {
         return false;
+    }
 
     AllocatableGeneralRegisterSet allRegs(GeneralRegisterSet::All());
     AllocatableFloatRegisterSet allFloatRegs(FloatRegisterSet::All());
 #if defined(JS_CODEGEN_X86)
     Register shift = ecx;
     allRegs.take(shift);
 #elif defined(JS_CODEGEN_X64)
     Register shift = rcx;
@@ -552,18 +567,19 @@ BEGIN_TEST(testJitMacroAssembler_rshift6
     return Execute(cx, masm);
 }
 END_TEST(testJitMacroAssembler_rshift64Arithmetic)
 
 BEGIN_TEST(testJitMacroAssembler_rshift64)
 {
     StackMacroAssembler masm(cx);
 
-    if (!Prepare(masm))
+    if (!Prepare(masm)) {
         return false;
+    }
 
     AllocatableGeneralRegisterSet allRegs(GeneralRegisterSet::All());
     AllocatableFloatRegisterSet allFloatRegs(FloatRegisterSet::All());
 #if defined(JS_CODEGEN_X86)
     Register shift = ecx;
     allRegs.take(shift);
 #elif defined(JS_CODEGEN_X64)
     Register shift = rcx;
--- a/js/src/jsapi-tests/testJitMinimalFunc.h
+++ b/js/src/jsapi-tests/testJitMinimalFunc.h
@@ -21,18 +21,19 @@ struct MinimalAlloc {
     TempAllocator alloc;
 
     // We are not testing the fallible allocator in these test cases, thus make
     // the lifo alloc chunk extremely large for our test cases.
     MinimalAlloc()
       : lifo(128 * 1024),
         alloc(&lifo)
     {
-        if (!alloc.ensureBallast())
+        if (!alloc.ensureBallast()) {
             MOZ_CRASH("[OOM] Not enough RAM for the test.");
+        }
     }
 };
 
 struct MinimalFunc : MinimalAlloc
 {
     JitCompileOptions options;
     CompileInfo info;
     MIRGraph graph;
@@ -73,47 +74,58 @@ struct MinimalFunc : MinimalAlloc
     MParameter* createParameter()
     {
         MParameter* p = MParameter::New(alloc, numParams++, nullptr);
         return p;
     }
 
     bool runGVN()
     {
-        if (!SplitCriticalEdges(graph))
+        if (!SplitCriticalEdges(graph)) {
             return false;
+        }
         RenumberBlocks(graph);
-        if (!BuildDominatorTree(graph))
+        if (!BuildDominatorTree(graph)) {
             return false;
-        if (!BuildPhiReverseMapping(graph))
+        }
+        if (!BuildPhiReverseMapping(graph)) {
             return false;
+        }
         ValueNumberer gvn(&mir, graph);
-        if (!gvn.run(ValueNumberer::DontUpdateAliasAnalysis))
+        if (!gvn.run(ValueNumberer::DontUpdateAliasAnalysis)) {
             return false;
+        }
         return true;
     }
 
     bool runRangeAnalysis()
     {
-        if (!SplitCriticalEdges(graph))
+        if (!SplitCriticalEdges(graph)) {
             return false;
+        }
         RenumberBlocks(graph);
-        if (!BuildDominatorTree(graph))
+        if (!BuildDominatorTree(graph)) {
             return false;
-        if (!BuildPhiReverseMapping(graph))
+        }
+        if (!BuildPhiReverseMapping(graph)) {
             return false;
+        }
         RangeAnalysis rangeAnalysis(&mir, graph);
-        if (!rangeAnalysis.addBetaNodes())
+        if (!rangeAnalysis.addBetaNodes()) {
             return false;
-        if (!rangeAnalysis.analyze())
+        }
+        if (!rangeAnalysis.analyze()) {
             return false;
-        if (!rangeAnalysis.addRangeAssertions())
+        }
+        if (!rangeAnalysis.addRangeAssertions()) {
             return false;
-        if (!rangeAnalysis.removeBetaNodes())
+        }
+        if (!rangeAnalysis.removeBetaNodes()) {
             return false;
+        }
         return true;
     }
 };
 
 } // namespace jit
 } // namespace js
 
 #endif
--- a/js/src/jsapi-tests/testJitRValueAlloc.cpp
+++ b/js/src/jsapi-tests/testJitRValueAlloc.cpp
@@ -119,18 +119,19 @@ END_TEST(testJitRValueAlloc_TypedStack)
 
 #if defined(JS_NUNBOX32)
 
 BEGIN_TEST(testJitRValueAlloc_UntypedRegReg)
 {
     RValueAllocation s;
     for (uint32_t i = 0; i < Registers::Total; i++) {
         for (uint32_t j = 0; j < Registers::Total; j++) {
-            if (i == j)
+            if (i == j) {
                 continue;
+            }
             s = RValueAllocation::Untyped(Register::FromCode(i), Register::FromCode(j));
             MOZ_ASSERT(s == Read(s));
             CHECK(s == Read(s));
         }
     }
     return true;
 }
 END_TEST(testJitRValueAlloc_UntypedRegReg)
--- a/js/src/jsapi-tests/testJitRangeAnalysis.cpp
+++ b/js/src/jsapi-tests/testJitRangeAnalysis.cpp
@@ -15,34 +15,43 @@
 #include "jsapi-tests/testJitMinimalFunc.h"
 #include "jsapi-tests/tests.h"
 
 using namespace js;
 using namespace js::jit;
 
 static bool
 EquivalentRanges(const Range* a, const Range* b) {
-    if (a->hasInt32UpperBound() != b->hasInt32UpperBound())
+    if (a->hasInt32UpperBound() != b->hasInt32UpperBound()) {
         return false;
-    if (a->hasInt32LowerBound() != b->hasInt32LowerBound())
+    }
+    if (a->hasInt32LowerBound() != b->hasInt32LowerBound()) {
         return false;
-    if (a->hasInt32UpperBound() && (a->upper() != b->upper()))
+    }
+    if (a->hasInt32UpperBound() && (a->upper() != b->upper())) {
         return false;
-    if (a->hasInt32LowerBound() && (a->lower() != b->lower()))
+    }
+    if (a->hasInt32LowerBound() && (a->lower() != b->lower())) {
+        return false;
+    }
+    if (a->canHaveFractionalPart() != b->canHaveFractionalPart()) {
         return false;
-    if (a->canHaveFractionalPart() != b->canHaveFractionalPart())
+    }
+    if (a->canBeNegativeZero() != b->canBeNegativeZero()) {
         return false;
-    if (a->canBeNegativeZero() != b->canBeNegativeZero())
+    }
+    if (a->canBeNaN() != b->canBeNaN()) {
         return false;
-    if (a->canBeNaN() != b->canBeNaN())
+    }
+    if (a->canBeInfiniteOrNaN() != b->canBeInfiniteOrNaN()) {
         return false;
-    if (a->canBeInfiniteOrNaN() != b->canBeInfiniteOrNaN())
+    }
+    if (!a->canBeInfiniteOrNaN() && (a->exponent() != b->exponent())) {
         return false;
-    if (!a->canBeInfiniteOrNaN() && (a->exponent() != b->exponent()))
-        return false;
+    }
     return true;
 }
 
 BEGIN_TEST(testJitRangeAnalysis_MathSign)
 {
     MinimalAlloc func;
 
     Range* xnan = new(func.alloc) Range();
@@ -165,18 +174,19 @@ BEGIN_TEST(testJitRangeAnalysis_MathSign
     // }
     MAdd* elseElseAdd = MAdd::New(func.alloc, p, cm0, MIRType::Double);
     elseElseBlock->add(elseElseAdd);
     MSign* elseElseSign = MSign::New(func.alloc, elseElseAdd, MIRType::Double);
     elseElseBlock->add(elseElseSign);
     MReturn* elseElseRet = MReturn::New(func.alloc, elseElseSign);
     elseElseBlock->end(elseElseRet);
 
-    if (!func.runRangeAnalysis())
+    if (!func.runRangeAnalysis()) {
         return false;
+    }
 
     CHECK(!p->range());
     CHECK(EquivalentRanges(c0->range(), Range::NewDoubleSingletonRange(func.alloc, 0.0)));
     CHECK(EquivalentRanges(cm0->range(), Range::NewDoubleSingletonRange(func.alloc, -0.0)));
 
     // On the (p < 0) side, p is negative and not -0 (surprise!)
     CHECK(EquivalentRanges(thenAdd->range(),
                            new(func.alloc) Range(Range::NoInt32LowerBound, 0,
@@ -255,26 +265,28 @@ BEGIN_TEST(testJitRangeAnalysis_StrictCo
     MCompare::CompareType nonNumerics[] = {
         MCompare::Compare_Unknown,
         MCompare::Compare_Object,
         MCompare::Compare_Bitwise,
         MCompare::Compare_String
     };
     for (size_t i = 0; i < mozilla::ArrayLength(nonNumerics); ++i) {
         cmp->setCompareType(nonNumerics[i]);
-        if (!func.runRangeAnalysis())
+        if (!func.runRangeAnalysis()) {
             return false;
+        }
         CHECK(!thenAdd->range() || thenAdd->range()->isUnknown());
         ClearDominatorTree(func.graph);
     }
 
     // We can do it with a numeric comparison.
     cmp->setCompareType(MCompare::Compare_Double);
-    if (!func.runRangeAnalysis())
+    if (!func.runRangeAnalysis()) {
         return false;
+    }
     CHECK(EquivalentRanges(thenAdd->range(),
                            Range::NewDoubleRange(func.alloc, 0.0, 0.0)));
 
     return true;
 }
 END_TEST(testJitRangeAnalysis_StrictCompareBeta)
 
 
@@ -302,18 +314,19 @@ checkShiftRightRange(int32_t lhsLow, int
     MinimalAlloc func;
     int64_t lhsLower, lhsUpper, rhsLower, rhsUpper;
 
     for (lhsLower = lhsLow; lhsLower <= lhsHigh; lhsLower += lhsInc) {
         for (lhsUpper = lhsLower; lhsUpper <= lhsHigh; lhsUpper += lhsInc) {
             Range* lhsRange = Range::NewInt32Range(func.alloc, lhsLower, lhsUpper);
             for (rhsLower = rhsLow; rhsLower <= rhsHigh; rhsLower += rhsInc) {
                 for (rhsUpper = rhsLower; rhsUpper <= rhsHigh; rhsUpper += rhsInc) {
-                    if (!func.alloc.ensureBallast())
+                    if (!func.alloc.ensureBallast()) {
                         return false;
+                    }
 
                     Range* rhsRange = Range::NewInt32Range(func.alloc, rhsLower, rhsUpper);
                     Range* result = Range::rsh(func.alloc, lhsRange, rhsRange);
                     int32_t min, max;
                     deriveShiftRightRange(lhsLower, lhsUpper,
                                           rhsLower, rhsUpper,
                                           &min, &max);
                     if (!result->isInt32() ||
--- a/js/src/jsapi-tests/testJitRegisterSet.cpp
+++ b/js/src/jsapi-tests/testJitRegisterSet.cpp
@@ -10,18 +10,19 @@
 #include "jsapi-tests/tests.h"
 
 using namespace js;
 using namespace js::jit;
 
 static bool
 CoPrime(size_t a, size_t b)
 {
-    if (b <= 1)
+    if (b <= 1) {
         return a == 1 || b == 1;
+    }
     return CoPrime(b, a % b);
 }
 
 // This macros are use to iterave over all registers in a large number of
 // non-looping sequences, which does not rely on the getFirst / getLast
 // functions.
 #define BEGIN_INDEX_WALK(RegTotal)                          \
     static const size_t Total = RegTotal;                   \
@@ -161,40 +162,44 @@ void pullAllFpus(AllocatableFloatRegiste
         set.add(tmp);
     }
     for (FloatRegisterIterator it(available_v128); it.more(); ++it) {
         FloatRegister tmp = *it;
         set.take(tmp);
         pullAllFpus(set, max_bits, bits + 128);
         set.add(tmp);
     }
-    if (bits >= max_bits)
+    if (bits >= max_bits) {
         max_bits = bits;
+    }
 }
 
 BEGIN_TEST(testJitRegisterSet_FPU_Aliases)
 {
     BEGIN_All_WALK(FloatRegisters::Total);
     FOR_ALL_REGISTERS(FloatRegister, reg) {
         AllocatableFloatRegisterSet pool;
         pool.add(reg);
 
         uint32_t alias_bits = 0;
         for (uint32_t i = 0; i < reg.numAlignedAliased(); i++) {
             FloatRegister alias = reg.alignedAliased(i);
 
             if (alias.isSingle()) {
-                if (alias_bits <= 32)
+                if (alias_bits <= 32) {
                     alias_bits = 32;
+                }
             } else if (alias.isDouble()) {
-                if (alias_bits <= 64)
+                if (alias_bits <= 64) {
                     alias_bits = 64;
+                }
             } else if (alias.isSimd128()) {
-                if (alias_bits <= 128)
+                if (alias_bits <= 128) {
                     alias_bits = 128;
+                }
             }
         }
 
         uint32_t max_bits = 0;
         pullAllFpus(pool, max_bits, 0);
 
         // By adding one register, we expect that we should not be able to pull
         // more than any of its aligned aliases.  This rule should hold for both
--- a/js/src/jsapi-tests/testLookup.cpp
+++ b/js/src/jsapi-tests/testLookup.cpp
@@ -42,32 +42,36 @@ static const JSClass DocumentAllClass = 
     JSCLASS_EMULATES_UNDEFINED
 };
 
 bool
 document_resolve(JSContext* cx, JS::HandleObject obj, JS::HandleId id, bool* resolvedp)
 {
     // If id is "all", resolve document.all=true.
     JS::RootedValue v(cx);
-    if (!JS_IdToValue(cx, id, &v))
+    if (!JS_IdToValue(cx, id, &v)) {
         return false;
+    }
 
     if (v.isString()) {
         JSString* str = v.toString();
         JSFlatString* flatStr = JS_FlattenString(cx, str);
-        if (!flatStr)
+        if (!flatStr) {
             return false;
+        }
         if (JS_FlatStringEqualsAscii(flatStr, "all")) {
             JS::Rooted<JSObject*> docAll(cx, JS_NewObject(cx, &DocumentAllClass));
-            if (!docAll)
+            if (!docAll) {
                 return false;
+            }
 
             JS::Rooted<JS::Value> allValue(cx, JS::ObjectValue(*docAll));
-            if (!JS_DefinePropertyById(cx, obj, id, allValue, JSPROP_RESOLVING))
+            if (!JS_DefinePropertyById(cx, obj, id, allValue, JSPROP_RESOLVING)) {
                 return false;
+            }
 
             *resolvedp = true;
             return true;
         }
     }
 
     *resolvedp = false;
     return true;
--- a/js/src/jsapi-tests/testMappedArrayBuffer.cpp
+++ b/js/src/jsapi-tests/testMappedArrayBuffer.cpp
@@ -63,37 +63,39 @@ BEGIN_TEST(testMappedArrayBuffer_bug9451
     return true;
 }
 
 JSObject* CreateNewObject(const int offset, const int length)
 {
     int fd = open(test_filename, O_RDONLY);
     void* ptr = JS_CreateMappedArrayBufferContents(GET_OS_FD(fd), offset, length);
     close(fd);
-    if (!ptr)
+    if (!ptr) {
         return nullptr;
+    }
     JSObject* obj = JS_NewMappedArrayBufferWithContents(cx, length, ptr);
     if (!obj) {
         JS_ReleaseMappedArrayBufferContents(ptr, length);
         return nullptr;
     }
     return obj;
 }
 
 bool VerifyObject(JS::HandleObject obj, uint32_t offset, uint32_t length, const bool mapped)
 {
     JS::AutoCheckCannotGC nogc;
 
     CHECK(obj);
     CHECK(JS_IsArrayBufferObject(obj));
     CHECK_EQUAL(JS_GetArrayBufferByteLength(obj), length);
-    if (mapped)
+    if (mapped) {
         CHECK(JS_IsMappedArrayBufferObject(obj));
-    else
+    } else {
         CHECK(!JS_IsMappedArrayBufferObject(obj));
+    }
     bool sharedDummy;
     const char* data =
         reinterpret_cast<const char*>(JS_GetArrayBufferData(obj, &sharedDummy, nogc));
     CHECK(data);
     CHECK(memcmp(data, test_data + offset, length) == 0);
 
     return true;
 }
@@ -106,18 +108,19 @@ bool TestCreateObject(uint32_t offset, u
     return true;
 }
 
 bool TestReleaseContents()
 {
     int fd = open(test_filename, O_RDONLY);
     void* ptr = JS_CreateMappedArrayBufferContents(GET_OS_FD(fd), 0, 12);
     close(fd);
-    if (!ptr)
+    if (!ptr) {
         return false;
+    }
     JS_ReleaseMappedArrayBufferContents(ptr, 12);
 
     return true;
 }
 
 bool TestDetachObject()
 {
     JS::RootedObject obj(cx, CreateNewObject(8, 12));
@@ -158,18 +161,19 @@ bool TestStealContents()
 bool TestTransferObject()
 {
     JS::RootedObject obj1(cx, CreateNewObject(8, 12));
     CHECK(obj1);
     JS::RootedValue v1(cx, JS::ObjectValue(*obj1));
 
     // Create an Array of transferable values.
     JS::AutoValueVector argv(cx);
-    if (!argv.append(v1))
+    if (!argv.append(v1)) {
         return false;
+    }
 
     JS::RootedObject obj(cx, JS_NewArrayObject(cx, JS::HandleValueArray::subarray(argv, 0, 1)));
     CHECK(obj);
     JS::RootedValue transferable(cx, JS::ObjectValue(*obj));
 
     JSAutoStructuredCloneBuffer cloned_buffer(JS::StructuredCloneScope::SameProcessSameThread, nullptr, nullptr);
     CHECK(cloned_buffer.write(cx, v1, transferable, JS::CloneDataPolicy().denySharedArrayBuffer(), nullptr, nullptr));
     JS::RootedValue v2(cx);
--- a/js/src/jsapi-tests/testMutedErrors.cpp
+++ b/js/src/jsapi-tests/testMutedErrors.cpp
@@ -35,18 +35,19 @@ BEGIN_TEST(testMutedErrors)
     return true;
 }
 
 bool
 eval(const char* asciiChars, bool mutedErrors, JS::MutableHandleValue rval)
 {
     size_t len = strlen(asciiChars);
     mozilla::UniquePtr<char16_t[]> chars(new char16_t[len+1]);
-    for (size_t i = 0; i < len; ++i)
+    for (size_t i = 0; i < len; ++i) {
         chars[i] = asciiChars[i];
+    }
     chars[len] = 0;
 
     JS::RealmOptions globalOptions;
     JS::RootedObject global(cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr,
 						   JS::FireOnNewGlobalHook, globalOptions));
     CHECK(global);
     JSAutoRealm ar(cx, global);
     CHECK(JS::InitRealmStandardClasses(cx));
--- a/js/src/jsapi-tests/testNewObject.cpp
+++ b/js/src/jsapi-tests/testNewObject.cpp
@@ -34,18 +34,19 @@ constructHook(JSContext* cx, unsigned ar
     if (!args.isConstructing()) {
         JS_ReportErrorASCII(cx, "test failed, not constructing");
         return false;
     }
 
     // Perform a side-effect to indicate that this hook was actually called.
     JS::RootedValue value(cx, args[0]);
     JS::RootedObject callee(cx, &args.callee());
-    if (!JS_SetElement(cx, callee, 0, value))
+    if (!JS_SetElement(cx, callee, 0, value)) {
         return false;
+    }
 
     args.rval().setObject(*obj);
 
     // trash the argv, perversely
     args[0].setUndefined();
     args[1].setUndefined();
     args[2].setUndefined();
 
@@ -80,18 +81,19 @@ BEGIN_TEST(testNewObject_1)
     CHECK(obj);
     rt = JS::ObjectValue(*obj);
     CHECK(JS_IsArrayObject(cx, obj, &isArray));
     CHECK(isArray);
     CHECK(JS_GetArrayLength(cx, obj, &len));
     CHECK_EQUAL(len, 4u);
 
     // With N arguments.
-    for (size_t i = 0; i < N; i++)
+    for (size_t i = 0; i < N; i++) {
         argv[i].setInt32(i);
+    }
     obj = JS_New(cx, Array, JS::HandleValueArray::subarray(argv, 0, N));
     CHECK(obj);
     rt = JS::ObjectValue(*obj);
     CHECK(JS_IsArrayObject(cx, obj, &isArray));
     CHECK(isArray);
     CHECK(JS_GetArrayLength(cx, obj, &len));
     CHECK_EQUAL(len, N);
     CHECK(JS_GetElement(cx, obj, N - 1, &v));
--- a/js/src/jsapi-tests/testOOM.cpp
+++ b/js/src/jsapi-tests/testOOM.cpp
@@ -6,27 +6,29 @@
 
 #include "jsapi-tests/tests.h"
 
 BEGIN_TEST(testOOM)
 {
     JS::RootedValue v(cx, JS::Int32Value(9));
     JS::RootedString jsstr(cx, JS::ToString(cx, v));
     char16_t ch;
-    if (!JS_GetStringCharAt(cx, jsstr, 0, &ch))
+    if (!JS_GetStringCharAt(cx, jsstr, 0, &ch)) {
         return false;
+    }
     MOZ_RELEASE_ASSERT(ch == '9');
     return true;
 }
 
 virtual JSContext* createContext() override
 {
     JSContext* cx = JS_NewContext(0);
-    if (!cx)
+    if (!cx) {
         return nullptr;
+    }
     JS_SetGCParameter(cx, JSGC_MAX_BYTES, (uint32_t)-1);
     setNativeStackQuota(cx);
     return cx;
 }
 END_TEST(testOOM)
 
 #ifdef DEBUG  // js::oom functions are only available in debug builds.
 
@@ -52,18 +54,19 @@ const uint32_t maxAllocsPerTest = 100;
 
 BEGIN_TEST(testNewContext)
 {
     uninit(); // Get rid of test harness' original JSContext.
 
     JSContext* cx;
     START_OOM_TEST("new context");
     cx = JS_NewContext(8L * 1024 * 1024);
-    if (cx)
+    if (cx) {
         OOM_TEST_FINISHED;
+    }
     CHECK(!JSRuntime::hasLiveRuntimes());
     END_OOM_TEST;
     JS_DestroyContext(cx);
     return true;
 }
 
 const char* testName;
 uint64_t oomAfter;
--- a/js/src/jsapi-tests/testObjectEmulatingUndefined.cpp
+++ b/js/src/jsapi-tests/testObjectEmulatingUndefined.cpp
@@ -9,18 +9,19 @@ static const JSClass ObjectEmulatingUnde
     JSCLASS_EMULATES_UNDEFINED
 };
 
 static bool
 ObjectEmulatingUndefinedConstructor(JSContext* cx, unsigned argc, JS::Value* vp)
 {
     JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
     JSObject* obj = JS_NewObjectForConstructor(cx, &ObjectEmulatingUndefinedClass, args);
-    if (!obj)
+    if (!obj) {
         return false;
+    }
     args.rval().setObject(*obj);
     return true;
 }
 
 BEGIN_TEST(testObjectEmulatingUndefined_truthy)
 {
     CHECK(JS_InitClass(cx, global, nullptr, &ObjectEmulatingUndefinedClass,
                        ObjectEmulatingUndefinedConstructor, 0,
--- a/js/src/jsapi-tests/testParseJSON.cpp
+++ b/js/src/jsapi-tests/testParseJSON.cpp
@@ -25,25 +25,27 @@ class AutoInflatedString {
     explicit AutoInflatedString(JSContext* cx) : cx(cx), chars_(nullptr), length_(0) { }
     ~AutoInflatedString() {
         JS_free(cx, chars_);
     }
 
     template<size_t N> void operator=(const char (&str)[N]) {
         length_ = N - 1;
         chars_ = InflateString(cx, str, length_);
-        if (!chars_)
+        if (!chars_) {
             abort();
+        }
     }
 
     void operator=(const char* str) {
         length_ = strlen(str);
         chars_ = InflateString(cx, str, length_);
-        if (!chars_)
+        if (!chars_) {
             abort();
+        }
     }
 
     const char16_t* chars() const { return chars_; }
     size_t length() const { return length_; }
 };
 
 BEGIN_TEST(testParseJSON_success)
 {
--- a/js/src/jsapi-tests/testPersistentRooted.cpp
+++ b/js/src/jsapi-tests/testPersistentRooted.cpp
@@ -55,18 +55,19 @@ struct Kennel {
 
 // A function for allocating a Kennel and a barker. Only allocating
 // PersistentRooteds on the heap, and in this function, helps ensure that the
 // conservative GC doesn't find stray references to the barker. Ugh.
 MOZ_NEVER_INLINE static Kennel*
 Allocate(JSContext* cx)
 {
     RootedObject barker(cx, JS_NewObject(cx, &BarkWhenTracedClass::class_));
-    if (!barker)
+    if (!barker) {
         return nullptr;
+    }
 
     return new Kennel(cx, barker);
 }
 
 // Do a GC, expecting |n| barkers to be finalized.
 static bool
 GCFinalizesNBarkers(JSContext* cx, int n)
 {
--- a/js/src/jsapi-tests/testPreserveJitCode.cpp
+++ b/js/src/jsapi-tests/testPreserveJitCode.cpp
@@ -11,18 +11,19 @@
 #include "vm/JSObject-inl.h"
 
 using namespace JS;
 
 static void
 ScriptCallback(JSRuntime* rt, void* data, JSScript* script, const JS::AutoRequireNoGC& nogc)
 {
     unsigned& count = *static_cast<unsigned*>(data);
-    if (script->hasIonScript())
+    if (script->hasIonScript()) {
         ++count;
+    }
 }
 
 BEGIN_TEST(test_PreserveJitCode)
 {
     CHECK(testPreserveJitCode(false, 0));
     CHECK(testPreserveJitCode(true, 1));
     return true;
 }
@@ -43,18 +44,19 @@ testPreserveJitCode(bool preserveJitCode
     cx->runtime()->setOffthreadIonCompilationEnabled(false);
 
     RootedObject global(cx, createTestGlobal(preserveJitCode));
     CHECK(global);
     JSAutoRealm ar(cx, global);
 
     // The Ion JIT may be unavailable due to --disable-ion or lack of support
     // for this platform.
-    if (!js::jit::IsIonEnabled(cx))
+    if (!js::jit::IsIonEnabled(cx)) {
         knownFail = true;
+    }
 
     CHECK_EQUAL(countIonScripts(global), 0u);
 
     const char* source =
         "var i = 0;\n"
         "var sum = 0;\n"
         "while (i < 10) {\n"
         "    sum += i;\n"
@@ -66,18 +68,19 @@ testPreserveJitCode(bool preserveJitCode
     JS::RootedFunction fun(cx);
     JS::CompileOptions options(cx);
     options.setFileAndLine(__FILE__, 1);
     JS::AutoObjectVector emptyScopeChain(cx);
     CHECK(JS::CompileFunction(cx, emptyScopeChain, options, "f", 0, nullptr,
 			      source, length, &fun));
 
     RootedValue value(cx);
-    for (unsigned i = 0; i < 1500; ++i)
+    for (unsigned i = 0; i < 1500; ++i) {
         CHECK(JS_CallFunction(cx, global, fun, JS::HandleValueArray::empty(), &value));
+    }
     CHECK_EQUAL(value.toInt32(), 45);
     CHECK_EQUAL(countIonScripts(global), 1u);
 
     NonIncrementalGC(cx, GC_NORMAL, gcreason::API);
     CHECK_EQUAL(countIonScripts(global), remainingIonScripts);
 
     NonIncrementalGC(cx, GC_SHRINK, gcreason::API);
     CHECK_EQUAL(countIonScripts(global), 0u);
--- a/js/src/jsapi-tests/testPrivateGCThingValue.cpp
+++ b/js/src/jsapi-tests/testPrivateGCThingValue.cpp
@@ -9,18 +9,19 @@
 
 #include "js/CompilationAndEvaluation.h"
 #include "js/HeapAPI.h"
 #include "jsapi-tests/tests.h"
 
 class TestTracer : public JS::CallbackTracer
 {
     void onChild(const JS::GCCellPtr& thing) override {
-        if (thing.asCell() == expectedCell && thing.kind() == expectedKind)
+        if (thing.asCell() == expectedCell && thing.kind() == expectedKind) {
             found = true;
+        }
     }
 
   public:
     js::gc::Cell* expectedCell;
     JS::TraceKind expectedKind;
     bool found;
 
     explicit TestTracer(JSContext* cx)
--- a/js/src/jsapi-tests/testProfileStrings.cpp
+++ b/js/src/jsapi-tests/testProfileStrings.cpp
@@ -57,18 +57,19 @@ disable(JSContext* cx, unsigned argc, JS
     return true;
 }
 
 static bool
 Prof(JSContext* cx, unsigned argc, JS::Value* vp)
 {
     JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
     JSObject* obj = JS_NewObjectForConstructor(cx, &ptestClass, args);
-    if (!obj)
+    if (!obj) {
         return false;
+    }
     args.rval().setObject(*obj);
     return true;
 }
 
 static const JSFunctionSpec ptestFunctions[] = {
     JS_FN("test_fn", test_fn, 0, 0),
     JS_FN("test_fn2", test_fn2, 0, 0),
     JS_FN("enable", enable, 0, 0),
--- a/js/src/jsapi-tests/testPromise.cpp
+++ b/js/src/jsapi-tests/testPromise.cpp
@@ -26,64 +26,68 @@ PromiseExecutor(JSContext* cx, unsigned 
     executor_called = true;
     return true;
 }
 
 static JSObject*
 CreatePromise(JSContext* cx)
 {
     RootedFunction executor(cx, JS_NewFunction(cx, PromiseExecutor, 2, 0, "executor"));
-    if (!executor)
+    if (!executor) {
         return nullptr;
+    }
     return JS::NewPromiseObject(cx, executor);
 }
 
 BEGIN_TEST(testPromise_NewPromise)
 {
     RootedObject promise(cx, CreatePromise(cx));
     CHECK(promise);
     CHECK(executor_called);
 
     return true;
 }
 END_TEST(testPromise_NewPromise)
 
 BEGIN_TEST(testPromise_GetPromiseState)
 {
     RootedObject promise(cx, CreatePromise(cx));
-    if (!promise)
+    if (!promise) {
         return false;
+    }
 
     CHECK(JS::GetPromiseState(promise) == JS::PromiseState::Pending);
 
     return true;
 }
 END_TEST(testPromise_GetPromiseState)
 
 BEGIN_TEST(testPromise_ResolvePromise)
 {
     RootedObject promise(cx, CreatePromise(cx));
-    if (!promise)
+    if (!promise) {
         return false;
+    }
 
     RootedValue result(cx);
     result.setInt32(42);
     JS::ResolvePromise(cx, promise, result);
 
     CHECK(JS::GetPromiseState(promise) == JS::PromiseState::Fulfilled);
 
     return true;
 }
 END_TEST(testPromise_ResolvePromise)
 
 BEGIN_TEST(testPromise_RejectPromise)
 {
     RootedObject promise(cx, CreatePromise(cx));
-    if (!promise)
+    if (!promise) {
         return false;
+    }
 
     RootedValue result(cx);
     result.setInt32(42);
     JS::RejectPromise(cx, promise, result);
 
     CHECK(JS::GetPromiseState(promise) == JS::PromiseState::Rejected);
 
     return true;
@@ -116,50 +120,56 @@ PromiseCatchHandler(JSContext* cx, unsig
 
     catchHandler_called = true;
     return true;
 }
 
 BEGIN_TEST(testPromise_PromiseThen)
 {
     RootedObject promise(cx, CreatePromise(cx));
-    if (!promise)
+    if (!promise) {
         return false;
+    }
 
     RootedFunction thenHandler(cx, JS_NewFunction(cx, PromiseThenHandler, 1, 0, "thenHandler"));
-    if (!thenHandler)
+    if (!thenHandler) {
         return false;
+    }
     RootedFunction catchHandler(cx, JS_NewFunction(cx, PromiseCatchHandler, 1, 0, "catchHandler"));
-    if (!catchHandler)
+    if (!catchHandler) {
         return false;
+    }
     JS::AddPromiseReactions(cx, promise, thenHandler, catchHandler);
 
     RootedValue result(cx);
     result.setInt32(42);
     JS::ResolvePromise(cx, promise, result);
     js::RunJobs(cx);
 
     CHECK(thenHandler_called);
 
     return true;
 }
 END_TEST(testPromise_PromiseThen)
 
 BEGIN_TEST(testPromise_PromiseCatch)
 {
     RootedObject promise(cx, CreatePromise(cx));
-    if (!promise)
+    if (!promise) {
         return false;
+    }
 
     RootedFunction thenHandler(cx, JS_NewFunction(cx, PromiseThenHandler, 1, 0, "thenHandler"));
-    if (!thenHandler)
+    if (!thenHandler) {
         return false;
+    }
     RootedFunction catchHandler(cx, JS_NewFunction(cx, PromiseCatchHandler, 1, 0, "catchHandler"));
-    if (!catchHandler)
+    if (!catchHandler) {
         return false;
+    }
     JS::AddPromiseReactions(cx, promise, thenHandler, catchHandler);
 
     RootedValue result(cx);
     result.setInt32(42);
     JS::RejectPromise(cx, promise, result);
     js::RunJobs(cx);
 
     CHECK(catchHandler_called);
--- a/js/src/jsapi-tests/testReadableStream.cpp
+++ b/js/src/jsapi-tests/testReadableStream.cpp
@@ -110,28 +110,32 @@ ResetCallbacks()
 }
 
 static bool
 GetIterResult(JSContext* cx, HandleObject promise, MutableHandleValue value, bool* done)
 {
     RootedObject iterResult(cx, &GetPromiseResult(promise).toObject());
 
     bool found;
-    if (!JS_HasProperty(cx, iterResult, "value", &found))
+    if (!JS_HasProperty(cx, iterResult, "value", &found)) {
         return false;
+    }
     MOZ_ASSERT(found);
-    if (!JS_HasProperty(cx, iterResult, "done", &found))
+    if (!JS_HasProperty(cx, iterResult, "done", &found)) {
         return false;
+    }
     MOZ_ASSERT(found);
 
     RootedValue doneVal(cx);
-    if (!JS_GetProperty(cx, iterResult, "value", value))
+    if (!JS_GetProperty(cx, iterResult, "value", value)) {
         return false;
-    if (!JS_GetProperty(cx, iterResult, "done", &doneVal))
+    }
+    if (!JS_GetProperty(cx, iterResult, "done", &doneVal)) {
         return false;
+    }
 
     *done = doneVal.toBoolean();
     MOZ_ASSERT_IF(*done, value.isUndefined());
 
     return true;
 }
 
 static JSObject*
@@ -536,18 +540,19 @@ struct ReadFromExternalSourceFixture : p
 
         size_t length = sizeof(test_buffer_data);
         ReadableStreamUpdateDataAvailableFromSource(cx, stream, length);
 
         CHECK(writeIntoRequestBufferCBCalled);
         CHECK(GetPromiseState(promise) == PromiseState::Fulfilled);
         RootedValue iterVal(cx);
         bool done;
-        if (!GetIterResult(cx, promise, &iterVal, &done))
+        if (!GetIterResult(cx, promise, &iterVal, &done)) {
             return false;
+        }
 
         CHECK(!done);
         RootedObject chunk(cx, &iterVal.toObject());
         CHECK(JS_IsUint8Array(chunk));
 
         {
             JS::AutoCheckCannotGC noGC(cx);
             bool dummy;
@@ -589,18 +594,19 @@ struct ReadFromExternalSourceFixture : p
         EVAL(evalSrc, &rval);
         CHECK(writeIntoRequestBufferCBCalled);
         CHECK(rval.isObject());
         RootedObject promise(cx, &rval.toObject());
         CHECK(IsPromiseObject(promise));
         CHECK(GetPromiseState(promise) == PromiseState::Fulfilled);
         RootedValue iterVal(cx);
         bool done;
-        if (!GetIterResult(cx, promise, &iterVal, &done))
+        if (!GetIterResult(cx, promise, &iterVal, &done)) {
             return false;
+        }
 
         CHECK(!done);
         RootedObject chunk(cx, &iterVal.toObject());
         CHECK(JS_IsUint8Array(chunk));
 
         {
             JS::AutoCheckCannotGC noGC(cx);
             bool dummy;
--- a/js/src/jsapi-tests/testScriptInfo.cpp
+++ b/js/src/jsapi-tests/testScriptInfo.cpp
@@ -38,14 +38,15 @@ BEGIN_TEST(testScriptInfo)
     CHECK(strcmp(JS_GetScriptFilename(script), __FILE__) == 0);
 
     return true;
 }
 static bool
 CharsMatch(const char16_t* p, const char* q)
 {
     while (*q) {
-        if (*p++ != *q++)
+        if (*p++ != *q++) {
             return false;
+        }
     }
     return true;
 }
 END_TEST(testScriptInfo)
--- a/js/src/jsapi-tests/testScriptObject.cpp
+++ b/js/src/jsapi-tests/testScriptObject.cpp
@@ -11,18 +11,19 @@
 
 struct ScriptObjectFixture : public JSAPITest {
     static const int code_size;
     static const char code[];
     static char16_t uc_code[];
 
     ScriptObjectFixture()
     {
-        for (int i = 0; i < code_size; i++)
+        for (int i = 0; i < code_size; i++) {
             uc_code[i] = code[i];
+        }
     }
 
     bool tryScript(JS::HandleScript script)
     {
         CHECK(script);
 
         JS_GC(cx);
 
--- a/js/src/jsapi-tests/testSetPropertyIgnoringNamedGetter.cpp
+++ b/js/src/jsapi-tests/testSetPropertyIgnoringNamedGetter.cpp
@@ -27,39 +27,42 @@ class CustomProxyHandler : public Wrappe
     {
         return impl(cx, proxy, id, desc, true);
     }
 
     bool set(JSContext* cx, HandleObject proxy, HandleId id, HandleValue v, HandleValue receiver,
              ObjectOpResult& result) const override
     {
         Rooted<PropertyDescriptor> desc(cx);
-        if (!Wrapper::getPropertyDescriptor(cx, proxy, id, &desc))
+        if (!Wrapper::getPropertyDescriptor(cx, proxy, id, &desc)) {
             return false;
+        }
         return SetPropertyIgnoringNamedGetter(cx, proxy, id, v, receiver, desc, result);
     }
 
   private:
     bool impl(JSContext* cx, HandleObject proxy, HandleId id,
               MutableHandle<PropertyDescriptor> desc, bool ownOnly) const
     {
         if (JSID_IS_STRING(id)) {
             bool match;
-            if (!JS_StringEqualsAscii(cx, JSID_TO_STRING(id), "phantom", &match))
+            if (!JS_StringEqualsAscii(cx, JSID_TO_STRING(id), "phantom", &match)) {
                 return false;
+            }
             if (match) {
                 desc.object().set(proxy);
                 desc.attributesRef() = JSPROP_ENUMERATE;
                 desc.value().setInt32(42);
                 return true;
             }
         }
 
-        if (ownOnly)
+        if (ownOnly) {
             return Wrapper::getOwnPropertyDescriptor(cx, proxy, id, desc);
+        }
         return Wrapper::getPropertyDescriptor(cx, proxy, id, desc);
     }
 
 };
 
 const CustomProxyHandler customProxyHandler;
 
 
--- a/js/src/jsapi-tests/testSharedImmutableStringsCache.cpp
+++ b/js/src/jsapi-tests/testSharedImmutableStringsCache.cpp
@@ -68,14 +68,15 @@ BEGIN_TEST(testSharedImmutableStringsCac
 
     for (auto i : mozilla::IntegerRange(NUM_THREADS)) {
         auto cacheAndIndex = js_new<CacheAndIndex>(&cache, i);
         CHECK(cacheAndIndex);
         threads.infallibleEmplaceBack();
         CHECK(threads.back().init(getString, cacheAndIndex));
     }
 
-    for (auto& thread : threads)
+    for (auto& thread : threads) {
         thread.join();
+    }
 
     return true;
 }
 END_TEST(testSharedImmutableStringsCache)
--- a/js/src/jsapi-tests/testSlowScript.cpp
+++ b/js/src/jsapi-tests/testSlowScript.cpp
@@ -11,18 +11,19 @@ InterruptCallback(JSContext* cx)
 }
 
 static unsigned sRemain;
 
 static bool
 RequestInterruptCallback(JSContext* cx, unsigned argc, jsval* vp)
 {
     JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
-    if (!sRemain--)
+    if (!sRemain--) {
         JS_RequestInterruptCallback(cx);
+    }
     args.rval().setUndefined();
     return true;
 }
 
 BEGIN_TEST(testSlowScript)
 {
     JS_AddInterruptCallback(cx, InterruptCallback);
     JS_DefineFunction(cx, global, "requestInterruptCallback", RequestInterruptCallback, 0, 0);
--- a/js/src/jsapi-tests/testStructuredClone.cpp
+++ b/js/src/jsapi-tests/testStructuredClone.cpp
@@ -201,31 +201,33 @@ struct StructuredCloneTestPrincipals fin
 
     bool write(JSContext* cx, JSStructuredCloneWriter* writer) override {
         return JS_WriteUint32Pair(writer, rank, 0);
     }
 
     static bool read(JSContext* cx, JSStructuredCloneReader *reader, JSPrincipals** outPrincipals) {
         uint32_t rank;
         uint32_t unused;
-        if (!JS_ReadUint32Pair(reader, &rank, &unused))
+        if (!JS_ReadUint32Pair(reader, &rank, &unused)) {
             return false;
+        }
 
         *outPrincipals = new StructuredCloneTestPrincipals(rank);
         return !!*outPrincipals;
     }
 
     static void destroy(JSPrincipals* p) {
         auto p1 = static_cast<StructuredCloneTestPrincipals*>(p);
         delete p1;
     }
 
     static uint32_t getRank(JSPrincipals* p) {
-        if (!p)
+        if (!p) {
             return 0;
+        }
         return static_cast<StructuredCloneTestPrincipals*>(p)->rank;
     }
 
     static bool subsumes(JSPrincipals* a, JSPrincipals* b) {
         return getRank(a) > getRank(b);
     }
 
     static JSSecurityCallbacks securityCallbacks;
--- a/js/src/jsapi-tests/testThreadingConditionVariable.cpp
+++ b/js/src/jsapi-tests/testThreadingConditionVariable.cpp
@@ -15,18 +15,19 @@ struct TestState {
     js::ConditionVariable condition;
     bool flag;
     js::Thread testThread;
 
     explicit TestState(bool createThread = true)
       : mutex(js::mutexid::TestMutex),
         flag(false)
     {
-        if (createThread)
+        if (createThread) {
             MOZ_RELEASE_ASSERT(testThread.init(setFlag, this));
+        }
     }
 
     static void setFlag(TestState* state) {
         js::UniqueLock<js::Mutex> lock(state->mutex);
         state->flag = true;
         state->condition.notify_one();
     }
 
@@ -35,18 +36,19 @@ struct TestState {
     }
 };
 
 BEGIN_TEST(testThreadingConditionVariable)
 {
     auto state = mozilla::MakeUnique<TestState>();
     {
         js::UniqueLock<js::Mutex> lock(state->mutex);
-        while (!state->flag)
+        while (!state->flag) {
             state->condition.wait(lock);
+        }
     }
     state->join();
 
     CHECK(state->flag);
 
     return true;
 }
 END_TEST(testThreadingConditionVariable)
@@ -88,18 +90,19 @@ END_TEST(testThreadingConditionVariableU
 BEGIN_TEST(testThreadingConditionVariableUntilTimeout)
 {
     auto state = mozilla::MakeUnique<TestState>(false);
     {
         js::UniqueLock<js::Mutex> lock(state->mutex);
         while (!state->flag) {
             auto to = mozilla::TimeStamp::Now() + mozilla::TimeDuration::FromMilliseconds(10);
             js::CVStatus res = state->condition.wait_until(lock, to);
-            if (res == js::CVStatus::Timeout)
+            if (res == js::CVStatus::Timeout) {
                 break;
+            }
         }
     }
     CHECK(!state->flag);
 
     // Timeout in the past should return with timeout immediately.
     {
         js::UniqueLock<js::Mutex> lock(state->mutex);
         auto to = mozilla::TimeStamp::Now() - mozilla::TimeDuration::FromMilliseconds(10);
@@ -165,18 +168,19 @@ END_TEST(testThreadingConditionVariableF
 BEGIN_TEST(testThreadingConditionVariableForTimeout)
 {
     auto state = mozilla::MakeUnique<TestState>(false);
     {
         js::UniqueLock<js::Mutex> lock(state->mutex);
         while (!state->flag) {
             auto duration = mozilla::TimeDuration::FromMilliseconds(10);
             js::CVStatus res = state->condition.wait_for(lock, duration);
-            if (res == js::CVStatus::Timeout)
+            if (res == js::CVStatus::Timeout) {
                 break;
+            }
         }
     }
     CHECK(!state->flag);
 
     // Timeout in the past should return with timeout immediately.
     {
         js::UniqueLock<js::Mutex> lock(state->mutex);
         auto duration = mozilla::TimeDuration::FromMilliseconds(-10);
--- a/js/src/jsapi-tests/testThreadingExclusiveData.cpp
+++ b/js/src/jsapi-tests/testThreadingExclusiveData.cpp
@@ -25,25 +25,27 @@ struct CounterAndBit
     {
         MOZ_ASSERT(bit < NumThreads);
     }
 };
 
 void
 printDiagnosticMessage(uint8_t bit, uint64_t seen)
 {
-    if (!ShowDiagnostics)
+    if (!ShowDiagnostics) {
         return;
+    }
 
     fprintf(stderr, "Thread %d saw ", bit);
     for (auto i : mozilla::IntegerRange(NumThreads)) {
-        if (seen & (uint64_t(1) << i))
+        if (seen & (uint64_t(1) << i)) {
             fprintf(stderr, "1");
-        else
+        } else {
             fprintf(stderr, "0");
+        }
     }
     fprintf(stderr, "\n");
 }
 
 void
 setBitAndCheck(CounterAndBit* counterAndBit)
 {
     while (true) {
@@ -76,14 +78,15 @@ BEGIN_TEST(testExclusiveData)
 
     for (auto i : mozilla::IntegerRange(NumThreads)) {
         auto counterAndBit = js_new<CounterAndBit>(i, counter);
         CHECK(counterAndBit);
         CHECK(threads.emplaceBack());
         CHECK(threads.back().init(setBitAndCheck, counterAndBit));
     }
 
-    for (auto& thread : threads)
+    for (auto& thread : threads) {
         thread.join();
+    }
 
     return true;
 }
 END_TEST(testExclusiveData)
--- a/js/src/jsapi-tests/testThreadingThread.cpp
+++ b/js/src/jsapi-tests/testThreadingThread.cpp
@@ -69,18 +69,19 @@ BEGIN_TEST(testThreadingThreadVectorMove
     const static size_t N = 10;
     mozilla::Atomic<int> count(0);
     mozilla::Vector<js::Thread, 0, js::SystemAllocPolicy> v;
     for (auto i : mozilla::IntegerRange(N)) {
         CHECK(v.emplaceBack());
         CHECK(v.back().init([](mozilla::Atomic<int>* countp){(*countp)++;}, &count));
         CHECK(v.length() == i + 1);
     }
-    for (auto& th : v)
+    for (auto& th : v) {
         th.join();
+    }
     CHECK(count == 10);
     return true;
 }
 END_TEST(testThreadingThreadVectorMoveConstruct)
 
 // This test is checking that args are using "decay" copy, per spec. If we do
 // not use decay copy properly, the rvalue reference |bool&& b| in the
 // constructor will automatically become an lvalue reference |bool& b| in the
--- a/js/src/jsapi-tests/testTypedArrays.cpp
+++ b/js/src/jsapi-tests/testTypedArrays.cpp
@@ -110,18 +110,19 @@ TestPlainTypedArray(JSContext* cx)
 template<JSObject* CreateWithBuffer(JSContext*, JS::HandleObject, uint32_t, int32_t),
          JSObject* CreateFromArray(JSContext*, JS::HandleObject),
          typename Element,
          bool Shared,
          Element* GetData(JSObject*, bool*, const JS::AutoRequireNoGC&)>
 bool
 TestArrayFromBuffer(JSContext* cx)
 {
-    if (Shared && !cx->realm()->creationOptions().getSharedMemoryAndAtomicsEnabled())
+    if (Shared && !cx->realm()->creationOptions().getSharedMemoryAndAtomicsEnabled()) {
         return true;
+    }
 
     size_t elts = 8;
     size_t nbytes = elts * sizeof(Element);
     RootedObject buffer(cx, Shared ? JS_NewSharedArrayBuffer(cx, nbytes)
                                    : JS_NewArrayBuffer(cx, nbytes));
     {
         JS::AutoCheckCannotGC nogc;
         bool isShared;
--- a/js/src/jsapi-tests/testUTF8.cpp
+++ b/js/src/jsapi-tests/testUTF8.cpp
@@ -14,31 +14,33 @@
 #include "jsapi-tests/tests.h"
 
 BEGIN_TEST(testUTF8_badUTF8)
 {
     static const char badUTF8[] = "...\xC0...";
     JSString* str = JS_NewStringCopyZ(cx, badUTF8);
     CHECK(str);
     char16_t ch;
-    if (!JS_GetStringCharAt(cx, str, 3, &ch))
+    if (!JS_GetStringCharAt(cx, str, 3, &ch)) {
         return false;
+    }
     CHECK(ch == 0x00C0);
     return true;
 }
 END_TEST(testUTF8_badUTF8)
 
 BEGIN_TEST(testUTF8_bigUTF8)
 {
     static const char bigUTF8[] = "...\xFB\xBF\xBF\xBF\xBF...";
     JSString* str = JS_NewStringCopyZ(cx, bigUTF8);
     CHECK(str);
     char16_t ch;
-    if (!JS_GetStringCharAt(cx, str, 3, &ch))
+    if (!JS_GetStringCharAt(cx, str, 3, &ch)) {
         return false;
+    }
     CHECK(ch == 0x00FB);
     return true;
 }
 END_TEST(testUTF8_bigUTF8)
 
 BEGIN_TEST(testUTF8_badSurrogate)
 {
     static const char16_t badSurrogate[] = { 'A', 'B', 'C', 0xDEEE, 'D', 'E', 0 };
--- a/js/src/jsapi-tests/testUbiNode.cpp
+++ b/js/src/jsapi-tests/testUbiNode.cpp
@@ -414,18 +414,19 @@ BEGIN_TEST(test_ubiPostOrder)
             expectedEdges.remove(e);
             return true;
         };
 
         CHECK(traversal.traverse(onNode, onEdge));
     }
 
     fprintf(stderr, "visited.length() = %lu\n", (unsigned long) visited.length());
-    for (size_t i = 0; i < visited.length(); i++)
+    for (size_t i = 0; i < visited.length(); i++) {
         fprintf(stderr, "visited[%lu] = '%c'\n", (unsigned long) i, visited[i]);
+    }
 
     CHECK(visited.length() == 8);
     CHECK(visited[0] == 'g');
     CHECK(visited[1] == 'f');
     CHECK(visited[2] == 'e');
     CHECK(visited[3] == 'd');
     CHECK(visited[4] == 'c');
     CHECK(visited[5] == 'b');
--- a/js/src/jsapi-tests/testUncaughtSymbol.cpp
+++ b/js/src/jsapi-tests/testUncaughtSymbol.cpp
@@ -36,18 +36,21 @@ GetSymbolExceptionType(JSContext* cx)
     JS::RootedValue exn(cx);
     MOZ_RELEASE_ASSERT(JS_GetPendingException(cx, &exn));
     MOZ_RELEASE_ASSERT(exn.isSymbol());
     JS_ClearPendingException(cx);
 
     js::ErrorReport report(cx);
     MOZ_RELEASE_ASSERT(report.init(cx, exn, js::ErrorReport::WithSideEffects));
 
-    if (strcmp(report.toStringResult().c_str(), "uncaught exception: Symbol(Symbol.iterator)") == 0)
+    if (strcmp(report.toStringResult().c_str(), "uncaught exception: Symbol(Symbol.iterator)") == 0) {
         return SYMBOL_ITERATOR;
-    if (strcmp(report.toStringResult().c_str(), "uncaught exception: Symbol(foo)") == 0)
+    }
+    if (strcmp(report.toStringResult().c_str(), "uncaught exception: Symbol(foo)") == 0) {
         return SYMBOL_FOO;
-    if (strcmp(report.toStringResult().c_str(), "uncaught exception: Symbol()") == 0)
+    }
+    if (strcmp(report.toStringResult().c_str(), "uncaught exception: Symbol()") == 0) {
         return SYMBOL_EMPTY;
+    }
     MOZ_CRASH("Unexpected symbol");
 }
 
 END_TEST(testUncaughtSymbol)
--- a/js/src/jsapi-tests/testWasmLEB128.cpp
+++ b/js/src/jsapi-tests/testWasmLEB128.cpp
@@ -6,87 +6,97 @@
 
 #include "jsapi-tests/tests.h"
 
 #include "wasm/WasmValidate.h"
 
 static bool WriteValidBytes(js::wasm::Encoder& encoder, bool* passed)
 {
     *passed = false;
-    if (!encoder.empty())
+    if (!encoder.empty()) {
         return true;
+    }
 
     // These remain the same under LEB128 unsigned encoding
     if (!encoder.writeVarU32(0x0) ||
         !encoder.writeVarU32(0x1) ||
         !encoder.writeVarU32(0x42))
     {
         return false;
     }
 
     // 0x01 0x80
-    if (!encoder.writeVarU32(0x80))
+    if (!encoder.writeVarU32(0x80)) {
         return false;
+    }
 
     // 0x03 0x80
-    if (!encoder.writeVarU32(0x180))
+    if (!encoder.writeVarU32(0x180)) {
         return false;
+    }
 
-    if (encoder.empty())
+    if (encoder.empty()) {
         return true;
-    if (encoder.currentOffset() != 7)
+    }
+    if (encoder.currentOffset() != 7) {
         return true;
+    }
     *passed = true;
     return true;
 }
 
 BEGIN_TEST(testWasmLEB128_encoding)
 {
     using namespace js;
     using namespace wasm;
 
     Bytes bytes;
     Encoder encoder(bytes);
 
     bool passed;
-    if (!WriteValidBytes(encoder, &passed))
+    if (!WriteValidBytes(encoder, &passed)) {
         return false;
+    }
     CHECK(passed);
 
     size_t i = 0;
     CHECK(bytes[i++] == 0x0);
     CHECK(bytes[i++] == 0x1);
     CHECK(bytes[i++] == 0x42);
 
     CHECK(bytes[i++] == 0x80);
     CHECK(bytes[i++] == 0x01);
 
     CHECK(bytes[i++] == 0x80);
     CHECK(bytes[i++] == 0x03);
 
-    if (i + 1 < bytes.length())
+    if (i + 1 < bytes.length()) {
         CHECK(bytes[i++] == 0x00);
+    }
     return true;
 }
 END_TEST(testWasmLEB128_encoding)
 
 BEGIN_TEST(testWasmLEB128_valid_decoding)
 {
     using namespace js;
     using namespace wasm;
 
     Bytes bytes;
-    if (!bytes.append(0x0) || !bytes.append(0x1) || !bytes.append(0x42))
+    if (!bytes.append(0x0) || !bytes.append(0x1) || !bytes.append(0x42)) {
         return false;
+    }
 
-    if (!bytes.append(0x80) || !bytes.append(0x01))
+    if (!bytes.append(0x80) || !bytes.append(0x01)) {
         return false;
+    }
 
-    if (!bytes.append(0x80) || !bytes.append(0x03))
+    if (!bytes.append(0x80) || !bytes.append(0x03)) {
         return false;
+    }
 
     {
         // Fallible decoding
         Decoder decoder(bytes);
         uint32_t value;
 
         CHECK(decoder.readVarU32(&value) && value == 0x0);
         CHECK(decoder.readVarU32(&value) && value == 0x1);
@@ -121,22 +131,24 @@ END_TEST(testWasmLEB128_valid_decoding)
 
 BEGIN_TEST(testWasmLEB128_invalid_decoding)
 {
     using namespace js;
     using namespace wasm;
 
     Bytes bytes;
     // Fill bits as per 28 encoded bits
-    if (!bytes.append(0x80) || !bytes.append(0x80) || !bytes.append(0x80) || !bytes.append(0x80))
+    if (!bytes.append(0x80) || !bytes.append(0x80) || !bytes.append(0x80) || !bytes.append(0x80)) {
         return false;
+    }
 
     // Test last valid values
-    if (!bytes.append(0x00))
+    if (!bytes.append(0x00)) {
         return false;
+    }
 
     for (uint8_t i = 0; i < 0x0F; i++) {
         bytes[4] = i;
 
         {
             Decoder decoder(bytes);
             uint32_t value;
             CHECK(decoder.readVarU32(&value));
--- a/js/src/jsapi-tests/testWeakMap.cpp
+++ b/js/src/jsapi-tests/testWeakMap.cpp
@@ -96,34 +96,36 @@ BEGIN_TEST(testWeakMap_keyDelegates)
 
     /*
      * Perform an incremental GC, introducing an unmarked CCW to force the map
      * zone to finish marking before the delegate zone.
      */
     CHECK(newCCW(map, delegateRoot));
     js::SliceBudget budget(js::WorkBudget(1000000));
     cx->runtime()->gc.startDebugGC(GC_NORMAL, budget);
-    while (JS::IsIncrementalGCInProgress(cx))
+    while (JS::IsIncrementalGCInProgress(cx)) {
         cx->runtime()->gc.debugGCSlice(budget);
+    }
 #ifdef DEBUG
     CHECK(map->zone()->lastSweepGroupIndex() < delegateRoot->zone()->lastSweepGroupIndex());
 #endif
 
     /* Add our entry to the weakmap. */
     JS::RootedValue val(cx, JS::Int32Value(1));
     CHECK(SetWeakMapEntry(cx, map, key, val));
     CHECK(checkSize(map, 1));
 
     /* Check the delegate keeps the entry alive even if the key is not reachable. */
     key = nullptr;
     CHECK(newCCW(map, delegateRoot));
     budget = js::SliceBudget(js::WorkBudget(100000));
     cx->runtime()->gc.startDebugGC(GC_NORMAL, budget);
-    while (JS::IsIncrementalGCInProgress(cx))
+    while (JS::IsIncrementalGCInProgress(cx)) {
         cx->runtime()->gc.debugGCSlice(budget);
+    }
     CHECK(checkSize(map, 1));
 
     /*
      * Check that the zones finished marking at the same time, which is
      * necessary because of the presence of the delegate and the CCW.
      */
 #ifdef DEBUG
     CHECK(map->zone()->lastSweepGroupIndex() == delegateRoot->zone()->lastSweepGroupIndex());
@@ -136,18 +138,19 @@ BEGIN_TEST(testWeakMap_keyDelegates)
     CHECK(checkSize(map, 0));
 
     return true;
 }
 
 static size_t
 DelegateObjectMoved(JSObject* obj, JSObject* old)
 {
-    if (!keyDelegate)
+    if (!keyDelegate) {
         return 0;  // Object got moved before we set keyDelegate to point to it.
+    }
 
     MOZ_RELEASE_ASSERT(keyDelegate == old);
     keyDelegate = obj;
     return 0;
 }
 
 static JSObject* GetKeyDelegate(JSObject* obj)
 {
@@ -165,40 +168,43 @@ JSObject* newKey()
         JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(1),
         JS_NULL_CLASS_OPS,
         JS_NULL_CLASS_SPEC,
         &keyClassExtension,
         JS_NULL_OBJECT_OPS
     };
 
     JS::RootedObject key(cx, JS_NewObject(cx, Jsvalify(&keyClass)));
-    if (!key)
+    if (!key) {
         return nullptr;
+    }
 
     return key;
 }
 
 JSObject* newCCW(JS::HandleObject sourceZone, JS::HandleObject destZone)
 {
     /*
      * Now ensure that this zone will be swept first by adding a cross
      * compartment wrapper to a new objct in the same zone as the
      * delegate obejct.
      */
     JS::RootedObject object(cx);
     {
         JSAutoRealm ar(cx, destZone);
         object = JS_NewPlainObject(cx);
-        if (!object)
+        if (!object) {
             return nullptr;
+        }
     }
     {
         JSAutoRealm ar(cx, sourceZone);
-        if (!JS_WrapObject(cx, &object))
+        if (!JS_WrapObject(cx, &object)) {
             return nullptr;
+        }
     }
 
     // In order to test the SCC algorithm, we need the wrapper/wrappee to be
     // tenured.
     cx->runtime()->gc.evictNursery();
 
     return object;
 }
@@ -232,18 +238,19 @@ JSObject* newDelegate()
         &delegateClassExtension,
         JS_NULL_OBJECT_OPS
     };
 
     /* Create the global object. */
     JS::RealmOptions options;
     JS::RootedObject global(cx, JS_NewGlobalObject(cx, Jsvalify(&delegateClass), nullptr,
                                                    JS::FireOnNewGlobalHook, options));
-    if (!global)
+    if (!global) {
         return nullptr;
+    }
 
     JS_SetReservedSlot(global, 0, JS::Int32Value(42));
     return global;
 }
 
 bool
 checkSize(JS::HandleObject map, uint32_t expected)
 {
--- a/js/src/jsapi-tests/testXDR.cpp
+++ b/js/src/jsapi-tests/testXDR.cpp
@@ -24,24 +24,26 @@ GetBuildId(JS::BuildIdCharVector* buildI
 static JSScript*
 FreezeThaw(JSContext* cx, JS::HandleScript script)
 {
     JS::SetProcessBuildIdOp(::GetBuildId);
 
     // freeze
     JS::TranscodeBuffer buffer;
     JS::TranscodeResult rs = JS::EncodeScript(cx, buffer, script);
-    if (rs != JS::TranscodeResult_Ok)
+    if (rs != JS::TranscodeResult_Ok) {
         return nullptr;
+    }
 
     // thaw
     JS::RootedScript script2(cx);
     rs = JS::DecodeScript(cx, buffer, &script2);
-    if (rs != JS::TranscodeResult_Ok)
+    if (rs != JS::TranscodeResult_Ok) {
         return nullptr;
+    }
     return script2;
 }
 
 enum TestCase {
     TEST_FIRST,
     TEST_SCRIPT = TEST_FIRST,
     TEST_FUNCTION,
     TEST_SERIALIZED_FUNCTION,
--- a/js/src/jsapi-tests/tests.cpp
+++ b/js/src/jsapi-tests/tests.cpp
@@ -12,25 +12,28 @@
 #include "js/Initialization.h"
 #include "js/RootingAPI.h"
 
 JSAPITest* JSAPITest::list;
 
 bool JSAPITest::init()
 {
     cx = createContext();
-    if (!cx)
+    if (!cx) {
         return false;
+    }
     js::UseInternalJobQueues(cx);
-    if (!JS::InitSelfHostedCode(cx))
+    if (!JS::InitSelfHostedCode(cx)) {
         return false;
+    }
     global.init(cx);
     createGlobal();
-    if (!global)
+    if (!global) {
         return false;
+    }
     JS::EnterRealm(cx, global);
     return true;
 }
 
 void JSAPITest::uninit()
 {
     if (global) {
         JS::LeaveRealm(cx, nullptr);
@@ -79,25 +82,27 @@ JSObject* JSAPITest::createGlobal(JSPrin
     /* Create the global object. */
     JS::RootedObject newGlobal(cx);
     JS::RealmOptions options;
 #ifdef ENABLE_STREAMS
     options.creationOptions().setStreamsEnabled(true);
 #endif
     newGlobal = JS_NewGlobalObject(cx, getGlobalClass(), principals, JS::FireOnNewGlobalHook,
                                    options);
-    if (!newGlobal)
+    if (!newGlobal) {
         return nullptr;
+    }
 
     JSAutoRealm ar(cx, newGlobal);
 
     // Populate the global object with the standard globals like Object and
     // Array.
-    if (!JS::InitRealmStandardClasses(cx))
+    if (!JS::InitRealmStandardClasses(cx)) {
         return nullptr;
+    }
 
     global = newGlobal;
     return newGlobal;
 }
 
 int main(int argc, char* argv[])
 {
     int total = 0;
@@ -106,18 +111,19 @@ int main(int argc, char* argv[])
 
     if (!JS_Init()) {
         printf("TEST-UNEXPECTED-FAIL | jsapi-tests | JS_Init() failed.\n");
         return 1;
     }
 
     for (JSAPITest* test = JSAPITest::list; test; test = test->next) {
         const char* name = test->name();
-        if (filter && strstr(name, filter) == nullptr)
+        if (filter && strstr(name, filter) == nullptr) {
             continue;
+        }
 
         total += 1;
 
         printf("%s\n", name);
         if (!test->init()) {
             printf("TEST-UNEXPECTED-FAIL | %s | Failed to initialize.\n", name);
             failures++;
             test->uninit();
@@ -126,18 +132,19 @@ int main(int argc, char* argv[])
 
         if (test->run(test->global)) {
             printf("TEST-PASS | %s | ok\n", name);
         } else {
             JSAPITestString messages = test->messages();
             printf("%s | %s | %.*s\n",
                    (test->knownFail ? "TEST-KNOWN-FAIL" : "TEST-UNEXPECTED-FAIL"),
                    name, (int) messages.length(), messages.begin());
-            if (!test->knownFail)
+            if (!test->knownFail) {
                 failures++;
+            }
         }
         test->uninit();
     }
 
     MOZ_RELEASE_ASSERT(!JSRuntime::hasLiveRuntimes());
     JS_ShutDown();
 
     if (failures) {
--- a/js/src/jsapi-tests/tests.h
+++ b/js/src/jsapi-tests/tests.h
@@ -31,24 +31,26 @@ class JSAPITestString {
     JSAPITestString(const JSAPITestString& s) { *this += s; }
 
     const char* begin() const { return chars.begin(); }
     const char* end() const { return chars.end(); }
     size_t length() const { return chars.length(); }
     void clear() { chars.clearAndFree(); }
 
     JSAPITestString& operator +=(const char* s) {
-        if (!chars.append(s, strlen(s)))
+        if (!chars.append(s, strlen(s))) {
             abort();
+        }
         return *this;
     }
 
     JSAPITestString& operator +=(const JSAPITestString& s) {
-        if (!chars.append(s.begin(), s.length()))
+        if (!chars.append(s.begin(), s.length())) {
             abort();
+        }
         return *this;
     }
 };
 
 inline JSAPITestString
 operator+(const JSAPITestString& a, const char* b)
 {
     JSAPITestString result = a;
@@ -99,18 +101,19 @@ class JSAPITest
     bool execDontReport(const char* bytes, const char* filename, int lineno);
 
 #define EVAL(s, vp) do { if (!evaluate(s, __FILE__, __LINE__, vp)) return false; } while (false)
 
     bool evaluate(const char* bytes, const char* filename, int lineno, JS::MutableHandleValue vp);
 
     JSAPITestString jsvalToSource(JS::HandleValue v) {
         if (JSString* str = JS_ValueToSource(cx, v)) {
-            if (JS::UniqueChars bytes = JS_EncodeStringToLatin1(cx, str))
+            if (JS::UniqueChars bytes = JS_EncodeStringToLatin1(cx, str)) {
                 return JSAPITestString(bytes.get());
+            }
         }
         JS_ClearPendingException(cx);
         return JSAPITestString("<<error converting value to string>>");
     }
 
     JSAPITestString toSource(long v) {
         char buf[40];
         sprintf(buf, "%ld", v);
@@ -226,25 +229,27 @@ class JSAPITest
 
         if (JS_IsExceptionPending(cx)) {
             js::gc::AutoSuppressGC gcoff(cx);
             JS::RootedValue v(cx);
             JS_GetPendingException(cx, &v);
             JS_ClearPendingException(cx);
             JSString* s = JS::ToString(cx, v);
             if (s) {
-                if (JS::UniqueChars bytes = JS_EncodeStringToLatin1(cx, s))
+                if (JS::UniqueChars bytes = JS_EncodeStringToLatin1(cx, s)) {
                     message += bytes.get();
+                }
             }
         }
 
         fprintf(stderr, "%.*s\n", int(message.length()), message.begin());
 
-        if (msgs.length() != 0)
+        if (msgs.length() != 0) {
             msgs += " | ";
+        }
         msgs += message;
         return false;
     }
 
     JSAPITestString messages() const { return msgs; }
 
     static const JSClass * basicGlobalClass() {
         static const JSClassOps cOps = {
@@ -263,21 +268,23 @@ class JSAPITest
   protected:
     static bool
     print(JSContext* cx, unsigned argc, JS::Value* vp)
     {
         JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
 
         for (unsigned i = 0; i < args.length(); i++) {
             JSString* str = JS::ToString(cx, args[i]);
-            if (!str)
+            if (!str) {
                 return false;
+            }
             JS::UniqueChars bytes = JS_EncodeStringToLatin1(cx, str);
-            if (!bytes)
+            if (!bytes) {
                 return false;
+            }
             printf("%s%s", i ? " " : "", bytes.get());
         }
 
         putchar('\n');
         fflush(stdout);
         args.rval().setUndefined();
         return true;
     }
@@ -299,18 +306,19 @@ class JSAPITest
 #endif
         ;
 
         JS_SetNativeStackQuota(cx, MAX_STACK_SIZE);
     }
 
     virtual JSContext* createContext() {
         JSContext* cx = JS_NewContext(8L * 1024 * 1024);
-        if (!cx)
+        if (!cx) {
             return nullptr;
+        }
         JS::SetWarningReporter(cx, &reportWarning);
         setNativeStackQuota(cx);
         return cx;
     }
 
     virtual void destroyContext() {
         MOZ_RELEASE_ASSERT(cx);
         JS_DestroyContext(cx);
@@ -371,20 +379,22 @@ class JSAPITest
  */
 class TempFile {
     const char* name;
     FILE* stream;
 
   public:
     TempFile() : name(), stream() { }
     ~TempFile() {
-        if (stream)
+        if (stream) {
             close();
-        if (name)
+        }
+        if (name) {
             remove();
+        }
     }
 
     /*
      * Return a stream for a temporary file named |fileName|. Infallible.
      * Use only once per TempFile instance. If the file is not explicitly
      * closed and deleted via the member functions below, this object's
      * destructor will clean them up.
      */
@@ -485,18 +495,19 @@ class AutoLeaveZeal
         JS_GetGCZealBits(cx_, &zealBits_, &frequency_, &dummy);
         JS_SetGCZeal(cx_, 0, 0);
         JS::PrepareForFullGC(cx_);
         JS::NonIncrementalGC(cx_, GC_SHRINK, JS::gcreason::DEBUG_GC);
     }
     ~AutoLeaveZeal() {
         JS_SetGCZeal(cx_, 0, 0);
         for (size_t i = 0; i < sizeof(zealBits_) * 8; i++) {
-            if (zealBits_ & (1 << i))
+            if (zealBits_ & (1 << i)) {
                 JS_SetGCZeal(cx_, i, frequency_);
+            }
         }
 
 #ifdef DEBUG
         uint32_t zealBitsAfter, frequencyAfter, dummy;
         JS_GetGCZealBits(cx_, &zealBitsAfter, &frequencyAfter, &dummy);
         MOZ_ASSERT(zealBitsAfter == zealBits_);
         MOZ_ASSERT(frequencyAfter == frequency_);
 #endif