Bug 1488698 - Always use braces for if/for/while statements in js/src/frontend, part 3. r=arai
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 06 Sep 2018 10:30:36 +0200
changeset 435717 719bd7da3367b47f19800b1761ecbd5d97a49fa2
parent 435716 f758714e4ed9a93b2db83be95fb669f53658a58b
child 435718 9f7beee7269b10833e0ca8446195cc354dac63c3
push id34618
push userbtara@mozilla.com
push dateTue, 11 Sep 2018 22:13:11 +0000
treeherdermozilla-central@1169e8a4ca2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1488698
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1488698 - Always use braces for if/for/while statements in js/src/frontend, part 3. r=arai
js/src/frontend/CForEmitter.cpp
js/src/frontend/DoWhileEmitter.cpp
js/src/frontend/EmitterScope.cpp
js/src/frontend/EmitterScope.h
js/src/frontend/FoldConstants.cpp
js/src/frontend/ForInEmitter.cpp
js/src/frontend/ForOfEmitter.cpp
js/src/frontend/ForOfLoopControl.cpp
js/src/frontend/FullParseHandler.h
js/src/frontend/IfEmitter.cpp
--- a/js/src/frontend/CForEmitter.cpp
+++ b/js/src/frontend/CForEmitter.cpp
@@ -26,18 +26,19 @@ CForEmitter::CForEmitter(BytecodeEmitter
 bool
 CForEmitter::emitInit(const Maybe<uint32_t>& initPos)
 {
     MOZ_ASSERT(state_ == State::Start);
 
     loopInfo_.emplace(bce_, StatementKind::ForLoop);
 
     if (initPos) {
-        if (!bce_->updateSourceCoordNotes(*initPos))
+        if (!bce_->updateSourceCoordNotes(*initPos)) {
             return false;
+        }
     }
 
 #ifdef DEBUG
     state_ = State::Init;
 #endif
     return true;
 }
 
@@ -59,40 +60,46 @@ CForEmitter::emitBody(Cond cond, const M
         // captured, thus requiring a fresh environment each iteration. If
         // a lexical scope exists for the head, it must be the innermost
         // one. If that scope has closed-over bindings inducing an
         // environment, recreate the current environment.
         MOZ_ASSERT(headLexicalEmitterScopeForLet_ == bce_->innermostEmitterScope());
         MOZ_ASSERT(headLexicalEmitterScopeForLet_->scope(bce_)->kind() == ScopeKind::Lexical);
 
         if (headLexicalEmitterScopeForLet_->hasEnvironment()) {
-            if (!bce_->emit1(JSOP_FRESHENLEXICALENV))
+            if (!bce_->emit1(JSOP_FRESHENLEXICALENV)) {
                 return false;
+            }
         }
     }
 
-    if (!bce_->newSrcNote(SRC_FOR, &noteIndex_))
+    if (!bce_->newSrcNote(SRC_FOR, &noteIndex_)) {
         return false;
-    if (!bce_->emit1(JSOP_NOP))
+    }
+    if (!bce_->emit1(JSOP_NOP)) {
         return false;
+    }
 
     biasedTop_ = bce_->offset();
 
     if (cond_ == Cond::Present) {
         // Goto the loop condition, which branches back to iterate.
-        if (!loopInfo_->emitEntryJump(bce_))
+        if (!loopInfo_->emitEntryJump(bce_)) {
             return false;
+        }
     }
 
-    if (!loopInfo_->emitLoopHead(bce_, bodyPos))
+    if (!loopInfo_->emitLoopHead(bce_, bodyPos)) {
         return false;
+    }
 
     if (cond_ == Cond::Missing) {
-        if (!loopInfo_->emitLoopEntry(bce_, bodyPos))
+        if (!loopInfo_->emitLoopEntry(bce_, bodyPos)) {
             return false;
+        }
     }
 
     tdzCache_.emplace(bce_);
 
 #ifdef DEBUG
     state_ = State::Body;
 #endif
     return true;
@@ -103,38 +110,41 @@ CForEmitter::emitUpdate(Update update, c
 {
     MOZ_ASSERT(state_ == State::Body);
     update_ = update;
     tdzCache_.reset();
 
     // Set loop and enclosing "update" offsets, for continue.  Note that we
     // continue to immediately *before* the block-freshening: continuing must
     // refresh the block.
-    if (!loopInfo_->emitContinueTarget(bce_))
+    if (!loopInfo_->emitContinueTarget(bce_)) {
         return false;
+    }
 
     // ES 13.7.4.8 step 3.e. The per-iteration freshening.
     if (headLexicalEmitterScopeForLet_) {
         MOZ_ASSERT(headLexicalEmitterScopeForLet_ == bce_->innermostEmitterScope());
         MOZ_ASSERT(headLexicalEmitterScopeForLet_->scope(bce_)->kind() == ScopeKind::Lexical);
 
         if (headLexicalEmitterScopeForLet_->hasEnvironment()) {
-            if (!bce_->emit1(JSOP_FRESHENLEXICALENV))
+            if (!bce_->emit1(JSOP_FRESHENLEXICALENV)) {
                 return false;
+            }
         }
     }
 
     // The update code may not be executed at all; it needs its own TDZ
     // cache.
     if (update_ == Update::Present) {
         tdzCache_.emplace(bce_);
 
         if (updatePos) {
-            if (!bce_->updateSourceCoordNotes(*updatePos))
+            if (!bce_->updateSourceCoordNotes(*updatePos)) {
                 return false;
+            }
         }
     }
 
 #ifdef DEBUG
     state_ = State::Update;
 #endif
     return true;
 }
@@ -142,48 +152,53 @@ CForEmitter::emitUpdate(Update update, c
 bool
 CForEmitter::emitCond(const Maybe<uint32_t>& forPos,
                       const Maybe<uint32_t>& condPos,
                       const Maybe<uint32_t>& endPos)
 {
     MOZ_ASSERT(state_ == State::Update);
 
     if (update_ == Update::Present) {
-        if (!bce_->emit1(JSOP_POP))                   //
+        if (!bce_->emit1(JSOP_POP)) {                 //
             return false;
+        }
 
         // Restore the absolute line number for source note readers.
         if (endPos) {
             uint32_t lineNum =
                 bce_->parser->errorReporter().lineAt(*endPos);
             if (bce_->currentLine() != lineNum) {
-                if (!bce_->newSrcNote2(SRC_SETLINE, ptrdiff_t(lineNum)))
+                if (!bce_->newSrcNote2(SRC_SETLINE, ptrdiff_t(lineNum))) {
                     return false;
+                }
                 bce_->current->currentLine = lineNum;
                 bce_->current->lastColumn = 0;
             }
         }
     }
 
-    if (update_ == Update::Present)
+    if (update_ == Update::Present) {
         tdzCache_.reset();
+    }
 
     condOffset_ = bce_->offset();
 
     if (cond_ == Cond::Present) {
-        if (!loopInfo_->emitLoopEntry(bce_, condPos))
+        if (!loopInfo_->emitLoopEntry(bce_, condPos)) {
             return false;
+        }
     } else if (update_ == Update::Missing) {
         // If there is no condition clause and no update clause, mark
         // the loop-ending "goto" with the location of the "for".
         // This ensures that the debugger will stop on each loop
         // iteration.
         if (forPos) {
-            if (!bce_->updateSourceCoordNotes(*forPos))
+            if (!bce_->updateSourceCoordNotes(*forPos)) {
                 return false;
+            }
         }
     }
 
 #ifdef DEBUG
     state_ = State::Cond;
 #endif
     return true;
 }
@@ -200,35 +215,37 @@ CForEmitter::emitEnd()
     }
     if (!bce_->setSrcNoteOffset(noteIndex_, SrcNote::For::UpdateOffset,
                                 loopInfo_->continueTargetOffset() - biasedTop_))
     {
         return false;
     }
 
     // If no loop condition, just emit a loop-closing jump.
-    if (!loopInfo_->emitLoopEnd(bce_, cond_ == Cond::Present ? JSOP_IFNE : JSOP_GOTO))
+    if (!loopInfo_->emitLoopEnd(bce_, cond_ == Cond::Present ? JSOP_IFNE : JSOP_GOTO)) {
         return false;                                 //
+    }
 
     // The third note offset helps us find the loop-closing jump.
     if (!bce_->setSrcNoteOffset(noteIndex_, SrcNote::For::BackJumpOffset,
                                 loopInfo_->loopEndOffset() - biasedTop_))
 
     {
         return false;
     }
 
     if (!bce_->tryNoteList.append(JSTRY_LOOP, bce_->stackDepth, loopInfo_->headOffset(),
                                   loopInfo_->breakTargetOffset()))
     {
         return false;
     }
 
-    if (!loopInfo_->patchBreaksAndContinues(bce_))
+    if (!loopInfo_->patchBreaksAndContinues(bce_)) {
         return false;
+    }
 
     loopInfo_.reset();
 
 #ifdef DEBUG
     state_ = State::End;
 #endif
     return true;
 }
--- a/js/src/frontend/DoWhileEmitter.cpp
+++ b/js/src/frontend/DoWhileEmitter.cpp
@@ -22,63 +22,70 @@ DoWhileEmitter::DoWhileEmitter(BytecodeE
 
 bool
 DoWhileEmitter::emitBody(const Maybe<uint32_t>& doPos, const Maybe<uint32_t>& bodyPos)
 {
     MOZ_ASSERT(state_ == State::Start);
 
     // Ensure that the column of the 'do' is set properly.
     if (doPos) {
-        if (!bce_->updateSourceCoordNotes(*doPos))
+        if (!bce_->updateSourceCoordNotes(*doPos)) {
             return false;
+        }
     }
 
     // We need a nop here to make it possible to set a breakpoint on `do`.
-    if (!bce_->emit1(JSOP_NOP))
+    if (!bce_->emit1(JSOP_NOP)) {
         return false;
+    }
 
     // Emit an annotated nop so IonBuilder can recognize the 'do' loop.
-    if (!bce_->newSrcNote3(SRC_DO_WHILE, 0, 0, &noteIndex_))
+    if (!bce_->newSrcNote3(SRC_DO_WHILE, 0, 0, &noteIndex_)) {
         return false;
+    }
 
     loopInfo_.emplace(bce_, StatementKind::DoLoop);
 
-    if (!loopInfo_->emitLoopHead(bce_, bodyPos))
+    if (!loopInfo_->emitLoopHead(bce_, bodyPos)) {
         return false;
+    }
 
-    if (!loopInfo_->emitLoopEntry(bce_, Nothing()))
+    if (!loopInfo_->emitLoopEntry(bce_, Nothing())) {
         return false;
+    }
 
 #ifdef DEBUG
     state_ = State::Body;
 #endif
     return true;
 }
 
 bool
 DoWhileEmitter::emitCond()
 {
     MOZ_ASSERT(state_ == State::Body);
 
-    if (!loopInfo_->emitContinueTarget(bce_))
+    if (!loopInfo_->emitContinueTarget(bce_)) {
         return false;
+    }
 
 #ifdef DEBUG
     state_ = State::Cond;
 #endif
     return true;
 }
 
 bool
 DoWhileEmitter::emitEnd()
 {
     MOZ_ASSERT(state_ == State::Cond);
 
-    if (!loopInfo_->emitLoopEnd(bce_, JSOP_IFNE))
+    if (!loopInfo_->emitLoopEnd(bce_, JSOP_IFNE)) {
         return false;
+    }
 
     if (!bce_->tryNoteList.append(JSTRY_LOOP, bce_->stackDepth, loopInfo_->headOffset(),
                                   loopInfo_->breakTargetOffset()))
     {
         return false;
     }
 
     // Update the annotations with the update and back edge positions, for
@@ -89,18 +96,19 @@ DoWhileEmitter::emitEnd()
         return false;
     }
     if (!bce_->setSrcNoteOffset(noteIndex_, SrcNote::DoWhile::BackJumpOffset,
                                 loopInfo_->loopEndOffsetFromLoopHead()))
     {
         return false;
     }
 
-    if (!loopInfo_->patchBreaksAndContinues(bce_))
+    if (!loopInfo_->patchBreaksAndContinues(bce_)) {
         return false;
+    }
 
     loopInfo_.reset();
 
 #ifdef DEBUG
     state_ = State::End;
 #endif
     return true;
 }
--- a/js/src/frontend/EmitterScope.cpp
+++ b/js/src/frontend/EmitterScope.cpp
@@ -28,18 +28,19 @@ EmitterScope::EmitterScope(BytecodeEmitt
     scopeIndex_(ScopeNote::NoScopeIndex),
     noteIndex_(ScopeNote::NoScopeNoteIndex)
 {}
 
 static inline void
 MarkAllBindingsClosedOver(LexicalScope::Data& data)
 {
     TrailingNamesArray& names = data.trailingNames;
-    for (uint32_t i = 0; i < data.length; i++)
+    for (uint32_t i = 0; i < data.length; i++) {
         names[i] = BindingName(names[i].name(), true);
+    }
 }
 
 bool
 EmitterScope::ensureCache(BytecodeEmitter* bce)
 {
     return nameCache_.acquire(bce->cx);
 }
 
@@ -55,36 +56,38 @@ EmitterScope::checkSlotLimits(BytecodeEm
     }
     return true;
 }
 
 bool
 EmitterScope::checkEnvironmentChainLength(BytecodeEmitter* bce)
 {
     uint32_t hops;
-    if (EmitterScope* emitterScope = enclosing(&bce))
+    if (EmitterScope* emitterScope = enclosing(&bce)) {
         hops = emitterScope->environmentChainLength_;
-    else
+    } else {
         hops = bce->sc->compilationEnclosingScope()->environmentChainLength();
+    }
 
     if (hops >= ENVCOORD_HOPS_LIMIT - 1) {
         bce->reportError(nullptr, JSMSG_TOO_DEEP, js_function_str);
         return false;
     }
 
     environmentChainLength_ = mozilla::AssertedCast<uint8_t>(hops + 1);
     return true;
 }
 
 void
 EmitterScope::updateFrameFixedSlots(BytecodeEmitter* bce, const BindingIter& bi)
 {
     nextFrameSlot_ = bi.nextFrameSlot();
-    if (nextFrameSlot_ > bce->maxFixedSlots)
+    if (nextFrameSlot_ > bce->maxFixedSlots) {
         bce->maxFixedSlots = nextFrameSlot_;
+    }
     MOZ_ASSERT_IF(bce->sc->isFunctionBox() &&
                   (bce->sc->asFunctionBox()->isGenerator() ||
                    bce->sc->asFunctionBox()->isAsync()),
                   bce->maxFixedSlots == 0);
 }
 
 bool
 EmitterScope::putNameInCache(BytecodeEmitter* bce, JSAtom* name, NameLocation loc)
@@ -97,45 +100,49 @@ EmitterScope::putNameInCache(BytecodeEmi
         return false;
     }
     return true;
 }
 
 Maybe<NameLocation>
 EmitterScope::lookupInCache(BytecodeEmitter* bce, JSAtom* name)
 {
-    if (NameLocationMap::Ptr p = nameCache_->lookup(name))
+    if (NameLocationMap::Ptr p = nameCache_->lookup(name)) {
         return Some(p->value().wrapped);
-    if (fallbackFreeNameLocation_ && nameCanBeFree(bce, name))
+    }
+    if (fallbackFreeNameLocation_ && nameCanBeFree(bce, name)) {
         return fallbackFreeNameLocation_;
+    }
     return Nothing();
 }
 
 EmitterScope*
 EmitterScope::enclosing(BytecodeEmitter** bce) const
 {
     // There is an enclosing scope with access to the same frame.
-    if (EmitterScope* inFrame = enclosingInFrame())
+    if (EmitterScope* inFrame = enclosingInFrame()) {
         return inFrame;
+    }
 
     // We are currently compiling the enclosing script, look in the
     // enclosing BCE.
     if ((*bce)->parent) {
         *bce = (*bce)->parent;
         return (*bce)->innermostEmitterScopeNoCheck();
     }
 
     return nullptr;
 }
 
 Scope*
 EmitterScope::enclosingScope(BytecodeEmitter* bce) const
 {
-    if (EmitterScope* es = enclosing(&bce))
+    if (EmitterScope* es = enclosing(&bce)) {
         return es->scope(bce);
+    }
 
     // The enclosing script is already compiled or the current script is the
     // global script.
     return bce->sc->compilationEnclosingScope();
 }
 
 /* static */ bool
 EmitterScope::nameCanBeFree(BytecodeEmitter* bce, JSAtom* name)
@@ -155,18 +162,19 @@ NameIsOnEnvironment(Scope* scope, JSAtom
         if (bi.name() == name) {
             BindingLocation::Kind kind = bi.location().kind();
 
             if (bi.hasArgumentSlot()) {
                 JSScript* script = scope->as<FunctionScope>().script();
                 if (!script->strict() && !script->functionHasParameterExprs()) {
                     // Check for duplicate positional formal parameters.
                     for (BindingIter bi2(bi); bi2 && bi2.hasArgumentSlot(); bi2++) {
-                        if (bi2.name() == name)
+                        if (bi2.name() == name) {
                             kind = bi2.location().kind();
+                        }
                     }
                 }
             }
 
             return kind == BindingLocation::Kind::Global ||
                    kind == BindingLocation::Kind::Environment ||
                    kind == BindingLocation::Kind::Import;
         }
@@ -184,32 +192,35 @@ EmitterScope::searchInEnclosingScope(JSA
         MOZ_ASSERT(NameIsOnEnvironment(si.scope(), name));
 
         bool hasEnv = si.hasSyntacticEnvironment();
 
         switch (si.kind()) {
           case ScopeKind::Function:
             if (hasEnv) {
                 JSScript* script = si.scope()->as<FunctionScope>().script();
-                if (script->funHasExtensibleScope())
+                if (script->funHasExtensibleScope()) {
                     return NameLocation::Dynamic();
+                }
 
                 for (BindingIter bi(si.scope()); bi; bi++) {
-                    if (bi.name() != name)
+                    if (bi.name() != name) {
                         continue;
+                    }
 
                     BindingLocation bindLoc = bi.location();
                     if (bi.hasArgumentSlot() &&
                         !script->strict() &&
                         !script->functionHasParameterExprs())
                     {
                         // Check for duplicate positional formal parameters.
                         for (BindingIter bi2(bi); bi2 && bi2.hasArgumentSlot(); bi2++) {
-                            if (bi2.name() == name)
+                            if (bi2.name() == name) {
                                 bindLoc = bi2.location();
+                            }
                         }
                     }
 
                     MOZ_ASSERT(bindLoc.kind() == BindingLocation::Kind::Environment);
                     return NameLocation::EnvironmentCoordinate(bi.kind(), hops, bindLoc.slot());
                 }
             }
             break;
@@ -218,34 +229,36 @@ EmitterScope::searchInEnclosingScope(JSA
           case ScopeKind::ParameterExpressionVar:
           case ScopeKind::Lexical:
           case ScopeKind::NamedLambda:
           case ScopeKind::StrictNamedLambda:
           case ScopeKind::SimpleCatch:
           case ScopeKind::Catch:
             if (hasEnv) {
                 for (BindingIter bi(si.scope()); bi; bi++) {
-                    if (bi.name() != name)
+                    if (bi.name() != name) {
                         continue;
+                    }
 
                     // The name must already have been marked as closed
                     // over. If this assertion is hit, there is a bug in the
                     // name analysis.
                     BindingLocation bindLoc = bi.location();
                     MOZ_ASSERT(bindLoc.kind() == BindingLocation::Kind::Environment);
                     return NameLocation::EnvironmentCoordinate(bi.kind(), hops, bindLoc.slot());
                 }
             }
             break;
 
           case ScopeKind::Module:
             if (hasEnv) {
                 for (BindingIter bi(si.scope()); bi; bi++) {
-                    if (bi.name() != name)
+                    if (bi.name() != name) {
                         continue;
+                    }
 
                     BindingLocation bindLoc = bi.location();
 
                     // Imports are on the environment but are indirect
                     // bindings and must be accessed dynamically instead of
                     // using an EnvironmentCoordinate.
                     if (bindLoc.kind() == BindingLocation::Kind::Import) {
                         MOZ_ASSERT(si.kind() == ScopeKind::Module);
@@ -258,18 +271,19 @@ EmitterScope::searchInEnclosingScope(JSA
             }
             break;
 
           case ScopeKind::Eval:
           case ScopeKind::StrictEval:
             // As an optimization, if the eval doesn't have its own var
             // environment and its immediate enclosing scope is a global
             // scope, all accesses are global.
-            if (!hasEnv && si.scope()->enclosing()->is<GlobalScope>())
+            if (!hasEnv && si.scope()->enclosing()->is<GlobalScope>()) {
                 return NameLocation::Global(BindingKind::Var);
+            }
             return NameLocation::Dynamic();
 
           case ScopeKind::Global:
             return NameLocation::Global(BindingKind::Var);
 
           case ScopeKind::With:
           case ScopeKind::NonSyntactic:
             return NameLocation::Dynamic();
@@ -294,27 +308,30 @@ EmitterScope::searchAndCache(BytecodeEmi
     Maybe<NameLocation> loc;
     uint8_t hops = hasEnvironment() ? 1 : 0;
     DebugOnly<bool> inCurrentScript = enclosingInFrame();
 
     // Start searching in the current compilation.
     for (EmitterScope* es = enclosing(&bce); es; es = es->enclosing(&bce)) {
         loc = es->lookupInCache(bce, name);
         if (loc) {
-            if (loc->kind() == NameLocation::Kind::EnvironmentCoordinate)
+            if (loc->kind() == NameLocation::Kind::EnvironmentCoordinate) {
                 *loc = loc->addHops(hops);
+            }
             break;
         }
 
-        if (es->hasEnvironment())
+        if (es->hasEnvironment()) {
             hops++;
+        }
 
 #ifdef DEBUG
-        if (!es->enclosingInFrame())
+        if (!es->enclosingInFrame()) {
             inCurrentScript = false;
+        }
 #endif
     }
 
     // If the name is not found in the current compilation, walk the Scope
     // chain encompassing the compilation.
     if (!loc) {
         inCurrentScript = false;
         loc = Some(searchInEnclosingScope(name, bce->sc->compilationEnclosingScope(), hops));
@@ -323,30 +340,32 @@ EmitterScope::searchAndCache(BytecodeEmi
     // Each script has its own frame. A free name that is accessed
     // from an inner script must not be a frame slot access. If this
     // assertion is hit, it is a bug in the free name analysis in the
     // parser.
     MOZ_ASSERT_IF(!inCurrentScript, loc->kind() != NameLocation::Kind::FrameSlot);
 
     // It is always correct to not cache the location. Ignore OOMs to make
     // lookups infallible.
-    if (!putNameInCache(bce, name, *loc))
+    if (!putNameInCache(bce, name, *loc)) {
         bce->cx->recoverFromOutOfMemory();
+    }
 
     return *loc;
 }
 
 template <typename ScopeCreator>
 bool
 EmitterScope::internScope(BytecodeEmitter* bce, ScopeCreator createScope)
 {
     RootedScope enclosing(bce->cx, enclosingScope(bce));
     Scope* scope = createScope(bce->cx, enclosing);
-    if (!scope)
+    if (!scope) {
         return false;
+    }
     hasEnvironment_ = scope->hasEnvironment();
     scopeIndex_ = bce->scopeList.length();
     return bce->scopeList.append(scope);
 }
 
 template <typename ScopeCreator>
 bool
 EmitterScope::internBodyScope(BytecodeEmitter* bce, ScopeCreator createScope)
@@ -373,44 +392,49 @@ EmitterScope::deadZoneFrameSlotRange(Byt
     // Lexical bindings throw ReferenceErrors if they are used before
     // initialization. See ES6 8.1.1.1.6.
     //
     // For completeness, lexical bindings are initialized in ES6 by calling
     // InitializeBinding, after which touching the binding will no longer
     // throw reference errors. See 13.1.11, 9.2.13, 13.6.3.4, 13.6.4.6,
     // 13.6.4.8, 13.14.5, 15.1.8, and 15.2.0.15.
     if (slotStart != slotEnd) {
-        if (!bce->emit1(JSOP_UNINITIALIZED))
+        if (!bce->emit1(JSOP_UNINITIALIZED)) {
             return false;
+        }
         for (uint32_t slot = slotStart; slot < slotEnd; slot++) {
-            if (!bce->emitLocalOp(JSOP_INITLEXICAL, slot))
+            if (!bce->emitLocalOp(JSOP_INITLEXICAL, slot)) {
                 return false;
+            }
         }
-        if (!bce->emit1(JSOP_POP))
+        if (!bce->emit1(JSOP_POP)) {
             return false;
+        }
     }
 
     return true;
 }
 
 void
 EmitterScope::dump(BytecodeEmitter* bce)
 {
     fprintf(stdout, "EmitterScope [%s] %p\n", ScopeKindString(scope(bce)->kind()), this);
 
     for (NameLocationMap::Range r = nameCache_->all(); !r.empty(); r.popFront()) {
         const NameLocation& l = r.front().value();
 
         UniqueChars bytes = AtomToPrintableString(bce->cx, r.front().key());
-        if (!bytes)
+        if (!bytes) {
             return;
-        if (l.kind() != NameLocation::Kind::Dynamic)
+        }
+        if (l.kind() != NameLocation::Kind::Dynamic) {
             fprintf(stdout, "  %s %s ", BindingKindString(l.bindingKind()), bytes.get());
-        else
+        } else {
             fprintf(stdout, "  %s ", bytes.get());
+        }
 
         switch (l.kind()) {
           case NameLocation::Kind::Dynamic:
             fprintf(stdout, "dynamic\n");
             break;
           case NameLocation::Kind::Global:
             fprintf(stdout, "global\n");
             break;
@@ -444,139 +468,155 @@ EmitterScope::dump(BytecodeEmitter* bce)
 
 bool
 EmitterScope::enterLexical(BytecodeEmitter* bce, ScopeKind kind,
                            Handle<LexicalScope::Data*> bindings)
 {
     MOZ_ASSERT(kind != ScopeKind::NamedLambda && kind != ScopeKind::StrictNamedLambda);
     MOZ_ASSERT(this == bce->innermostEmitterScopeNoCheck());
 
-    if (!ensureCache(bce))
+    if (!ensureCache(bce)) {
         return false;
+    }
 
     // Marks all names as closed over if the context requires it. This
     // cannot be done in the Parser as we may not know if the context requires
     // all bindings to be closed over until after parsing is finished. For
     // example, legacy generators require all bindings to be closed over but
     // it is unknown if a function is a legacy generator until the first
     // 'yield' expression is parsed.
     //
     // This is not a problem with other scopes, as all other scopes with
     // bindings are body-level. At the time of their creation, whether or not
     // the context requires all bindings to be closed over is already known.
-    if (bce->sc->allBindingsClosedOver())
+    if (bce->sc->allBindingsClosedOver()) {
         MarkAllBindingsClosedOver(*bindings);
+    }
 
     // Resolve bindings.
     TDZCheckCache* tdzCache = bce->innermostTDZCheckCache;
     uint32_t firstFrameSlot = frameSlotStart();
     BindingIter bi(*bindings, firstFrameSlot, /* isNamedLambda = */ false);
     for (; bi; bi++) {
-        if (!checkSlotLimits(bce, bi))
+        if (!checkSlotLimits(bce, bi)) {
             return false;
+        }
 
         NameLocation loc = NameLocation::fromBinding(bi.kind(), bi.location());
-        if (!putNameInCache(bce, bi.name(), loc))
+        if (!putNameInCache(bce, bi.name(), loc)) {
             return false;
+        }
 
-        if (!tdzCache->noteTDZCheck(bce, bi.name(), CheckTDZ))
+        if (!tdzCache->noteTDZCheck(bce, bi.name(), CheckTDZ)) {
             return false;
+        }
     }
 
     updateFrameFixedSlots(bce, bi);
 
     // Create and intern the VM scope.
     auto createScope = [kind, bindings, firstFrameSlot](JSContext* cx,
                                                         HandleScope enclosing)
     {
         return LexicalScope::create(cx, kind, bindings, firstFrameSlot, enclosing);
     };
-    if (!internScope(bce, createScope))
+    if (!internScope(bce, createScope)) {
         return false;
+    }
 
     if (ScopeKindIsInBody(kind) && hasEnvironment()) {
         // After interning the VM scope we can get the scope index.
-        if (!bce->emitInternedScopeOp(index(), JSOP_PUSHLEXICALENV))
+        if (!bce->emitInternedScopeOp(index(), JSOP_PUSHLEXICALENV)) {
             return false;
+        }
     }
 
     // Lexical scopes need notes to be mapped from a pc.
-    if (!appendScopeNote(bce))
+    if (!appendScopeNote(bce)) {
         return false;
+    }
 
     // Put frame slots in TDZ. Environment slots are poisoned during
     // environment creation.
     //
     // This must be done after appendScopeNote to be considered in the extent
     // of the scope.
-    if (!deadZoneFrameSlotRange(bce, firstFrameSlot, frameSlotEnd()))
+    if (!deadZoneFrameSlotRange(bce, firstFrameSlot, frameSlotEnd())) {
         return false;
+    }
 
     return checkEnvironmentChainLength(bce);
 }
 
 bool
 EmitterScope::enterNamedLambda(BytecodeEmitter* bce, FunctionBox* funbox)
 {
     MOZ_ASSERT(this == bce->innermostEmitterScopeNoCheck());
     MOZ_ASSERT(funbox->namedLambdaBindings());
 
-    if (!ensureCache(bce))
+    if (!ensureCache(bce)) {
         return false;
+    }
 
     // See comment in enterLexical about allBindingsClosedOver.
-    if (funbox->allBindingsClosedOver())
+    if (funbox->allBindingsClosedOver()) {
         MarkAllBindingsClosedOver(*funbox->namedLambdaBindings());
+    }
 
     BindingIter bi(*funbox->namedLambdaBindings(), LOCALNO_LIMIT, /* isNamedLambda = */ true);
     MOZ_ASSERT(bi.kind() == BindingKind::NamedLambdaCallee);
 
     // The lambda name, if not closed over, is accessed via JSOP_CALLEE and
     // not a frame slot. Do not update frame slot information.
     NameLocation loc = NameLocation::fromBinding(bi.kind(), bi.location());
-    if (!putNameInCache(bce, bi.name(), loc))
+    if (!putNameInCache(bce, bi.name(), loc)) {
         return false;
+    }
 
     bi++;
     MOZ_ASSERT(!bi, "There should be exactly one binding in a NamedLambda scope");
 
     auto createScope = [funbox](JSContext* cx, HandleScope enclosing) {
         ScopeKind scopeKind =
             funbox->strict() ? ScopeKind::StrictNamedLambda : ScopeKind::NamedLambda;
         return LexicalScope::create(cx, scopeKind, funbox->namedLambdaBindings(),
                                     LOCALNO_LIMIT, enclosing);
     };
-    if (!internScope(bce, createScope))
+    if (!internScope(bce, createScope)) {
         return false;
+    }
 
     return checkEnvironmentChainLength(bce);
 }
 
 bool
 EmitterScope::enterFunction(BytecodeEmitter* bce, FunctionBox* funbox)
 {
     MOZ_ASSERT(this == bce->innermostEmitterScopeNoCheck());
 
     // If there are parameter expressions, there is an extra var scope.
-    if (!funbox->hasExtraBodyVarScope())
+    if (!funbox->hasExtraBodyVarScope()) {
         bce->setVarEmitterScope(this);
+    }
 
-    if (!ensureCache(bce))
+    if (!ensureCache(bce)) {
         return false;
+    }
 
     // Resolve body-level bindings, if there are any.
     auto bindings = funbox->functionScopeBindings();
     Maybe<uint32_t> lastLexicalSlot;
     if (bindings) {
         NameLocationMap& cache = *nameCache_;
 
         BindingIter bi(*bindings, funbox->hasParameterExprs);
         for (; bi; bi++) {
-            if (!checkSlotLimits(bce, bi))
+            if (!checkSlotLimits(bce, bi)) {
                 return false;
+            }
 
             NameLocation loc = NameLocation::fromBinding(bi.kind(), bi.location());
             NameLocationMap::AddPtr p = cache.lookupForAdd(bi.name());
 
             // The only duplicate bindings that occur are simple formal
             // parameters, in which case the last position counts, so update the
             // location.
             if (p) {
@@ -597,143 +637,158 @@ EmitterScope::enterFunction(BytecodeEmit
     } else {
         nextFrameSlot_ = 0;
     }
 
     // If the function's scope may be extended at runtime due to sloppy direct
     // eval and there is no extra var scope, any names beyond the function
     // scope must be accessed dynamically as we don't know if the name will
     // become a 'var' binding due to direct eval.
-    if (!funbox->hasParameterExprs && funbox->hasExtensibleScope())
+    if (!funbox->hasParameterExprs && funbox->hasExtensibleScope()) {
         fallbackFreeNameLocation_ = Some(NameLocation::Dynamic());
+    }
 
     // In case of parameter expressions, the parameters are lexical
     // bindings and have TDZ.
     if (funbox->hasParameterExprs && nextFrameSlot_) {
         uint32_t paramFrameSlotEnd = 0;
         for (BindingIter bi(*bindings, true); bi; bi++) {
-            if (!BindingKindIsLexical(bi.kind()))
+            if (!BindingKindIsLexical(bi.kind())) {
                 break;
+            }
 
             NameLocation loc = NameLocation::fromBinding(bi.kind(), bi.location());
             if (loc.kind() == NameLocation::Kind::FrameSlot) {
                 MOZ_ASSERT(paramFrameSlotEnd <= loc.frameSlot());
                 paramFrameSlotEnd = loc.frameSlot() + 1;
             }
         }
 
-        if (!deadZoneFrameSlotRange(bce, 0, paramFrameSlotEnd))
+        if (!deadZoneFrameSlotRange(bce, 0, paramFrameSlotEnd)) {
             return false;
+        }
     }
 
     // Create and intern the VM scope.
     auto createScope = [funbox](JSContext* cx, HandleScope enclosing) {
         RootedFunction fun(cx, funbox->function());
         return FunctionScope::create(cx, funbox->functionScopeBindings(),
                                      funbox->hasParameterExprs,
                                      funbox->needsCallObjectRegardlessOfBindings(),
                                      fun, enclosing);
     };
-    if (!internBodyScope(bce, createScope))
+    if (!internBodyScope(bce, createScope)) {
         return false;
+    }
 
     return checkEnvironmentChainLength(bce);
 }
 
 bool
 EmitterScope::enterFunctionExtraBodyVar(BytecodeEmitter* bce, FunctionBox* funbox)
 {
     MOZ_ASSERT(funbox->hasParameterExprs);
     MOZ_ASSERT(funbox->extraVarScopeBindings() ||
                funbox->needsExtraBodyVarEnvironmentRegardlessOfBindings());
     MOZ_ASSERT(this == bce->innermostEmitterScopeNoCheck());
 
     // The extra var scope is never popped once it's entered. It replaces the
     // function scope as the var emitter scope.
     bce->setVarEmitterScope(this);
 
-    if (!ensureCache(bce))
+    if (!ensureCache(bce)) {
         return false;
+    }
 
     // Resolve body-level bindings, if there are any.
     uint32_t firstFrameSlot = frameSlotStart();
     if (auto bindings = funbox->extraVarScopeBindings()) {
         BindingIter bi(*bindings, firstFrameSlot);
         for (; bi; bi++) {
-            if (!checkSlotLimits(bce, bi))
+            if (!checkSlotLimits(bce, bi)) {
                 return false;
+            }
 
             NameLocation loc = NameLocation::fromBinding(bi.kind(), bi.location());
-            if (!putNameInCache(bce, bi.name(), loc))
+            if (!putNameInCache(bce, bi.name(), loc)) {
                 return false;
+            }
         }
 
         updateFrameFixedSlots(bce, bi);
     } else {
         nextFrameSlot_ = firstFrameSlot;
     }
 
     // If the extra var scope may be extended at runtime due to sloppy
     // direct eval, any names beyond the var scope must be accessed
     // dynamically as we don't know if the name will become a 'var' binding
     // due to direct eval.
-    if (funbox->hasExtensibleScope())
+    if (funbox->hasExtensibleScope()) {
         fallbackFreeNameLocation_ = Some(NameLocation::Dynamic());
+    }
 
     // Create and intern the VM scope.
     auto createScope = [funbox, firstFrameSlot](JSContext* cx, HandleScope enclosing) {
         return VarScope::create(cx, ScopeKind::FunctionBodyVar,
                                 funbox->extraVarScopeBindings(), firstFrameSlot,
                                 funbox->needsExtraBodyVarEnvironmentRegardlessOfBindings(),
                                 enclosing);
     };
-    if (!internScope(bce, createScope))
+    if (!internScope(bce, createScope)) {
         return false;
+    }
 
     if (hasEnvironment()) {
-        if (!bce->emitInternedScopeOp(index(), JSOP_PUSHVARENV))
+        if (!bce->emitInternedScopeOp(index(), JSOP_PUSHVARENV)) {
             return false;
+        }
     }
 
     // The extra var scope needs a note to be mapped from a pc.
-    if (!appendScopeNote(bce))
+    if (!appendScopeNote(bce)) {
         return false;
+    }
 
     return checkEnvironmentChainLength(bce);
 }
 
 bool
 EmitterScope::enterParameterExpressionVar(BytecodeEmitter* bce)
 {
     MOZ_ASSERT(this == bce->innermostEmitterScopeNoCheck());
 
-    if (!ensureCache(bce))
+    if (!ensureCache(bce)) {
         return false;
+    }
 
     // Parameter expressions var scopes have no pre-set bindings and are
     // always extensible, as they are needed for eval.
     fallbackFreeNameLocation_ = Some(NameLocation::Dynamic());
 
     // Create and intern the VM scope.
     uint32_t firstFrameSlot = frameSlotStart();
     auto createScope = [firstFrameSlot](JSContext* cx, HandleScope enclosing) {
         return VarScope::create(cx, ScopeKind::ParameterExpressionVar,
                                 /* data = */ nullptr, firstFrameSlot,
                                 /* needsEnvironment = */ true, enclosing);
     };
-    if (!internScope(bce, createScope))
+    if (!internScope(bce, createScope)) {
         return false;
+    }
 
     MOZ_ASSERT(hasEnvironment());
-    if (!bce->emitInternedScopeOp(index(), JSOP_PUSHVARENV))
+    if (!bce->emitInternedScopeOp(index(), JSOP_PUSHVARENV)) {
         return false;
+    }
 
     // The extra var scope needs a note to be mapped from a pc.
-    if (!appendScopeNote(bce))
+    if (!appendScopeNote(bce)) {
         return false;
+    }
 
     return checkEnvironmentChainLength(bce);
 }
 
 class DynamicBindingIter : public BindingIter
 {
   public:
     explicit DynamicBindingIter(GlobalSharedContext* sc)
@@ -762,18 +817,19 @@ class DynamicBindingIter : public Bindin
 
 bool
 EmitterScope::enterGlobal(BytecodeEmitter* bce, GlobalSharedContext* globalsc)
 {
     MOZ_ASSERT(this == bce->innermostEmitterScopeNoCheck());
 
     bce->setVarEmitterScope(this);
 
-    if (!ensureCache(bce))
+    if (!ensureCache(bce)) {
         return false;
+    }
 
     if (bce->emitterMode == BytecodeEmitter::SelfHosting) {
         // In self-hosting, it is incorrect to consult the global scope because
         // self-hosted scripts are cloned into their target compartments before
         // they are run. Instead of Global, Intrinsic is used for all names.
         //
         // Intrinsic lookups are redirected to the special intrinsics holder
         // in the global object, into which any missing values are cloned
@@ -787,178 +843,199 @@ EmitterScope::enterGlobal(BytecodeEmitte
         return internBodyScope(bce, createScope);
     }
 
     // Resolve binding names and emit DEF{VAR,LET,CONST} prologue ops.
     if (globalsc->bindings) {
         for (DynamicBindingIter bi(globalsc); bi; bi++) {
             NameLocation loc = NameLocation::fromBinding(bi.kind(), bi.location());
             JSAtom* name = bi.name();
-            if (!putNameInCache(bce, name, loc))
+            if (!putNameInCache(bce, name, loc)) {
                 return false;
+            }
 
             // Define the name in the prologue. Do not emit DEFVAR for
             // functions that we'll emit DEFFUN for.
-            if (bi.isTopLevelFunction())
+            if (bi.isTopLevelFunction()) {
                 continue;
+            }
 
-            if (!bce->emitAtomOp(name, bi.bindingOp()))
+            if (!bce->emitAtomOp(name, bi.bindingOp())) {
                 return false;
+            }
         }
     }
 
     // Note that to save space, we don't add free names to the cache for
     // global scopes. They are assumed to be global vars in the syntactic
     // global scope, dynamic accesses under non-syntactic global scope.
-    if (globalsc->scopeKind() == ScopeKind::Global)
+    if (globalsc->scopeKind() == ScopeKind::Global) {
         fallbackFreeNameLocation_ = Some(NameLocation::Global(BindingKind::Var));
-    else
+    } else {
         fallbackFreeNameLocation_ = Some(NameLocation::Dynamic());
+    }
 
     auto createScope = [globalsc](JSContext* cx, HandleScope enclosing) {
         MOZ_ASSERT(!enclosing);
         return GlobalScope::create(cx, globalsc->scopeKind(), globalsc->bindings);
     };
     return internBodyScope(bce, createScope);
 }
 
 bool
 EmitterScope::enterEval(BytecodeEmitter* bce, EvalSharedContext* evalsc)
 {
     MOZ_ASSERT(this == bce->innermostEmitterScopeNoCheck());
 
     bce->setVarEmitterScope(this);
 
-    if (!ensureCache(bce))
+    if (!ensureCache(bce)) {
         return false;
+    }
 
     // For simplicity, treat all free name lookups in eval scripts as dynamic.
     fallbackFreeNameLocation_ = Some(NameLocation::Dynamic());
 
     // Create the `var` scope. Note that there is also a lexical scope, created
     // separately in emitScript().
     auto createScope = [evalsc](JSContext* cx, HandleScope enclosing) {
         ScopeKind scopeKind = evalsc->strict() ? ScopeKind::StrictEval : ScopeKind::Eval;
         return EvalScope::create(cx, scopeKind, evalsc->bindings, enclosing);
     };
-    if (!internBodyScope(bce, createScope))
+    if (!internBodyScope(bce, createScope)) {
         return false;
+    }
 
     if (hasEnvironment()) {
-        if (!bce->emitInternedScopeOp(index(), JSOP_PUSHVARENV))
+        if (!bce->emitInternedScopeOp(index(), JSOP_PUSHVARENV)) {
             return false;
+        }
     } else {
         // Resolve binding names and emit DEFVAR prologue ops if we don't have
         // an environment (i.e., a sloppy eval not in a parameter expression).
         // Eval scripts always have their own lexical scope, but non-strict
         // scopes may introduce 'var' bindings to the nearest var scope.
         //
         // TODO: We may optimize strict eval bindings in the future to be on
         // the frame. For now, handle everything dynamically.
         if (!hasEnvironment() && evalsc->bindings) {
             for (DynamicBindingIter bi(evalsc); bi; bi++) {
                 MOZ_ASSERT(bi.bindingOp() == JSOP_DEFVAR);
 
-                if (bi.isTopLevelFunction())
+                if (bi.isTopLevelFunction()) {
                     continue;
+                }
 
-                if (!bce->emitAtomOp(bi.name(), JSOP_DEFVAR))
+                if (!bce->emitAtomOp(bi.name(), JSOP_DEFVAR)) {
                     return false;
+                }
             }
         }
 
         // As an optimization, if the eval does not have its own var
         // environment and is directly enclosed in a global scope, then all
         // free name lookups are global.
-        if (scope(bce)->enclosing()->is<GlobalScope>())
+        if (scope(bce)->enclosing()->is<GlobalScope>()) {
             fallbackFreeNameLocation_ = Some(NameLocation::Global(BindingKind::Var));
+        }
     }
 
     return true;
 }
 
 bool
 EmitterScope::enterModule(BytecodeEmitter* bce, ModuleSharedContext* modulesc)
 {
     MOZ_ASSERT(this == bce->innermostEmitterScopeNoCheck());
 
     bce->setVarEmitterScope(this);
 
-    if (!ensureCache(bce))
+    if (!ensureCache(bce)) {
         return false;
+    }
 
     // Resolve body-level bindings, if there are any.
     TDZCheckCache* tdzCache = bce->innermostTDZCheckCache;
     Maybe<uint32_t> firstLexicalFrameSlot;
     if (ModuleScope::Data* bindings = modulesc->bindings) {
         BindingIter bi(*bindings);
         for (; bi; bi++) {
-            if (!checkSlotLimits(bce, bi))
+            if (!checkSlotLimits(bce, bi)) {
                 return false;
+            }
 
             NameLocation loc = NameLocation::fromBinding(bi.kind(), bi.location());
-            if (!putNameInCache(bce, bi.name(), loc))
+            if (!putNameInCache(bce, bi.name(), loc)) {
                 return false;
+            }
 
             if (BindingKindIsLexical(bi.kind())) {
-                if (loc.kind() == NameLocation::Kind::FrameSlot && !firstLexicalFrameSlot)
+                if (loc.kind() == NameLocation::Kind::FrameSlot && !firstLexicalFrameSlot) {
                     firstLexicalFrameSlot = Some(loc.frameSlot());
+                }
 
-                if (!tdzCache->noteTDZCheck(bce, bi.name(), CheckTDZ))
+                if (!tdzCache->noteTDZCheck(bce, bi.name(), CheckTDZ)) {
                     return false;
+                }
             }
         }
 
         updateFrameFixedSlots(bce, bi);
     } else {
         nextFrameSlot_ = 0;
     }
 
     // Modules are toplevel, so any free names are global.
     fallbackFreeNameLocation_ = Some(NameLocation::Global(BindingKind::Var));
 
     // Put lexical frame slots in TDZ. Environment slots are poisoned during
     // environment creation.
     if (firstLexicalFrameSlot) {
-        if (!deadZoneFrameSlotRange(bce, *firstLexicalFrameSlot, frameSlotEnd()))
+        if (!deadZoneFrameSlotRange(bce, *firstLexicalFrameSlot, frameSlotEnd())) {
             return false;
+        }
     }
 
     // Create and intern the VM scope.
     auto createScope = [modulesc](JSContext* cx, HandleScope enclosing) {
         return ModuleScope::create(cx, modulesc->bindings, modulesc->module(), enclosing);
     };
-    if (!internBodyScope(bce, createScope))
+    if (!internBodyScope(bce, createScope)) {
         return false;
+    }
 
     return checkEnvironmentChainLength(bce);
 }
 
 bool
 EmitterScope::enterWith(BytecodeEmitter* bce)
 {
     MOZ_ASSERT(this == bce->innermostEmitterScopeNoCheck());
 
-    if (!ensureCache(bce))
+    if (!ensureCache(bce)) {
         return false;
+    }
 
     // 'with' make all accesses dynamic and unanalyzable.
     fallbackFreeNameLocation_ = Some(NameLocation::Dynamic());
 
     auto createScope = [](JSContext* cx, HandleScope enclosing) {
         return WithScope::create(cx, enclosing);
     };
-    if (!internScope(bce, createScope))
+    if (!internScope(bce, createScope)) {
         return false;
+    }
 
-    if (!bce->emitInternedScopeOp(index(), JSOP_ENTERWITH))
+    if (!bce->emitInternedScopeOp(index(), JSOP_ENTERWITH)) {
         return false;
+    }
 
-    if (!appendScopeNote(bce))
+    if (!appendScopeNote(bce)) {
         return false;
+    }
 
     return checkEnvironmentChainLength(bce);
 }
 
 bool
 EmitterScope::deadZoneFrameSlots(BytecodeEmitter* bce) const
 {
     return deadZoneFrameSlotRange(bce, frameSlotStart(), frameSlotEnd());
@@ -971,29 +1048,32 @@ EmitterScope::leave(BytecodeEmitter* bce
     // we must be the innermost scope.
     MOZ_ASSERT_IF(!nonLocal, this == bce->innermostEmitterScopeNoCheck());
 
     ScopeKind kind = scope(bce)->kind();
     switch (kind) {
       case ScopeKind::Lexical:
       case ScopeKind::SimpleCatch:
       case ScopeKind::Catch:
-        if (!bce->emit1(hasEnvironment() ? JSOP_POPLEXICALENV : JSOP_DEBUGLEAVELEXICALENV))
+        if (!bce->emit1(hasEnvironment() ? JSOP_POPLEXICALENV : JSOP_DEBUGLEAVELEXICALENV)) {
             return false;
+        }
         break;
 
       case ScopeKind::With:
-        if (!bce->emit1(JSOP_LEAVEWITH))
+        if (!bce->emit1(JSOP_LEAVEWITH)) {
             return false;
+        }
         break;
 
       case ScopeKind::ParameterExpressionVar:
         MOZ_ASSERT(hasEnvironment());
-        if (!bce->emit1(JSOP_POPVARENV))
+        if (!bce->emit1(JSOP_POPVARENV)) {
             return false;
+        }
         break;
 
       case ScopeKind::Function:
       case ScopeKind::FunctionBodyVar:
       case ScopeKind::NamedLambda:
       case ScopeKind::StrictNamedLambda:
       case ScopeKind::Eval:
       case ScopeKind::StrictEval:
@@ -1026,37 +1106,40 @@ Scope*
 EmitterScope::scope(const BytecodeEmitter* bce) const
 {
     return bce->scopeList.vector[index()];
 }
 
 NameLocation
 EmitterScope::lookup(BytecodeEmitter* bce, JSAtom* name)
 {
-    if (Maybe<NameLocation> loc = lookupInCache(bce, name))
+    if (Maybe<NameLocation> loc = lookupInCache(bce, name)) {
         return *loc;
+    }
     return searchAndCache(bce, name);
 }
 
 Maybe<NameLocation>
 EmitterScope::locationBoundInScope(JSAtom* name, EmitterScope* target)
 {
     // The target scope must be an intra-frame enclosing scope of this
     // one. Count the number of extra hops to reach it.
     uint8_t extraHops = 0;
     for (EmitterScope* es = this; es != target; es = es->enclosingInFrame()) {
-        if (es->hasEnvironment())
+        if (es->hasEnvironment()) {
             extraHops++;
+        }
     }
 
     // Caches are prepopulated with bound names. So if the name is bound in a
     // particular scope, it must already be in the cache. Furthermore, don't
     // consult the fallback location as we only care about binding names.
     Maybe<NameLocation> loc;
     if (NameLocationMap::Ptr p = target->nameCache_->lookup(name)) {
         NameLocation l = p->value().wrapped;
-        if (l.kind() == NameLocation::Kind::EnvironmentCoordinate)
+        if (l.kind() == NameLocation::Kind::EnvironmentCoordinate) {
             loc = Some(l.addHops(extraHops));
-        else
+        } else {
             loc = Some(l);
+        }
     }
     return loc;
 }
--- a/js/src/frontend/EmitterScope.h
+++ b/js/src/frontend/EmitterScope.h
@@ -122,18 +122,19 @@ class EmitterScope : public Nestable<Emi
     Scope* scope(const BytecodeEmitter* bce) const;
 
     bool hasEnvironment() const {
         return hasEnvironment_;
     }
 
     // The first frame slot used.
     uint32_t frameSlotStart() const {
-        if (EmitterScope* inFrame = enclosingInFrame())
+        if (EmitterScope* inFrame = enclosingInFrame()) {
             return inFrame->nextFrameSlot_;
+        }
         return 0;
     }
 
     // The last frame slot used + 1.
     uint32_t frameSlotEnd() const {
         return nextFrameSlot_;
     }
 
--- a/js/src/frontend/FoldConstants.cpp
+++ b/js/src/frontend/FoldConstants.cpp
@@ -29,20 +29,22 @@ using JS::ToUint32;
 
 static bool
 ContainsHoistedDeclaration(JSContext* cx, ParseNode* node, bool* result);
 
 static bool
 ListContainsHoistedDeclaration(JSContext* cx, ListNode* list, bool* result)
 {
     for (ParseNode* node = list->pn_head; node; node = node->pn_next) {
-        if (!ContainsHoistedDeclaration(cx, node, result))
+        if (!ContainsHoistedDeclaration(cx, node, result)) {
             return false;
-        if (*result)
+        }
+        if (*result) {
             return true;
+        }
     }
 
     *result = false;
     return true;
 }
 
 // Determines whether the given ParseNode contains any declarations whose
 // visibility will extend outside the node itself -- that is, whether the
@@ -50,18 +52,19 @@ ListContainsHoistedDeclaration(JSContext
 //
 // THIS IS NOT A GENERAL-PURPOSE FUNCTION.  It is only written to work in the
 // specific context of deciding that |node|, as one arm of a ParseNodeKind::If
 // controlled by a constant condition, contains a declaration that forbids
 // |node| being completely eliminated as dead.
 static bool
 ContainsHoistedDeclaration(JSContext* cx, ParseNode* node, bool* result)
 {
-    if (!CheckRecursionLimit(cx))
+    if (!CheckRecursionLimit(cx)) {
         return false;
+    }
 
   restart:
 
     // With a better-typed AST, we would have distinct parse node classes for
     // expressions and for statements and would characterize expressions with
     // ExpressionKind and statements with StatementKind.  Perhaps someday.  In
     // the meantime we must characterize every ParseNodeKind, even the
     // expression/sub-expression ones that, if we handle all statement kinds
@@ -158,56 +161,64 @@ ContainsHoistedDeclaration(JSContext* cx
       // Statements with more complicated structures.
 
       // if-statement nodes may have hoisted declarations in their consequent
       // and alternative components.
       case ParseNodeKind::If: {
         MOZ_ASSERT(node->isArity(PN_TERNARY));
 
         ParseNode* consequent = node->pn_kid2;
-        if (!ContainsHoistedDeclaration(cx, consequent, result))
+        if (!ContainsHoistedDeclaration(cx, consequent, result)) {
             return false;
-        if (*result)
+        }
+        if (*result) {
             return true;
+        }
 
-        if ((node = node->pn_kid3))
+        if ((node = node->pn_kid3)) {
             goto restart;
+        }
 
         *result = false;
         return true;
       }
 
       // try-statements have statements to execute, and one or both of a
       // catch-list and a finally-block.
       case ParseNodeKind::Try: {
         MOZ_ASSERT(node->isArity(PN_TERNARY));
         MOZ_ASSERT(node->pn_kid2 || node->pn_kid3,
                    "must have either catch(es) or finally");
 
         ParseNode* tryBlock = node->pn_kid1;
-        if (!ContainsHoistedDeclaration(cx, tryBlock, result))
+        if (!ContainsHoistedDeclaration(cx, tryBlock, result)) {
             return false;
-        if (*result)
+        }
+        if (*result) {
             return true;
+        }
 
         if (ParseNode* catchScope = node->pn_kid2) {
             MOZ_ASSERT(catchScope->isKind(ParseNodeKind::LexicalScope));
 
             ParseNode* catchNode = catchScope->pn_expr;
             MOZ_ASSERT(catchNode->isKind(ParseNodeKind::Catch));
 
             ParseNode* catchStatements = catchNode->pn_right;
-            if (!ContainsHoistedDeclaration(cx, catchStatements, result))
+            if (!ContainsHoistedDeclaration(cx, catchStatements, result)) {
                 return false;
-            if (*result)
+            }
+            if (*result) {
                 return true;
+            }
         }
 
-        if (ParseNode* finallyBlock = node->pn_kid3)
+        if (ParseNode* finallyBlock = node->pn_kid3) {
             return ContainsHoistedDeclaration(cx, finallyBlock, result);
+        }
 
         *result = false;
         return true;
       }
 
       // A switch node's left half is an expression; only its right half (a
       // list of cases/defaults, or a block node) could contain hoisted
       // declarations.
@@ -265,18 +276,19 @@ ContainsHoistedDeclaration(JSContext* cx
         ParseNode* loopBody = node->pn_right;
         return ContainsHoistedDeclaration(cx, loopBody, result);
       }
 
       case ParseNodeKind::LexicalScope: {
         MOZ_ASSERT(node->isArity(PN_SCOPE));
         ParseNode* expr = node->pn_expr;
 
-        if (expr->isKind(ParseNodeKind::For) || expr->isKind(ParseNodeKind::Function))
+        if (expr->isKind(ParseNodeKind::For) || expr->isKind(ParseNodeKind::Function)) {
             return ContainsHoistedDeclaration(cx, expr, result);
+        }
 
         MOZ_ASSERT(expr->isKind(ParseNodeKind::StatementList));
         return ListContainsHoistedDeclaration(cx, &node->pn_expr->as<ListNode>(), result);
       }
 
       // List nodes with all non-null children.
       case ParseNodeKind::StatementList:
         return ListContainsHoistedDeclaration(cx, &node->as<ListNode>(), result);
@@ -403,29 +415,31 @@ ContainsHoistedDeclaration(JSContext* cx
 static bool
 FoldType(JSContext* cx, ParseNode* pn, ParseNodeKind kind)
 {
     if (!pn->isKind(kind)) {
         switch (kind) {
           case ParseNodeKind::Number:
             if (pn->isKind(ParseNodeKind::String)) {
                 double d;
-                if (!StringToNumber(cx, pn->pn_atom, &d))
+                if (!StringToNumber(cx, pn->pn_atom, &d)) {
                     return false;
+                }
                 pn->pn_dval = d;
                 pn->setKind(ParseNodeKind::Number);
                 pn->setOp(JSOP_DOUBLE);
             }
             break;
 
           case ParseNodeKind::String:
             if (pn->isKind(ParseNodeKind::Number)) {
                 pn->pn_atom = NumberToAtom(cx, pn->pn_dval);
-                if (!pn->pn_atom)
+                if (!pn->pn_atom) {
                     return false;
+                }
                 pn->setKind(ParseNodeKind::String);
                 pn->setOp(JSOP_STRING);
             }
             break;
 
           default:;
         }
     }
@@ -502,18 +516,19 @@ Boolish(ParseNode* pn)
 
 static bool
 Fold(JSContext* cx, ParseNode** pnp, PerHandlerParser<FullParseHandler>& parser);
 
 static bool
 FoldCondition(JSContext* cx, ParseNode** nodePtr, PerHandlerParser<FullParseHandler>& parser)
 {
     // Conditions fold like any other expression...
-    if (!Fold(cx, nodePtr, parser))
+    if (!Fold(cx, nodePtr, parser)) {
         return false;
+    }
 
     // ...but then they sometimes can be further folded to constants.
     ParseNode* node = *nodePtr;
     Truthiness t = Boolish(node);
     if (t != Unknown) {
         // We can turn function nodes into constant nodes here, but mutating
         // function nodes is tricky --- in particular, mutating a function node
         // that appears on a method list corrupts the method list. However,
@@ -534,31 +549,33 @@ FoldCondition(JSContext* cx, ParseNode**
 
 static bool
 FoldTypeOfExpr(JSContext* cx, ParseNode* node, PerHandlerParser<FullParseHandler>& parser)
 {
     MOZ_ASSERT(node->isKind(ParseNodeKind::TypeOfExpr));
     MOZ_ASSERT(node->isArity(PN_UNARY));
 
     ParseNode*& expr = node->pn_kid;
-    if (!Fold(cx, &expr, parser))
+    if (!Fold(cx, &expr, parser)) {
         return false;
+    }
 
     // Constant-fold the entire |typeof| if given a constant with known type.
     RootedPropertyName result(cx);
-    if (expr->isKind(ParseNodeKind::String) || expr->isKind(ParseNodeKind::TemplateString))
+    if (expr->isKind(ParseNodeKind::String) || expr->isKind(ParseNodeKind::TemplateString)) {
         result = cx->names().string;
-    else if (expr->isKind(ParseNodeKind::Number))
+    } else if (expr->isKind(ParseNodeKind::Number)) {
         result = cx->names().number;
-    else if (expr->isKind(ParseNodeKind::Null))
+    } else if (expr->isKind(ParseNodeKind::Null)) {
         result = cx->names().object;
-    else if (expr->isKind(ParseNodeKind::True) || expr->isKind(ParseNodeKind::False))
+    } else if (expr->isKind(ParseNodeKind::True) || expr->isKind(ParseNodeKind::False)) {
         result = cx->names().boolean;
-    else if (expr->isKind(ParseNodeKind::Function))
+    } else if (expr->isKind(ParseNodeKind::Function)) {
         result = cx->names().function;
+    }
 
     if (result) {
         node->setKind(ParseNodeKind::String);
         node->setArity(PN_NULLARY);
         node->setOp(JSOP_NOP);
         node->pn_atom = result;
     }
 
@@ -567,18 +584,19 @@ FoldTypeOfExpr(JSContext* cx, ParseNode*
 
 static bool
 FoldDeleteExpr(JSContext* cx, ParseNode* node, PerHandlerParser<FullParseHandler>& parser)
 {
     MOZ_ASSERT(node->isKind(ParseNodeKind::DeleteExpr));
     MOZ_ASSERT(node->isArity(PN_UNARY));
 
     ParseNode*& expr = node->pn_kid;
-    if (!Fold(cx, &expr, parser))
+    if (!Fold(cx, &expr, parser)) {
         return false;
+    }
 
     // Expression deletion evaluates the expression, then evaluates to true.
     // For effectless expressions, eliminate the expression evaluation.
     if (IsEffectless(expr)) {
         node->setKind(ParseNodeKind::True);
         node->setArity(PN_NULLARY);
         node->setOp(JSOP_TRUE);
     }
@@ -589,62 +607,66 @@ FoldDeleteExpr(JSContext* cx, ParseNode*
 static bool
 FoldDeleteElement(JSContext* cx, ParseNode* node, PerHandlerParser<FullParseHandler>& parser)
 {
     MOZ_ASSERT(node->isKind(ParseNodeKind::DeleteElem));
     MOZ_ASSERT(node->isArity(PN_UNARY));
     MOZ_ASSERT(node->pn_kid->isKind(ParseNodeKind::Elem));
 
     ParseNode*& expr = node->pn_kid;
-    if (!Fold(cx, &expr, parser))
+    if (!Fold(cx, &expr, parser)) {
         return false;
+    }
 
     // If we're deleting an element, but constant-folding converted our
     // element reference into a dotted property access, we must *also*
     // morph the node's kind.
     //
     // In principle this also applies to |super["foo"] -> super.foo|,
     // but we don't constant-fold |super["foo"]| yet.
     MOZ_ASSERT(expr->isKind(ParseNodeKind::Elem) || expr->isKind(ParseNodeKind::Dot));
-    if (expr->isKind(ParseNodeKind::Dot))
+    if (expr->isKind(ParseNodeKind::Dot)) {
         node->setKind(ParseNodeKind::DeleteProp);
+    }
 
     return true;
 }
 
 static bool
 FoldDeleteProperty(JSContext* cx, ParseNode* node, PerHandlerParser<FullParseHandler>& parser)
 {
     MOZ_ASSERT(node->isKind(ParseNodeKind::DeleteProp));
     MOZ_ASSERT(node->isArity(PN_UNARY));
     MOZ_ASSERT(node->pn_kid->isKind(ParseNodeKind::Dot));
 
     ParseNode*& expr = node->pn_kid;
 #ifdef DEBUG
     ParseNodeKind oldKind = expr->getKind();
 #endif
 
-    if (!Fold(cx, &expr, parser))
+    if (!Fold(cx, &expr, parser)) {
         return false;
+    }
 
     MOZ_ASSERT(expr->isKind(oldKind),
                "kind should have remained invariant under folding");
 
     return true;
 }
 
 static bool
 FoldNot(JSContext* cx, ParseNode* node, PerHandlerParser<FullParseHandler>& parser)
 {
     MOZ_ASSERT(node->isKind(ParseNodeKind::Not));
     MOZ_ASSERT(node->isArity(PN_UNARY));
 
     ParseNode*& expr = node->pn_kid;
-    if (!FoldCondition(cx, &expr, parser))
+    if (!FoldCondition(cx, &expr, parser)) {
         return false;
+    }
 
     if (expr->isKind(ParseNodeKind::Number)) {
         double d = expr->pn_dval;
 
         if (d == 0 || IsNaN(d)) {
             node->setKind(ParseNodeKind::True);
             node->setOp(JSOP_TRUE);
         } else {
@@ -668,33 +690,35 @@ FoldUnaryArithmetic(JSContext* cx, Parse
 {
     MOZ_ASSERT(node->isKind(ParseNodeKind::BitNot) ||
                node->isKind(ParseNodeKind::Pos) ||
                node->isKind(ParseNodeKind::Neg),
                "need a different method for this node kind");
     MOZ_ASSERT(node->isArity(PN_UNARY));
 
     ParseNode*& expr = node->pn_kid;
-    if (!Fold(cx, &expr, parser))
+    if (!Fold(cx, &expr, parser)) {
         return false;
+    }
 
     if (expr->isKind(ParseNodeKind::Number) ||
         expr->isKind(ParseNodeKind::True) ||
         expr->isKind(ParseNodeKind::False))
     {
         double d = expr->isKind(ParseNodeKind::Number)
                    ? expr->pn_dval
                    : double(expr->isKind(ParseNodeKind::True));
 
-        if (node->isKind(ParseNodeKind::BitNot))
+        if (node->isKind(ParseNodeKind::BitNot)) {
             d = ~ToInt32(d);
-        else if (node->isKind(ParseNodeKind::Neg))
+        } else if (node->isKind(ParseNodeKind::Neg)) {
             d = -d;
-        else
+        } else {
             MOZ_ASSERT(node->isKind(ParseNodeKind::Pos)); // nothing to do
+        }
 
         node->setKind(ParseNodeKind::Number);
         node->setOp(JSOP_DOUBLE);
         node->setArity(PN_NULLARY);
         node->pn_dval = d;
     }
 
     return true;
@@ -707,18 +731,19 @@ FoldIncrementDecrement(JSContext* cx, Pa
                node->isKind(ParseNodeKind::PostIncrement) ||
                node->isKind(ParseNodeKind::PreDecrement) ||
                node->isKind(ParseNodeKind::PostDecrement));
     MOZ_ASSERT(node->isArity(PN_UNARY));
 
     ParseNode*& target = node->pn_kid;
     MOZ_ASSERT(parser.isValidSimpleAssignmentTarget(target, PermitAssignmentToFunctionCalls));
 
-    if (!Fold(cx, &target, parser))
+    if (!Fold(cx, &target, parser)) {
         return false;
+    }
 
     MOZ_ASSERT(parser.isValidSimpleAssignmentTarget(target, PermitAssignmentToFunctionCalls));
 
     return true;
 }
 
 static bool
 FoldAndOr(JSContext* cx, ParseNode** nodePtr, PerHandlerParser<FullParseHandler>& parser)
@@ -726,36 +751,38 @@ FoldAndOr(JSContext* cx, ParseNode** nod
     ParseNode* node = *nodePtr;
 
     MOZ_ASSERT(node->isKind(ParseNodeKind::And) || node->isKind(ParseNodeKind::Or));
     MOZ_ASSERT(node->isArity(PN_LIST));
 
     bool isOrNode = node->isKind(ParseNodeKind::Or);
     ParseNode** elem = &node->pn_head;
     do {
-        if (!Fold(cx, elem, parser))
+        if (!Fold(cx, elem, parser)) {
             return false;
+        }
 
         Truthiness t = Boolish(*elem);
 
         // If we don't know the constant-folded node's truthiness, we can't
         // reduce this node with its surroundings.  Continue folding any
         // remaining nodes.
         if (t == Unknown) {
             elem = &(*elem)->pn_next;
             continue;
         }
 
         // If the constant-folded node's truthiness will terminate the
         // condition -- `a || true || expr` or |b && false && expr| -- then
         // trailing nodes will never be evaluated.  Truncate the list after
         // the known-truthiness node, as it's the overall result.
         if ((t == Truthy) == isOrNode) {
-            for (ParseNode* next = (*elem)->pn_next; next; next = next->pn_next)
+            for (ParseNode* next = (*elem)->pn_next; next; next = next->pn_next) {
                 --node->pn_count;
+            }
 
             // Terminate the original and/or list at the known-truthiness
             // node.
             (*elem)->pn_next = nullptr;
             elem = &(*elem)->pn_next;
             break;
         }
 
@@ -805,52 +832,57 @@ FoldConditional(JSContext* cx, ParseNode
         nodePtr = nextNode;
         nextNode = nullptr;
 
         ParseNode* node = *nodePtr;
         MOZ_ASSERT(node->isKind(ParseNodeKind::Conditional));
         MOZ_ASSERT(node->isArity(PN_TERNARY));
 
         ParseNode*& expr = node->pn_kid1;
-        if (!FoldCondition(cx, &expr, parser))
+        if (!FoldCondition(cx, &expr, parser)) {
             return false;
+        }
 
         ParseNode*& ifTruthy = node->pn_kid2;
-        if (!Fold(cx, &ifTruthy, parser))
+        if (!Fold(cx, &ifTruthy, parser)) {
             return false;
+        }
 
         ParseNode*& ifFalsy = node->pn_kid3;
 
         // If our C?T:F node has F as another ?: node, *iteratively* constant-
         // fold F *after* folding C and T (and possibly eliminating C and one
         // of T/F entirely); otherwise fold F normally.  Making |nextNode| non-
         // null causes this loop to run again to fold F.
         //
         // Conceivably we could instead/also iteratively constant-fold T, if T
         // were more complex than F.  Such an optimization is unimplemented.
         if (ifFalsy->isKind(ParseNodeKind::Conditional)) {
             nextNode = &ifFalsy;
         } else {
-            if (!Fold(cx, &ifFalsy, parser))
+            if (!Fold(cx, &ifFalsy, parser)) {
                 return false;
+            }
         }
 
         // Try to constant-fold based on the condition expression.
         Truthiness t = Boolish(expr);
-        if (t == Unknown)
+        if (t == Unknown) {
             continue;
+        }
 
         // Otherwise reduce 'C ? T : F' to T or F as directed by C.
         ParseNode* replacement = t == Truthy ? ifTruthy : ifFalsy;
 
         // Otherwise perform a replacement.  This invalidates |nextNode|, so
         // reset it (if the replacement requires folding) or clear it (if
         // |ifFalsy| is dead code) as needed.
-        if (nextNode)
+        if (nextNode) {
             nextNode = (*nextNode == replacement) ? nodePtr : nullptr;
+        }
         ReplaceNode(nodePtr, replacement);
     } while (nextNode);
 
     return true;
 }
 
 static bool
 FoldIf(JSContext* cx, ParseNode** nodePtr, PerHandlerParser<FullParseHandler>& parser)
@@ -863,43 +895,47 @@ FoldIf(JSContext* cx, ParseNode** nodePt
         nodePtr = nextNode;
         nextNode = nullptr;
 
         ParseNode* node = *nodePtr;
         MOZ_ASSERT(node->isKind(ParseNodeKind::If));
         MOZ_ASSERT(node->isArity(PN_TERNARY));
 
         ParseNode*& expr = node->pn_kid1;
-        if (!FoldCondition(cx, &expr, parser))
+        if (!FoldCondition(cx, &expr, parser)) {
             return false;
+        }
 
         ParseNode*& consequent = node->pn_kid2;
-        if (!Fold(cx, &consequent, parser))
+        if (!Fold(cx, &consequent, parser)) {
             return false;
+        }
 
         ParseNode*& alternative = node->pn_kid3;
         if (alternative) {
             // If in |if (C) T; else F;| we have |F| as another |if|,
             // *iteratively* constant-fold |F| *after* folding |C| and |T| (and
             // possibly completely replacing the whole thing with |T| or |F|);
             // otherwise fold F normally.  Making |nextNode| non-null causes
             // this loop to run again to fold F.
             if (alternative->isKind(ParseNodeKind::If)) {
                 nextNode = &alternative;
             } else {
-                if (!Fold(cx, &alternative, parser))
+                if (!Fold(cx, &alternative, parser)) {
                     return false;
+                }
             }
         }
 
         // Eliminate the consequent or alternative if the condition has
         // constant truthiness.
         Truthiness t = Boolish(expr);
-        if (t == Unknown)
+        if (t == Unknown) {
             continue;
+        }
 
         // Careful!  Either of these can be null: |replacement| in |if (0) T;|,
         // and |discarded| in |if (true) T;|.
         ParseNode* replacement;
         ParseNode* discarded;
         if (t == Truthy) {
             replacement = consequent;
             discarded = alternative;
@@ -908,85 +944,96 @@ FoldIf(JSContext* cx, ParseNode** nodePt
             discarded = consequent;
         }
 
         bool performReplacement = true;
         if (discarded) {
             // A declaration that hoists outside the discarded arm prevents the
             // |if| from being folded away.
             bool containsHoistedDecls;
-            if (!ContainsHoistedDeclaration(cx, discarded, &containsHoistedDecls))
+            if (!ContainsHoistedDeclaration(cx, discarded, &containsHoistedDecls)) {
                 return false;
+            }
 
             performReplacement = !containsHoistedDecls;
         }
 
-        if (!performReplacement)
+        if (!performReplacement) {
             continue;
+        }
 
         if (!replacement) {
             // If there's no replacement node, we have a constantly-false |if|
             // with no |else|.  Replace the entire thing with an empty
             // statement list.
             node->setKind(ParseNodeKind::StatementList);
             node->setArity(PN_LIST);
             node->makeEmpty();
         } else {
             // Replacement invalidates |nextNode|, so reset it (if the
             // replacement requires folding) or clear it (if |alternative|
             // is dead code) as needed.
-            if (nextNode)
+            if (nextNode) {
                 nextNode = (*nextNode == replacement) ? nodePtr : nullptr;
+            }
             ReplaceNode(nodePtr, replacement);
         }
     } while (nextNode);
 
     return true;
 }
 
 static bool
 FoldFunction(JSContext* cx, ParseNode* node, PerHandlerParser<FullParseHandler>& parser)
 {
     MOZ_ASSERT(node->isKind(ParseNodeKind::Function));
     MOZ_ASSERT(node->isArity(PN_CODE));
 
     // Don't constant-fold inside "use asm" code, as this could create a parse
     // tree that doesn't type-check as asm.js.
-    if (node->pn_funbox->useAsmOrInsideUseAsm())
+    if (node->pn_funbox->useAsmOrInsideUseAsm()) {
         return true;
+    }
 
     // Note: pn_body is null for lazily-parsed functions.
     if (ParseNode*& functionBody = node->pn_body) {
-        if (!Fold(cx, &functionBody, parser))
+        if (!Fold(cx, &functionBody, parser)) {
             return false;
+        }
     }
 
     return true;
 }
 
 static double
 ComputeBinary(ParseNodeKind kind, double left, double right)
 {
-    if (kind == ParseNodeKind::Add)
+    if (kind == ParseNodeKind::Add) {
         return left + right;
+    }
 
-    if (kind == ParseNodeKind::Sub)
+    if (kind == ParseNodeKind::Sub) {
         return left - right;
+    }
 
-    if (kind == ParseNodeKind::Star)
+    if (kind == ParseNodeKind::Star) {
         return left * right;
+    }
 
-    if (kind == ParseNodeKind::Mod)
+    if (kind == ParseNodeKind::Mod) {
         return NumberMod(left, right);
+    }
 
-    if (kind == ParseNodeKind::Ursh)
+    if (kind == ParseNodeKind::Ursh) {
         return ToUint32(left) >> (ToUint32(right) & 31);
+    }
 
-    if (kind == ParseNodeKind::Div)
+    if (kind == ParseNodeKind::Div) {
         return NumberDiv(left, right);
+    }
 
     MOZ_ASSERT(kind == ParseNodeKind::Lsh || kind == ParseNodeKind::Rsh);
 
     int32_t i = ToInt32(left);
     uint32_t j = ToUint32(right) & 31;
     return int32_t((kind == ParseNodeKind::Lsh) ? uint32_t(i) << j : i >> j);
 }
 
@@ -1012,38 +1059,41 @@ FoldBinaryArithmetic(JSContext* cx, Pars
                node->isKind(ParseNodeKind::Div) ||
                node->isKind(ParseNodeKind::Mod));
     MOZ_ASSERT(node->isArity(PN_LIST));
     MOZ_ASSERT(node->pn_count >= 2);
 
     // Fold each operand, ideally into a number.
     ParseNode** listp = &node->pn_head;
     for (; *listp; listp = &(*listp)->pn_next) {
-        if (!Fold(cx, listp, parser))
+        if (!Fold(cx, listp, parser)) {
             return false;
+        }
 
-        if (!FoldType(cx, *listp, ParseNodeKind::Number))
+        if (!FoldType(cx, *listp, ParseNodeKind::Number)) {
             return false;
+        }
     }
 
     // Repoint the list's tail pointer.
     node->pn_tail = listp;
 
     // Now fold all leading numeric terms together into a single number.
     // (Trailing terms for the non-shift operations can't be folded together
     // due to floating point imprecision.  For example, if |x === -2**53|,
     // |x - 1 - 1 === -2**53| but |x - 2 === -2**53 - 2|.  Shifts could be
     // folded, but it doesn't seem worth the effort.)
     ParseNode* elem = node->pn_head;
     ParseNode* next = elem->pn_next;
     if (elem->isKind(ParseNodeKind::Number)) {
         ParseNodeKind kind = node->getKind();
         while (true) {
-            if (!next || !next->isKind(ParseNodeKind::Number))
+            if (!next || !next->isKind(ParseNodeKind::Number)) {
                 break;
+            }
 
             double d = ComputeBinary(kind, elem->pn_dval, next->pn_dval);
 
             next = next->pn_next;
             elem->pn_next = next;
 
             elem->setKind(ParseNodeKind::Number);
             elem->setOp(JSOP_DOUBLE);
@@ -1073,38 +1123,42 @@ FoldExponentiation(JSContext* cx, ParseN
 {
     MOZ_ASSERT(node->isKind(ParseNodeKind::Pow));
     MOZ_ASSERT(node->isArity(PN_LIST));
     MOZ_ASSERT(node->pn_count >= 2);
 
     // Fold each operand, ideally into a number.
     ParseNode** listp = &node->pn_head;
     for (; *listp; listp = &(*listp)->pn_next) {
-        if (!Fold(cx, listp, parser))
+        if (!Fold(cx, listp, parser)) {
             return false;
+        }
 
-        if (!FoldType(cx, *listp, ParseNodeKind::Number))
+        if (!FoldType(cx, *listp, ParseNodeKind::Number)) {
             return false;
+        }
     }
 
     // Repoint the list's tail pointer.
     node->pn_tail = listp;
 
     // Unlike all other binary arithmetic operators, ** is right-associative:
     // 2**3**5 is 2**(3**5), not (2**3)**5.  As list nodes singly-link their
     // children, full constant-folding requires either linear space or dodgy
     // in-place linked list reversal.  So we only fold one exponentiation: it's
     // easy and addresses common cases like |2**32|.
-    if (node->pn_count > 2)
+    if (node->pn_count > 2) {
         return true;
+    }
 
     ParseNode* base = node->pn_head;
     ParseNode* exponent = base->pn_next;
-    if (!base->isKind(ParseNodeKind::Number) || !exponent->isKind(ParseNodeKind::Number))
+    if (!base->isKind(ParseNodeKind::Number) || !exponent->isKind(ParseNodeKind::Number)) {
         return true;
+    }
 
     double d1 = base->pn_dval, d2 = exponent->pn_dval;
 
     node->setKind(ParseNodeKind::Number);
     node->setArity(PN_NULLARY);
     node->setOp(JSOP_DOUBLE);
     node->pn_dval = ecmaPow(d1, d2);
     return true;
@@ -1112,18 +1166,19 @@ FoldExponentiation(JSContext* cx, ParseN
 
 static bool
 FoldList(JSContext* cx, ParseNode* list, PerHandlerParser<FullParseHandler>& parser)
 {
     MOZ_ASSERT(list->isArity(PN_LIST));
 
     ParseNode** elem = &list->pn_head;
     for (; *elem; elem = &(*elem)->pn_next) {
-        if (!Fold(cx, elem, parser))
+        if (!Fold(cx, elem, parser)) {
             return false;
+        }
     }
 
     // Repoint the list's tail pointer if the final element was replaced.
     list->pn_tail = elem;
 
     list->checkListConsistency();
 
     return true;
@@ -1131,100 +1186,110 @@ FoldList(JSContext* cx, ParseNode* list,
 
 static bool
 FoldReturn(JSContext* cx, ParseNode* node, PerHandlerParser<FullParseHandler>& parser)
 {
     MOZ_ASSERT(node->isKind(ParseNodeKind::Return));
     MOZ_ASSERT(node->isArity(PN_UNARY));
 
     if (ParseNode*& expr = node->pn_kid) {
-        if (!Fold(cx, &expr, parser))
+        if (!Fold(cx, &expr, parser)) {
             return false;
+        }
     }
 
     return true;
 }
 
 static bool
 FoldTry(JSContext* cx, ParseNode* node, PerHandlerParser<FullParseHandler>& parser)
 {
     MOZ_ASSERT(node->isKind(ParseNodeKind::Try));
     MOZ_ASSERT(node->isArity(PN_TERNARY));
 
     ParseNode*& statements = node->pn_kid1;
-    if (!Fold(cx, &statements, parser))
+    if (!Fold(cx, &statements, parser)) {
         return false;
+    }
 
     if (ParseNode*& catchScope = node->pn_kid2) {
-        if (!Fold(cx, &catchScope, parser))
+        if (!Fold(cx, &catchScope, parser)) {
             return false;
+        }
     }
 
     if (ParseNode*& finally = node->pn_kid3) {
-        if (!Fold(cx, &finally, parser))
+        if (!Fold(cx, &finally, parser)) {
             return false;
+        }
     }
 
     return true;
 }
 
 static bool
 FoldCatch(JSContext* cx, ParseNode* node, PerHandlerParser<FullParseHandler>& parser)
 {
     MOZ_ASSERT(node->isKind(ParseNodeKind::Catch));
     MOZ_ASSERT(node->isArity(PN_BINARY));
 
     if (ParseNode*& declPattern = node->pn_left) {
-        if (!Fold(cx, &declPattern, parser))
+        if (!Fold(cx, &declPattern, parser)) {
             return false;
+        }
     }
 
     if (ParseNode*& statements = node->pn_right) {
-        if (!Fold(cx, &statements, parser))
+        if (!Fold(cx, &statements, parser)) {
             return false;
+        }
     }
 
     return true;
 }
 
 static bool
 FoldClass(JSContext* cx, ParseNode* node, PerHandlerParser<FullParseHandler>& parser)
 {
     MOZ_ASSERT(node->isKind(ParseNodeKind::Class));
     MOZ_ASSERT(node->isArity(PN_TERNARY));
 
     if (ParseNode*& classNames = node->pn_kid1) {
-        if (!Fold(cx, &classNames, parser))
+        if (!Fold(cx, &classNames, parser)) {
             return false;
+        }
     }
 
     if (ParseNode*& heritage = node->pn_kid2) {
-        if (!Fold(cx, &heritage, parser))
+        if (!Fold(cx, &heritage, parser)) {
             return false;
+        }
     }
 
     ParseNode*& body = node->pn_kid3;
     return Fold(cx, &body, parser);
 }
 
 static bool
 FoldElement(JSContext* cx, ParseNode** nodePtr, PerHandlerParser<FullParseHandler>& parser)
 {
     ParseNode* node = *nodePtr;
 
     MOZ_ASSERT(node->isKind(ParseNodeKind::Elem));
     MOZ_ASSERT(node->isArity(PN_BINARY));
 
     ParseNode*& expr = node->pn_left;
-    if (!Fold(cx, &expr, parser))
+    if (!Fold(cx, &expr, parser)) {
         return false;
+    }
 
     ParseNode*& key = node->pn_right;
-    if (!Fold(cx, &key, parser))
+    if (!Fold(cx, &key, parser)) {
         return false;
+    }
 
     PropertyName* name = nullptr;
     if (key->isKind(ParseNodeKind::String)) {
         JSAtom* atom = key->pn_atom;
         uint32_t index;
 
         if (atom->isIndex(&index)) {
             // Optimization 1: We have something like expr["100"]. This is
@@ -1237,162 +1302,179 @@ FoldElement(JSContext* cx, ParseNode** n
         }
     } else if (key->isKind(ParseNodeKind::Number)) {
         double number = key->pn_dval;
         if (number != ToUint32(number)) {
             // Optimization 2: We have something like expr[3.14]. The number
             // isn't an array index, so it converts to a string ("3.14"),
             // enabling optimization 3 below.
             JSAtom* atom = NumberToAtom(cx, number);
-            if (!atom)
+            if (!atom) {
                 return false;
+            }
             name = atom->asPropertyName();
         }
     }
 
     // If we don't have a name, we can't optimize to getprop.
-    if (!name)
+    if (!name) {
         return true;
+    }
 
     // Optimization 3: We have expr["foo"] where foo is not an index.  Convert
     // to a property access (like expr.foo) that optimizes better downstream.
     ParseNode* nameNode = parser.newPropertyName(name, key->pn_pos);
-    if (!nameNode)
+    if (!nameNode) {
         return false;
+    }
     ParseNode* dottedAccess = parser.newPropertyAccess(expr, nameNode);
-    if (!dottedAccess)
+    if (!dottedAccess) {
         return false;
+    }
     dottedAccess->setInParens(node->isInParens());
     ReplaceNode(nodePtr, dottedAccess);
 
     return true;
 }
 
 static bool
 FoldAdd(JSContext* cx, ParseNode** nodePtr, PerHandlerParser<FullParseHandler>& parser)
 {
     ParseNode* node = *nodePtr;
 
     MOZ_ASSERT(node->isKind(ParseNodeKind::Add));
     MOZ_ASSERT(node->isArity(PN_LIST));
     MOZ_ASSERT(node->pn_count >= 2);
 
     // Generically fold all operands first.
-    if (!FoldList(cx, node, parser))
+    if (!FoldList(cx, node, parser)) {
         return false;
+    }
 
     // Fold leading numeric operands together:
     //
     //   (1 + 2 + x)  becomes  (3 + x)
     //
     // Don't go past the leading operands: additions after a string are
     // string concatenations, not additions: ("1" + 2 + 3 === "123").
     ParseNode* current = node->pn_head;
     ParseNode* next = current->pn_next;
     if (current->isKind(ParseNodeKind::Number)) {
         do {
-            if (!next->isKind(ParseNodeKind::Number))
+            if (!next->isKind(ParseNodeKind::Number)) {
                 break;
+            }
 
             current->pn_dval += next->pn_dval;
             current->pn_next = next->pn_next;
             next = current->pn_next;
 
             MOZ_ASSERT(node->pn_count > 1);
             node->pn_count--;
         } while (next);
     }
 
     // If any operands remain, attempt string concatenation folding.
     do {
         // If no operands remain, we're done.
-        if (!next)
+        if (!next) {
             break;
+        }
 
         // (number + string) is string concatenation *only* at the start of
         // the list: (x + 1 + "2" !== x + "12") when x is a number.
         if (current->isKind(ParseNodeKind::Number) && next->isKind(ParseNodeKind::String)) {
-            if (!FoldType(cx, current, ParseNodeKind::String))
+            if (!FoldType(cx, current, ParseNodeKind::String)) {
                 return false;
+            }
             next = current->pn_next;
         }
 
         // The first string forces all subsequent additions to be
         // string concatenations.
         do {
-            if (current->isKind(ParseNodeKind::String))
+            if (current->isKind(ParseNodeKind::String)) {
                 break;
+            }
 
             current = next;
             next = next->pn_next;
         } while (next);
 
         // If there's nothing left to fold, we're done.
-        if (!next)
+        if (!next) {
             break;
+        }
 
         RootedString combination(cx);
         RootedString tmp(cx);
         do {
             // Create a rope of the current string and all succeeding
             // constants that we can convert to strings, then atomize it
             // and replace them all with that fresh string.
             MOZ_ASSERT(current->isKind(ParseNodeKind::String));
 
             combination = current->pn_atom;
 
             do {
                 // Try folding the next operand to a string.
-                if (!FoldType(cx, next, ParseNodeKind::String))
+                if (!FoldType(cx, next, ParseNodeKind::String)) {
                     return false;
+                }
 
                 // Stop glomming once folding doesn't produce a string.
-                if (!next->isKind(ParseNodeKind::String))
+                if (!next->isKind(ParseNodeKind::String)) {
                     break;
+                }
 
                 // Add this string to the combination and remove the node.
                 tmp = next->pn_atom;
                 combination = ConcatStrings<CanGC>(cx, combination, tmp);
-                if (!combination)
+                if (!combination) {
                     return false;
+                }
 
                 next = next->pn_next;
                 current->pn_next = next;
 
                 MOZ_ASSERT(node->pn_count > 1);
                 node->pn_count--;
             } while (next);
 
             // Replace |current|'s string with the entire combination.
             MOZ_ASSERT(current->isKind(ParseNodeKind::String));
             combination = AtomizeString(cx, combination);
-            if (!combination)
+            if (!combination) {
                 return false;
+            }
             current->pn_atom = &combination->asAtom();
 
 
             // If we're out of nodes, we're done.
-            if (!next)
+            if (!next) {
                 break;
+            }
 
             current = next;
             next = current->pn_next;
 
             // If we're out of nodes *after* the non-foldable-to-string
             // node, we're done.
-            if (!next)
+            if (!next) {
                 break;
+            }
 
             // Otherwise find the next node foldable to a string, and loop.
             do {
                 current = next;
                 next = current->pn_next;
 
-                if (!FoldType(cx, current, ParseNodeKind::String))
+                if (!FoldType(cx, current, ParseNodeKind::String)) {
                     return false;
+                }
                 next = current->pn_next;
             } while (!current->isKind(ParseNodeKind::String) && next);
         } while (next);
     } while (false);
 
     MOZ_ASSERT(!next, "must have considered all nodes here");
     MOZ_ASSERT(!current->pn_next, "current node must be the last node");
 
@@ -1425,37 +1507,40 @@ FoldCall(JSContext* cx, ParseNode* node,
     //   assertEq((true ? obj.f : null)(), "global");
     //   assertEq(obj.f(), "obj");
     //   assertEq((true ? obj.f : null)``, "global");
     //   assertEq(obj.f``, "obj");
     //
     // See bug 537673 and bug 1182373.
     ParseNode** pn_callee = &node->pn_left;
     if (node->isKind(ParseNodeKind::New) || !(*pn_callee)->isInParens()) {
-        if (!Fold(cx, pn_callee, parser))
+        if (!Fold(cx, pn_callee, parser)) {
             return false;
+        }
     }
 
     ParseNode** pn_args = &node->pn_right;
-    if (!Fold(cx, pn_args, parser))
+    if (!Fold(cx, pn_args, parser)) {
         return false;
+    }
 
     return true;
 }
 
 static bool
 FoldArguments(JSContext* cx, ParseNode* node, PerHandlerParser<FullParseHandler>& parser)
 {
     MOZ_ASSERT(node->isKind(ParseNodeKind::Arguments));
     MOZ_ASSERT(node->isArity(PN_LIST));
 
     ParseNode** listp = &node->pn_head;
     for (; *listp; listp = &(*listp)->pn_next) {
-        if (!Fold(cx, listp, parser))
+        if (!Fold(cx, listp, parser)) {
             return false;
+        }
     }
 
     // If the last node in the list was replaced, pn_tail points into the wrong node.
     node->pn_tail = listp;
 
     node->checkListConsistency();
     return true;
 }
@@ -1474,31 +1559,35 @@ FoldForInOrOf(JSContext* cx, ParseNode* 
 
 static bool
 FoldForHead(JSContext* cx, ParseNode* node, PerHandlerParser<FullParseHandler>& parser)
 {
     MOZ_ASSERT(node->isKind(ParseNodeKind::ForHead));
     MOZ_ASSERT(node->isArity(PN_TERNARY));
 
     if (ParseNode*& init = node->pn_kid1) {
-        if (!Fold(cx, &init, parser))
+        if (!Fold(cx, &init, parser)) {
             return false;
+        }
     }
 
     if (ParseNode*& test = node->pn_kid2) {
-        if (!FoldCondition(cx, &test, parser))
+        if (!FoldCondition(cx, &test, parser)) {
             return false;
+        }
 
-        if (test->isKind(ParseNodeKind::True))
+        if (test->isKind(ParseNodeKind::True)) {
             test = nullptr;
+        }
     }
 
     if (ParseNode*& update = node->pn_kid3) {
-        if (!Fold(cx, &update, parser))
+        if (!Fold(cx, &update, parser)) {
             return false;
+        }
     }
 
     return true;
 }
 
 static bool
 FoldDottedProperty(JSContext* cx, ParseNode* node, PerHandlerParser<FullParseHandler>& parser)
 {
@@ -1517,27 +1606,29 @@ FoldDottedProperty(JSContext* cx, ParseN
 }
 
 static bool
 FoldName(JSContext* cx, ParseNode* node, PerHandlerParser<FullParseHandler>& parser)
 {
     MOZ_ASSERT(node->isKind(ParseNodeKind::Name));
     MOZ_ASSERT(node->isArity(PN_NAME));
 
-    if (!node->pn_expr)
+    if (!node->pn_expr) {
         return true;
+    }
 
     return Fold(cx, &node->pn_expr, parser);
 }
 
 bool
 Fold(JSContext* cx, ParseNode** pnp, PerHandlerParser<FullParseHandler>& parser)
 {
-    if (!CheckRecursionLimit(cx))
+    if (!CheckRecursionLimit(cx)) {
         return false;
+    }
 
     ParseNode* pn = *pnp;
 
     switch (pn->getKind()) {
       case ParseNodeKind::EmptyStatement:
       case ParseNodeKind::RegExp:
       case ParseNodeKind::String:
       case ParseNodeKind::True:
@@ -1613,18 +1704,19 @@ Fold(JSContext* cx, ParseNode** pnp, Per
         return Fold(cx, &pn->pn_kid, parser);
 
       case ParseNodeKind::ExportDefault:
         MOZ_ASSERT(pn->isArity(PN_BINARY));
         return Fold(cx, &pn->pn_left, parser);
 
       case ParseNodeKind::This:
         MOZ_ASSERT(pn->isArity(PN_UNARY));
-        if (ParseNode*& expr = pn->pn_kid)
+        if (ParseNode*& expr = pn->pn_kid) {
             return Fold(cx, &expr, parser);
+        }
         return true;
 
       case ParseNodeKind::Pipeline:
         return true;
 
       case ParseNodeKind::And:
       case ParseNodeKind::Or:
         return FoldAndOr(cx, pnp, parser);
@@ -1686,18 +1778,19 @@ Fold(JSContext* cx, ParseNode** pnp, Per
 
       case ParseNodeKind::YieldStar:
         MOZ_ASSERT(pn->isArity(PN_UNARY));
         return Fold(cx, &pn->pn_kid, parser);
 
       case ParseNodeKind::Yield:
       case ParseNodeKind::Await:
         MOZ_ASSERT(pn->isArity(PN_UNARY));
-        if (!pn->pn_kid)
+        if (!pn->pn_kid) {
             return true;
+        }
         return Fold(cx, &pn->pn_kid, parser);
 
       case ParseNodeKind::Return:
         return FoldReturn(cx, pn, parser);
 
       case ParseNodeKind::Try:
         return FoldTry(cx, pn, parser);
 
@@ -1759,18 +1852,19 @@ Fold(JSContext* cx, ParseNode** pnp, Per
       case ParseNodeKind::CallImport:
         MOZ_ASSERT(pn->isArity(PN_BINARY));
         MOZ_ASSERT(pn->pn_left->isKind(ParseNodeKind::PosHolder));
         return Fold(cx, &pn->pn_right, parser);
 
       case ParseNodeKind::ClassNames:
         MOZ_ASSERT(pn->isArity(PN_BINARY));
         if (ParseNode*& outerBinding = pn->pn_left) {
-            if (!Fold(cx, &outerBinding, parser))
+            if (!Fold(cx, &outerBinding, parser)) {
                 return false;
+            }
         }
         return Fold(cx, &pn->pn_right, parser);
 
       case ParseNodeKind::DoWhile:
         MOZ_ASSERT(pn->isArity(PN_BINARY));
         return Fold(cx, &pn->pn_left, parser) &&
                FoldCondition(cx, &pn->pn_right, parser);
 
@@ -1779,18 +1873,19 @@ Fold(JSContext* cx, ParseNode** pnp, Per
         return FoldCondition(cx, &pn->pn_left, parser) &&
                Fold(cx, &pn->pn_right, parser);
 
       case ParseNodeKind::Case: {
         MOZ_ASSERT(pn->isArity(PN_BINARY));
 
         // pn_left is null for DefaultClauses.
         if (pn->pn_left) {
-            if (!Fold(cx, &pn->pn_left, parser))
+            if (!Fold(cx, &pn->pn_left, parser)) {
                 return false;
+            }
         }
         return Fold(cx, &pn->pn_right, parser);
       }
 
       case ParseNodeKind::With:
         MOZ_ASSERT(pn->isArity(PN_BINARY));
         return Fold(cx, &pn->pn_left, parser) &&
                Fold(cx, &pn->pn_right, parser);
@@ -1809,18 +1904,19 @@ Fold(JSContext* cx, ParseNode** pnp, Per
       case ParseNodeKind::PropertyName:
         MOZ_CRASH("unreachable, handled by ::Dot");
 
       case ParseNodeKind::Dot:
         return FoldDottedProperty(cx, pn, parser);
 
       case ParseNodeKind::LexicalScope:
         MOZ_ASSERT(pn->isArity(PN_SCOPE));
-        if (!pn->scopeBody())
+        if (!pn->scopeBody()) {
             return true;
+        }
         return Fold(cx, &pn->pn_u.scope.body, parser);
 
       case ParseNodeKind::Name:
         return FoldName(cx, pn, parser);
 
       case ParseNodeKind::Limit: // invalid sentinel value
         MOZ_CRASH("invalid node kind");
     }
@@ -1829,14 +1925,15 @@ Fold(JSContext* cx, ParseNode** pnp, Per
     return false;
 }
 
 bool
 frontend::FoldConstants(JSContext* cx, ParseNode** pnp, PerHandlerParser<FullParseHandler>* parser)
 {
     // Don't constant-fold inside "use asm" code, as this could create a parse
     // tree that doesn't type-check as asm.js.
-    if (parser->pc->useAsmOrInsideUseAsm())
+    if (parser->pc->useAsmOrInsideUseAsm()) {
         return true;
+    }
 
     AutoTraceLog traceLog(TraceLoggerForCurrentThread(cx), TraceLogger_BytecodeFoldConstants);
     return Fold(cx, pnp, *parser);
 }
--- a/js/src/frontend/ForInEmitter.cpp
+++ b/js/src/frontend/ForInEmitter.cpp
@@ -36,67 +36,75 @@ ForInEmitter::emitIterated()
 }
 
 bool
 ForInEmitter::emitInitialize()
 {
     MOZ_ASSERT(state_ == State::Iterated);
     tdzCacheForIteratedValue_.reset();
 
-    if (!bce_->emit1(JSOP_ITER))                      // ITER
+    if (!bce_->emit1(JSOP_ITER)) {                    // ITER
         return false;
+    }
 
     // For-in loops have both the iterator and the value on the stack. Push
     // undefined to balance the stack.
-    if (!bce_->emit1(JSOP_UNDEFINED))                 // ITER ITERVAL
+    if (!bce_->emit1(JSOP_UNDEFINED)) {               // ITER ITERVAL
         return false;
+    }
 
     loopInfo_.emplace(bce_, StatementKind::ForInLoop);
 
     // Annotate so IonMonkey can find the loop-closing jump.
-    if (!bce_->newSrcNote(SRC_FOR_IN, &noteIndex_))
+    if (!bce_->newSrcNote(SRC_FOR_IN, &noteIndex_)) {
         return false;
+    }
 
     // Jump down to the loop condition to minimize overhead (assuming at
     // least one iteration, just like the other loop forms).
-    if (!loopInfo_->emitEntryJump(bce_))              // ITER ITERVAL
+    if (!loopInfo_->emitEntryJump(bce_)) {            // ITER ITERVAL
         return false;
+    }
 
-    if (!loopInfo_->emitLoopHead(bce_, Nothing()))    // ITER ITERVAL
+    if (!loopInfo_->emitLoopHead(bce_, Nothing())) {  // ITER ITERVAL
         return false;
+    }
 
     // If the loop had an escaping lexical declaration, reset the declaration's
     // bindings to uninitialized to implement TDZ semantics.
     if (headLexicalEmitterScope_) {
         // The environment chain only includes an environment for the
         // for-in loop head *if* a scope binding is captured, thereby
         // requiring recreation each iteration. If a lexical scope exists
         // for the head, it must be the innermost one. If that scope has
         // closed-over bindings inducing an environment, recreate the
         // current environment.
         MOZ_ASSERT(headLexicalEmitterScope_ == bce_->innermostEmitterScope());
         MOZ_ASSERT(headLexicalEmitterScope_->scope(bce_)->kind() == ScopeKind::Lexical);
 
         if (headLexicalEmitterScope_->hasEnvironment()) {
-            if (!bce_->emit1(JSOP_RECREATELEXICALENV))
+            if (!bce_->emit1(JSOP_RECREATELEXICALENV)) {
                 return false;                         // ITER ITERVAL
+            }
         }
 
         // For uncaptured bindings, put them back in TDZ.
-        if (!headLexicalEmitterScope_->deadZoneFrameSlots(bce_))
+        if (!headLexicalEmitterScope_->deadZoneFrameSlots(bce_)) {
             return false;
+        }
     }
 
 #ifdef DEBUG
     loopDepth_ = bce_->stackDepth;
 #endif
     MOZ_ASSERT(loopDepth_ >= 2);
 
-    if (!bce_->emit1(JSOP_ITERNEXT))                  // ITER ITERVAL
+    if (!bce_->emit1(JSOP_ITERNEXT)) {                // ITER ITERVAL
         return false;
+    }
 
 #ifdef DEBUG
     state_ = State::Initialize;
 #endif
     return true;
 }
 
 bool
@@ -117,54 +125,63 @@ bool
 ForInEmitter::emitEnd(const Maybe<uint32_t>& forPos)
 {
     MOZ_ASSERT(state_ == State::Body);
 
     loopInfo_->setContinueTarget(bce_->offset());
 
     if (forPos) {
         // Make sure this code is attributed to the "for".
-        if (!bce_->updateSourceCoordNotes(*forPos))
+        if (!bce_->updateSourceCoordNotes(*forPos)) {
             return false;
+        }
     }
 
-    if (!loopInfo_->emitLoopEntry(bce_, Nothing()))   // ITER ITERVAL
+    if (!loopInfo_->emitLoopEntry(bce_, Nothing())) { // ITER ITERVAL
         return false;
-    if (!bce_->emit1(JSOP_POP))                       // ITER
+    }
+    if (!bce_->emit1(JSOP_POP)) {                     // ITER
         return false;
-    if (!bce_->emit1(JSOP_MOREITER))                  // ITER NEXTITERVAL?
+    }
+    if (!bce_->emit1(JSOP_MOREITER)) {                // ITER NEXTITERVAL?
         return false;
-    if (!bce_->emit1(JSOP_ISNOITER))                  // ITER NEXTITERVAL? ISNOITER
+    }
+    if (!bce_->emit1(JSOP_ISNOITER)) {                // ITER NEXTITERVAL? ISNOITER
         return false;
+    }
 
-    if (!loopInfo_->emitLoopEnd(bce_, JSOP_IFEQ))     // ITER NEXTITERVAL
+    if (!loopInfo_->emitLoopEnd(bce_, JSOP_IFEQ)) {   // ITER NEXTITERVAL
         return false;
+    }
 
     // Set the srcnote offset so we can find the closing jump.
     if (!bce_->setSrcNoteOffset(noteIndex_, SrcNote::ForIn::BackJumpOffset,
                                 loopInfo_->loopEndOffsetFromEntryJump()))
     {
         return false;
     }
 
-    if (!loopInfo_->patchBreaksAndContinues(bce_))
+    if (!loopInfo_->patchBreaksAndContinues(bce_)) {
         return false;
+    }
 
     // Pop the enumeration value.
-    if (!bce_->emit1(JSOP_POP))                       // ITER
+    if (!bce_->emit1(JSOP_POP)) {                     // ITER
         return false;
+    }
 
     if (!bce_->tryNoteList.append(JSTRY_FOR_IN, bce_->stackDepth, loopInfo_->headOffset(),
                                   bce_->offset()))
     {
         return false;
     }
 
-    if (!bce_->emit1(JSOP_ENDITER))                   //
+    if (!bce_->emit1(JSOP_ENDITER)) {                 //
         return false;
+    }
 
     loopInfo_.reset();
 
 #ifdef DEBUG
     state_ = State::End;
 #endif
     return true;
 }
--- a/js/src/frontend/ForOfEmitter.cpp
+++ b/js/src/frontend/ForOfEmitter.cpp
@@ -46,115 +46,136 @@ ForOfEmitter::emitIterated()
 bool
 ForOfEmitter::emitInitialize(const Maybe<uint32_t>& forPos)
 {
     MOZ_ASSERT(state_ == State::Iterated);
 
     tdzCacheForIteratedValue_.reset();
 
     if (iterKind_ == IteratorKind::Async) {
-        if (!bce_->emitAsyncIterator())               // NEXT ITER
+        if (!bce_->emitAsyncIterator()) {             // NEXT ITER
             return false;
+        }
     } else {
-        if (!bce_->emitIterator())                    // NEXT ITER
+        if (!bce_->emitIterator()) {                  // NEXT ITER
             return false;
+        }
     }
 
     int32_t iterDepth = bce_->stackDepth;
 
     // For-of loops have the iterator next method, the iterator itself, and
     // the result.value on the stack.
     // Push an undefined to balance the stack.
-    if (!bce_->emit1(JSOP_UNDEFINED))                 // NEXT ITER UNDEF
+    if (!bce_->emit1(JSOP_UNDEFINED)) {               // NEXT ITER UNDEF
         return false;
+    }
 
     loopInfo_.emplace(bce_, iterDepth, allowSelfHostedIter_, iterKind_);
 
     // Annotate so IonMonkey can find the loop-closing jump.
-    if (!bce_->newSrcNote(SRC_FOR_OF, &noteIndex_))
+    if (!bce_->newSrcNote(SRC_FOR_OF, &noteIndex_)) {
         return false;
+    }
 
-    if (!loopInfo_->emitEntryJump(bce_))              // NEXT ITER UNDEF
+    if (!loopInfo_->emitEntryJump(bce_)) {            // NEXT ITER UNDEF
         return false;
+    }
 
-    if (!loopInfo_->emitLoopHead(bce_, Nothing()))    // NEXT ITER UNDEF
+    if (!loopInfo_->emitLoopHead(bce_, Nothing())) {  // NEXT ITER UNDEF
         return false;
+    }
 
     // If the loop had an escaping lexical declaration, replace the current
     // environment with an dead zoned one to implement TDZ semantics.
     if (headLexicalEmitterScope_) {
         // The environment chain only includes an environment for the for-of
         // loop head *if* a scope binding is captured, thereby requiring
         // recreation each iteration. If a lexical scope exists for the head,
         // it must be the innermost one. If that scope has closed-over
         // bindings inducing an environment, recreate the current environment.
         MOZ_ASSERT(headLexicalEmitterScope_ == bce_->innermostEmitterScope());
         MOZ_ASSERT(headLexicalEmitterScope_->scope(bce_)->kind() == ScopeKind::Lexical);
 
         if (headLexicalEmitterScope_->hasEnvironment()) {
-            if (!bce_->emit1(JSOP_RECREATELEXICALENV))
+            if (!bce_->emit1(JSOP_RECREATELEXICALENV)) {
                 return false;                         // NEXT ITER UNDEF
+            }
         }
 
         // For uncaptured bindings, put them back in TDZ.
-        if (!headLexicalEmitterScope_->deadZoneFrameSlots(bce_))
+        if (!headLexicalEmitterScope_->deadZoneFrameSlots(bce_)) {
             return false;
+        }
     }
 
 #ifdef DEBUG
     loopDepth_ = bce_->stackDepth;
 #endif
 
     // Make sure this code is attributed to the "for".
     if (forPos) {
-        if (!bce_->updateSourceCoordNotes(*forPos))
+        if (!bce_->updateSourceCoordNotes(*forPos)) {
             return false;
+        }
     }
 
-    if (!bce_->emit1(JSOP_POP))                       // NEXT ITER
+    if (!bce_->emit1(JSOP_POP)) {                     // NEXT ITER
         return false;
-    if (!bce_->emit1(JSOP_DUP2))                      // NEXT ITER NEXT ITER
+    }
+    if (!bce_->emit1(JSOP_DUP2)) {                    // NEXT ITER NEXT ITER
         return false;
+    }
 
-    if (!bce_->emitIteratorNext(forPos, iterKind_, allowSelfHostedIter_))
+    if (!bce_->emitIteratorNext(forPos, iterKind_, allowSelfHostedIter_)) {
         return false;                                 // NEXT ITER RESULT
+    }
 
-    if (!bce_->emit1(JSOP_DUP))                       // NEXT ITER RESULT RESULT
+    if (!bce_->emit1(JSOP_DUP)) {                     // NEXT ITER RESULT RESULT
         return false;
-    if (!bce_->emitAtomOp(bce_->cx->names().done, JSOP_GETPROP))
+    }
+    if (!bce_->emitAtomOp(bce_->cx->names().done, JSOP_GETPROP)) {
         return false;                                 // NEXT ITER RESULT DONE
+    }
 
     InternalIfEmitter ifDone(bce_);
 
-    if (!ifDone.emitThen())                           // NEXT ITER RESULT
+    if (!ifDone.emitThen()) {                         // NEXT ITER RESULT
         return false;
+    }
 
     // Remove RESULT from the stack to release it.
-    if (!bce_->emit1(JSOP_POP))                       // NEXT ITER
+    if (!bce_->emit1(JSOP_POP)) {                     // NEXT ITER
         return false;
-    if (!bce_->emit1(JSOP_UNDEFINED))                 // NEXT ITER UNDEF
+    }
+    if (!bce_->emit1(JSOP_UNDEFINED)) {               // NEXT ITER UNDEF
         return false;
+    }
 
     // If the iteration is done, leave loop here, instead of the branch at
     // the end of the loop.
-    if (!loopInfo_->emitSpecialBreakForDone(bce_))    // NEXT ITER UNDEF
+    if (!loopInfo_->emitSpecialBreakForDone(bce_)) {  // NEXT ITER UNDEF
         return false;
+    }
 
-    if (!ifDone.emitEnd())                            // NEXT ITER RESULT
+    if (!ifDone.emitEnd()) {                          // NEXT ITER RESULT
         return false;
+    }
 
     // Emit code to assign result.value to the iteration variable.
     //
     // Note that ES 13.7.5.13, step 5.c says getting result.value does not
     // call IteratorClose, so start JSTRY_ITERCLOSE after the GETPROP.
-    if (!bce_->emitAtomOp(bce_->cx->names().value, JSOP_GETPROP))
+    if (!bce_->emitAtomOp(bce_->cx->names().value, JSOP_GETPROP)) {
         return false;                                 // NEXT ITER VALUE
+    }
 
-    if (!loopInfo_->emitBeginCodeNeedingIteratorClose(bce_))
+    if (!loopInfo_->emitBeginCodeNeedingIteratorClose(bce_)) {
         return false;
+    }
 
 #ifdef DEBUG
     state_ = State::Initialize;
 #endif
     return true;
 }
 
 bool
@@ -162,72 +183,80 @@ ForOfEmitter::emitBody()
 {
     MOZ_ASSERT(state_ == State::Initialize);
 
     MOZ_ASSERT(bce_->stackDepth == loopDepth_,
                "the stack must be balanced around the initializing "
                "operation");
 
     // Remove VALUE from the stack to release it.
-    if (!bce_->emit1(JSOP_POP))                       // NEXT ITER
+    if (!bce_->emit1(JSOP_POP)) {                     // NEXT ITER
         return false;
-    if (!bce_->emit1(JSOP_UNDEFINED))                 // NEXT ITER UNDEF
+    }
+    if (!bce_->emit1(JSOP_UNDEFINED)) {               // NEXT ITER UNDEF
         return false;
+    }
 
 #ifdef DEBUG
     state_ = State::Body;
 #endif
     return true;
 }
 
 bool
 ForOfEmitter::emitEnd(const Maybe<uint32_t>& iteratedPos)
 {
     MOZ_ASSERT(state_ == State::Body);
 
     MOZ_ASSERT(bce_->stackDepth == loopDepth_,
                "the stack must be balanced around the for-of body");
 
-    if (!loopInfo_->emitEndCodeNeedingIteratorClose(bce_))
+    if (!loopInfo_->emitEndCodeNeedingIteratorClose(bce_)) {
         return false;
+    }
 
     loopInfo_->setContinueTarget(bce_->offset());
 
     // We use the iterated value's position to attribute JSOP_LOOPENTRY,
     // which corresponds to the iteration protocol.
     // This is a bit misleading for 2nd and later iterations and might need
     // some fix (bug 1482003).
-    if (!loopInfo_->emitLoopEntry(bce_, iteratedPos))
+    if (!loopInfo_->emitLoopEntry(bce_, iteratedPos)) {
         return false;
+    }
 
-    if (!bce_->emit1(JSOP_FALSE))                     // NEXT ITER UNDEF FALSE
+    if (!bce_->emit1(JSOP_FALSE)) {                   // NEXT ITER UNDEF FALSE
         return false;
-    if (!loopInfo_->emitLoopEnd(bce_, JSOP_IFEQ))     // NEXT ITER UNDEF
+    }
+    if (!loopInfo_->emitLoopEnd(bce_, JSOP_IFEQ)) {   // NEXT ITER UNDEF
         return false;
+    }
 
     MOZ_ASSERT(bce_->stackDepth == loopDepth_);
 
     // Let Ion know where the closing jump of this loop is.
     if (!bce_->setSrcNoteOffset(noteIndex_, SrcNote::ForOf::BackJumpOffset,
                                 loopInfo_->loopEndOffsetFromEntryJump()))
     {
         return false;
     }
 
-    if (!loopInfo_->patchBreaksAndContinues(bce_))
+    if (!loopInfo_->patchBreaksAndContinues(bce_)) {
         return false;
+    }
 
     if (!bce_->tryNoteList.append(JSTRY_FOR_OF, bce_->stackDepth, loopInfo_->headOffset(),
                                   loopInfo_->breakTargetOffset()))
     {
         return false;
     }
 
-    if (!bce_->emitPopN(3))                           //
+    if (!bce_->emitPopN(3)) {                         //
         return false;
+    }
 
     loopInfo_.reset();
 
 #ifdef DEBUG
     state_ = State::End;
 #endif
     return true;
 }
--- a/js/src/frontend/ForOfLoopControl.cpp
+++ b/js/src/frontend/ForOfLoopControl.cpp
@@ -22,84 +22,102 @@ ForOfLoopControl::ForOfLoopControl(Bytec
     iterKind_(iterKind)
 {}
 
 bool
 ForOfLoopControl::emitBeginCodeNeedingIteratorClose(BytecodeEmitter* bce)
 {
     tryCatch_.emplace(bce, TryEmitter::Kind::TryCatch, TryEmitter::ControlKind::NonSyntactic);
 
-    if (!tryCatch_->emitTry())
+    if (!tryCatch_->emitTry()) {
         return false;
+    }
 
     MOZ_ASSERT(numYieldsAtBeginCodeNeedingIterClose_ == UINT32_MAX);
     numYieldsAtBeginCodeNeedingIterClose_ = bce->yieldAndAwaitOffsetList.numYields;
 
     return true;
 }
 
 bool
 ForOfLoopControl::emitEndCodeNeedingIteratorClose(BytecodeEmitter* bce)
 {
-    if (!tryCatch_->emitCatch())              // ITER ...
+    if (!tryCatch_->emitCatch()) {            // ITER ...
         return false;
+    }
 
-    if (!bce->emit1(JSOP_EXCEPTION))          // ITER ... EXCEPTION
+    if (!bce->emit1(JSOP_EXCEPTION)) {        // ITER ... EXCEPTION
         return false;
+    }
     unsigned slotFromTop = bce->stackDepth - iterDepth_;
-    if (!bce->emitDupAt(slotFromTop))         // ITER ... EXCEPTION ITER
+    if (!bce->emitDupAt(slotFromTop)) {       // ITER ... EXCEPTION ITER
         return false;
+    }
 
     // If ITER is undefined, it means the exception is thrown by
     // IteratorClose for non-local jump, and we should't perform
     // IteratorClose again here.
-    if (!bce->emit1(JSOP_UNDEFINED))          // ITER ... EXCEPTION ITER UNDEF
+    if (!bce->emit1(JSOP_UNDEFINED)) {        // ITER ... EXCEPTION ITER UNDEF
         return false;
-    if (!bce->emit1(JSOP_STRICTNE))           // ITER ... EXCEPTION NE
+    }
+    if (!bce->emit1(JSOP_STRICTNE)) {         // ITER ... EXCEPTION NE
         return false;
+    }
 
     InternalIfEmitter ifIteratorIsNotClosed(bce);
-    if (!ifIteratorIsNotClosed.emitThen())    // ITER ... EXCEPTION
+    if (!ifIteratorIsNotClosed.emitThen()) {  // ITER ... EXCEPTION
         return false;
+    }
 
     MOZ_ASSERT(slotFromTop == unsigned(bce->stackDepth - iterDepth_));
-    if (!bce->emitDupAt(slotFromTop))         // ITER ... EXCEPTION ITER
+    if (!bce->emitDupAt(slotFromTop)) {       // ITER ... EXCEPTION ITER
         return false;
-    if (!emitIteratorCloseInInnermostScope(bce, CompletionKind::Throw))
+    }
+    if (!emitIteratorCloseInInnermostScope(bce, CompletionKind::Throw)) {
         return false;                         // ITER ... EXCEPTION
+    }
 
-    if (!ifIteratorIsNotClosed.emitEnd())     // ITER ... EXCEPTION
+    if (!ifIteratorIsNotClosed.emitEnd()) {   // ITER ... EXCEPTION
         return false;
+    }
 
-    if (!bce->emit1(JSOP_THROW))              // ITER ...
+    if (!bce->emit1(JSOP_THROW)) {            // ITER ...
         return false;
+    }
 
     // If any yields were emitted, then this for-of loop is inside a star
     // generator and must handle the case of Generator.return. Like in
     // yield*, it is handled with a finally block.
     uint32_t numYieldsEmitted = bce->yieldAndAwaitOffsetList.numYields;
     if (numYieldsEmitted > numYieldsAtBeginCodeNeedingIterClose_) {
-        if (!tryCatch_->emitFinally())
+        if (!tryCatch_->emitFinally()) {
             return false;
+        }
 
         InternalIfEmitter ifGeneratorClosing(bce);
-        if (!bce->emit1(JSOP_ISGENCLOSING))   // ITER ... FTYPE FVALUE CLOSING
+        if (!bce->emit1(JSOP_ISGENCLOSING)) { // ITER ... FTYPE FVALUE CLOSING
             return false;
-        if (!ifGeneratorClosing.emitThen())   // ITER ... FTYPE FVALUE
+        }
+        if (!ifGeneratorClosing.emitThen()) { // ITER ... FTYPE FVALUE
+            return false;
+        }
+        if (!bce->emitDupAt(slotFromTop + 1)) { // ITER ... FTYPE FVALUE ITER
             return false;
-        if (!bce->emitDupAt(slotFromTop + 1)) // ITER ... FTYPE FVALUE ITER
+        }
+        if (!emitIteratorCloseInInnermostScope(bce, CompletionKind::Normal)) {
+            return false;                     // ITER ... FTYPE FVALUE
+        }
+        if (!ifGeneratorClosing.emitEnd()) {  // ITER ... FTYPE FVALUE
             return false;
-        if (!emitIteratorCloseInInnermostScope(bce, CompletionKind::Normal))
-            return false;                     // ITER ... FTYPE FVALUE
-        if (!ifGeneratorClosing.emitEnd())    // ITER ... FTYPE FVALUE
-            return false;
+        }
     }
 
-    if (!tryCatch_->emitEnd())
+    if (!tryCatch_->emitEnd()) {
         return false;
+    }
 
     tryCatch_.reset();
     numYieldsAtBeginCodeNeedingIterClose_ = UINT32_MAX;
 
     return true;
 }
 
 bool
@@ -137,42 +155,51 @@ bool
 ForOfLoopControl::emitPrepareForNonLocalJumpFromScope(BytecodeEmitter* bce,
                                                       EmitterScope& currentScope,
                                                       bool isTarget)
 {
     // Pop unnecessary value from the stack.  Effectively this means
     // leaving try-catch block.  However, the performing IteratorClose can
     // reach the depth for try-catch, and effectively re-enter the
     // try-catch block.
-    if (!bce->emit1(JSOP_POP))                        // NEXT ITER
+    if (!bce->emit1(JSOP_POP)) {                      // NEXT ITER
         return false;
+    }
 
     // Pop the iterator's next method.
-    if (!bce->emit1(JSOP_SWAP))                       // ITER NEXT
+    if (!bce->emit1(JSOP_SWAP)) {                     // ITER NEXT
         return false;
-    if (!bce->emit1(JSOP_POP))                        // ITER
+    }
+    if (!bce->emit1(JSOP_POP)) {                      // ITER
         return false;
+    }
 
     // Clear ITER slot on the stack to tell catch block to avoid performing
     // IteratorClose again.
-    if (!bce->emit1(JSOP_UNDEFINED))                  // ITER UNDEF
+    if (!bce->emit1(JSOP_UNDEFINED)) {                // ITER UNDEF
         return false;
-    if (!bce->emit1(JSOP_SWAP))                       // UNDEF ITER
+    }
+    if (!bce->emit1(JSOP_SWAP)) {                     // UNDEF ITER
         return false;
+    }
 
-    if (!emitIteratorCloseInScope(bce, currentScope, CompletionKind::Normal)) // UNDEF
+    if (!emitIteratorCloseInScope(bce, currentScope, CompletionKind::Normal)) { // UNDEF
         return false;
+    }
 
     if (isTarget) {
         // At the level of the target block, there's bytecode after the
         // loop that will pop the next method, the iterator, and the
         // value, so push two undefineds to balance the stack.
-        if (!bce->emit1(JSOP_UNDEFINED))              // UNDEF UNDEF
+        if (!bce->emit1(JSOP_UNDEFINED)) {            // UNDEF UNDEF
             return false;
-        if (!bce->emit1(JSOP_UNDEFINED))              // UNDEF UNDEF UNDEF
+        }
+        if (!bce->emit1(JSOP_UNDEFINED)) {            // UNDEF UNDEF UNDEF
             return false;
+        }
     } else {
-        if (!bce->emit1(JSOP_POP))                    //
+        if (!bce->emit1(JSOP_POP)) {                  //
             return false;
+        }
     }
 
     return true;
 }
--- a/js/src/frontend/FullParseHandler.h
+++ b/js/src/frontend/FullParseHandler.h
@@ -109,18 +109,19 @@ class FullParseHandler
     }
 
     ParseNode* newObjectLiteralPropertyName(JSAtom* atom, const TokenPos& pos) {
         return new_<NullaryNode>(ParseNodeKind::ObjectPropertyName, JSOP_NOP, pos, atom);
     }
 
     ParseNode* newNumber(double value, DecimalPoint decimalPoint, const TokenPos& pos) {
         ParseNode* pn = new_<NullaryNode>(ParseNodeKind::Number, pos);
-        if (!pn)
+        if (!pn) {
             return nullptr;
+        }
         pn->initNumber(value, decimalPoint);
         return pn;
     }
 
     ParseNode* newBooleanLiteral(bool cond, const TokenPos& pos) {
         return new_<BooleanLiteral>(cond, pos);
     }
 
@@ -129,22 +130,24 @@ class FullParseHandler
     }
 
     ParseNode* newTemplateStringLiteral(JSAtom* atom, const TokenPos& pos) {
         return new_<NullaryNode>(ParseNodeKind::TemplateString, JSOP_NOP, pos, atom);
     }
 
     ParseNode* newCallSiteObject(uint32_t begin) {
         ParseNode* callSite = new_<CallSiteNode>(begin);
-        if (!callSite)
+        if (!callSite) {
             return null();
+        }
 
         Node propExpr = newArrayLiteral(callSite->pn_pos.begin);
-        if (!propExpr)
+        if (!propExpr) {
             return null();
+        }
 
         addArrayElement(callSite, propExpr);
 
         return callSite;
     }
 
     void addToCallSiteObject(ParseNode* callSiteObj, ParseNode* rawNode, ParseNode* cookedNode) {
         MOZ_ASSERT(callSiteObj->isKind(ParseNodeKind::CallSiteObj));
@@ -172,36 +175,39 @@ class FullParseHandler
     }
 
     // The Boxer object here is any object that can allocate ObjectBoxes.
     // Specifically, a Boxer has a .newObjectBox(T) method that accepts a
     // Rooted<RegExpObject*> argument and returns an ObjectBox*.
     template <class Boxer>
     ParseNode* newRegExp(RegExpObject* reobj, const TokenPos& pos, Boxer& boxer) {
         ObjectBox* objbox = boxer.newObjectBox(reobj);
-        if (!objbox)
+        if (!objbox) {
             return null();
+        }
         return new_<RegExpLiteral>(objbox, pos);
     }
 
     ParseNode* newConditional(ParseNode* cond, ParseNode* thenExpr, ParseNode* elseExpr) {
         return new_<ConditionalExpression>(cond, thenExpr, elseExpr);
     }
 
     ParseNode* newDelete(uint32_t begin, ParseNode* expr) {
         if (expr->isKind(ParseNodeKind::Name)) {
             expr->setOp(JSOP_DELNAME);
             return newUnary(ParseNodeKind::DeleteName, begin, expr);
         }
 
-        if (expr->isKind(ParseNodeKind::Dot))
+        if (expr->isKind(ParseNodeKind::Dot)) {
             return newUnary(ParseNodeKind::DeleteProp, begin, expr);
+        }
 
-        if (expr->isKind(ParseNodeKind::Elem))
+        if (expr->isKind(ParseNodeKind::Elem)) {
             return newUnary(ParseNodeKind::DeleteElem, begin, expr);
+        }
 
         return newUnary(ParseNodeKind::DeleteExpr, begin, expr);
     }
 
     ParseNode* newTypeof(uint32_t begin, ParseNode* kid) {
         ParseNodeKind pnk = kid->isKind(ParseNodeKind::Name)
                             ? ParseNodeKind::TypeOfName
                             : ParseNodeKind::TypeOfExpr;
@@ -244,40 +250,43 @@ class FullParseHandler
         return new_<ListNode>(ParseNodeKind::Array, TokenPos(begin, begin + 1));
     }
 
     MOZ_MUST_USE bool addElision(ParseNode* literal, const TokenPos& pos) {
         MOZ_ASSERT(literal->isKind(ParseNodeKind::Array));
         MOZ_ASSERT(literal->isArity(PN_LIST));
 
         ParseNode* elision = new_<NullaryNode>(ParseNodeKind::Elision, pos);
-        if (!elision)
+        if (!elision) {
             return false;
+        }
         addList(/* list = */ literal, /* child = */ elision);
         literal->pn_xflags |= PNX_ARRAYHOLESPREAD | PNX_NONCONST;
         return true;
     }
 
     MOZ_MUST_USE bool addSpreadElement(ParseNode* literal, uint32_t begin, ParseNode* inner) {
         MOZ_ASSERT(literal->isKind(ParseNodeKind::Array));
         MOZ_ASSERT(literal->isArity(PN_LIST));
 
         ParseNode* spread = newSpread(begin, inner);
-        if (!spread)
+        if (!spread) {
             return false;
+        }
         addList(/* list = */ literal, /* child = */ spread);
         literal->pn_xflags |= PNX_ARRAYHOLESPREAD | PNX_NONCONST;
         return true;
     }
 
     void addArrayElement(ParseNode* literal, ParseNode* element) {
         MOZ_ASSERT(literal->isArity(PN_LIST));
 
-        if (!element->isConstant())
+        if (!element->isConstant()) {
             literal->pn_xflags |= PNX_NONCONST;
+        }
         addList(/* list = */ literal, /* child = */ element);
     }
 
     ParseNode* newCall(ParseNode* callee, ParseNode* args) {
         return new_<BinaryNode>(ParseNodeKind::Call, JSOP_CALL, callee, args);
     }
 
     ParseNode* newArguments(const TokenPos& pos) {
@@ -320,101 +329,108 @@ class FullParseHandler
         MOZ_ASSERT(literal->isKind(ParseNodeKind::Object));
         MOZ_ASSERT(literal->isArity(PN_LIST));
 
         // Object literals with mutated [[Prototype]] are non-constant so that
         // singleton objects will have Object.prototype as their [[Prototype]].
         setListFlag(literal, PNX_NONCONST);
 
         ParseNode* mutation = newUnary(ParseNodeKind::MutateProto, begin, expr);
-        if (!mutation)
+        if (!mutation) {
             return false;
+        }
         addList(/* list = */ literal, /* child = */ mutation);
         return true;
     }
 
     ParseNode* newPropertyDefinition(ParseNode* key, ParseNode* val) {
         MOZ_ASSERT(isUsableAsObjectPropertyName(key));
         checkAndSetIsDirectRHSAnonFunction(val);
         return newBinary(ParseNodeKind::Colon, key, val, JSOP_INITPROP);
     }
 
     void addPropertyDefinition(ParseNode* literal, ParseNode* propdef) {
         MOZ_ASSERT(literal->isKind(ParseNodeKind::Object));
         MOZ_ASSERT(literal->isArity(PN_LIST));
         MOZ_ASSERT(propdef->isKind(ParseNodeKind::Colon));
 
-        if (!propdef->pn_right->isConstant())
+        if (!propdef->pn_right->isConstant()) {
             setListFlag(literal, PNX_NONCONST);
+        }
 
         addList(/* list = */ literal, /* child = */ propdef);
     }
 
     MOZ_MUST_USE bool addPropertyDefinition(ParseNode* literal, ParseNode* key, ParseNode* val) {
         ParseNode* propdef = newPropertyDefinition(key, val);
-        if (!propdef)
+        if (!propdef) {
             return false;
+        }
         addPropertyDefinition(literal, propdef);
         return true;
     }
 
     MOZ_MUST_USE bool addShorthand(ParseNode* literal, ParseNode* name, ParseNode* expr) {
         MOZ_ASSERT(literal->isKind(ParseNodeKind::Object));
         MOZ_ASSERT(literal->isArity(PN_LIST));
         MOZ_ASSERT(name->isKind(ParseNodeKind::ObjectPropertyName));
         MOZ_ASSERT(expr->isKind(ParseNodeKind::Name));
         MOZ_ASSERT(name->pn_atom == expr->pn_atom);
 
         setListFlag(literal, PNX_NONCONST);
         ParseNode* propdef = newBinary(ParseNodeKind::Shorthand, name, expr, JSOP_INITPROP);
-        if (!propdef)
+        if (!propdef) {
             return false;
+        }
         addList(/* list = */ literal, /* child = */ propdef);
         return true;
     }
 
     MOZ_MUST_USE bool addSpreadProperty(ParseNode* literal, uint32_t begin, ParseNode* inner) {
         MOZ_ASSERT(literal->isKind(ParseNodeKind::Object));
         MOZ_ASSERT(literal->isArity(PN_LIST));
 
         setListFlag(literal, PNX_NONCONST);
         ParseNode* spread = newSpread(begin, inner);
-        if (!spread)
+        if (!spread) {
             return false;
+        }
         addList(/* list = */ literal, /* child = */ spread);
         return true;
     }
 
     MOZ_MUST_USE bool addObjectMethodDefinition(ParseNode* literal, ParseNode* key, ParseNode* fn,
                                                 AccessorType atype)
     {
         MOZ_ASSERT(literal->isArity(PN_LIST));
         literal->pn_xflags |= PNX_NONCONST;
 
         checkAndSetIsDirectRHSAnonFunction(fn);
 
         ParseNode* propdef = newObjectMethodOrPropertyDefinition(key, fn, atype);
-        if (!propdef)
+        if (!propdef) {
             return false;
+        }
 
         addList(/* list = */ literal, /* child = */ propdef);
         return true;
     }
 
     MOZ_MUST_USE bool addClassMethodDefinition(ParseNode* methodList, ParseNode* key, ParseNode* fn,
                                                AccessorType atype, bool isStatic)
     {
         MOZ_ASSERT(methodList->isKind(ParseNodeKind::ClassMethodList));
         MOZ_ASSERT(isUsableAsObjectPropertyName(key));
 
         checkAndSetIsDirectRHSAnonFunction(fn);
 
         ParseNode* classMethod = new_<ClassMethod>(key, fn, AccessorTypeToJSOp(atype), isStatic);
-        if (!classMethod)
+        if (!classMethod) {
             return false;
+        }
         addList(/* list = */ methodList, /* child = */ classMethod);
         return true;
     }
 
     ParseNode* newInitialYieldExpression(uint32_t begin, ParseNode* gen) {
         TokenPos pos(begin, begin + 1);
         return new_<UnaryNode>(ParseNodeKind::InitialYield, pos, gen);
     }
@@ -436,18 +452,19 @@ class FullParseHandler
 
     // Statements
 
     ParseNode* newStatementList(const TokenPos& pos) {
         return new_<ListNode>(ParseNodeKind::StatementList, pos);
     }
 
     MOZ_MUST_USE bool isFunctionStmt(ParseNode* stmt) {
-        while (stmt->isKind(ParseNodeKind::Label))
+        while (stmt->isKind(ParseNodeKind::Label)) {
             stmt = stmt->as<LabeledStatement>().statement();
+        }
         return stmt->isKind(ParseNodeKind::Function);
     }
 
     void addStatementToList(ParseNode* list, ParseNode* stmt) {
         MOZ_ASSERT(list->isKind(ParseNodeKind::StatementList));
 
         addList(/* list = */ list, /* child = */ stmt);
 
@@ -466,39 +483,43 @@ class FullParseHandler
 
     void addCaseStatementToList(ParseNode* list, ParseNode* casepn) {
         MOZ_ASSERT(list->isKind(ParseNodeKind::StatementList));
         MOZ_ASSERT(casepn->isKind(ParseNodeKind::Case));
         MOZ_ASSERT(casepn->pn_right->isKind(ParseNodeKind::StatementList));
 
         addList(/* list = */ list, /* child = */ casepn);
 
-        if (casepn->pn_right->pn_xflags & PNX_FUNCDEFS)
+        if (casepn->pn_right->pn_xflags & PNX_FUNCDEFS) {
             list->pn_xflags |= PNX_FUNCDEFS;
+        }
     }
 
     MOZ_MUST_USE bool prependInitialYield(ParseNode* stmtList, ParseNode* genName) {
         MOZ_ASSERT(stmtList->isKind(ParseNodeKind::StatementList));
         MOZ_ASSERT(stmtList->isArity(PN_LIST));
 
         TokenPos yieldPos(stmtList->pn_pos.begin, stmtList->pn_pos.begin + 1);
         ParseNode* makeGen = new_<NullaryNode>(ParseNodeKind::Generator, yieldPos);
-        if (!makeGen)
+        if (!makeGen) {
             return false;
+        }
 
         MOZ_ASSERT(genName->getOp() == JSOP_GETNAME);
         genName->setOp(JSOP_SETNAME);
         ParseNode* genInit = newAssignment(ParseNodeKind::Assign, /* lhs = */ genName,
                                            /* rhs = */ makeGen);
-        if (!genInit)
+        if (!genInit) {
             return false;
+        }
 
         ParseNode* initialYield = newInitialYieldExpression(yieldPos.begin, genInit);
-        if (!initialYield)
+        if (!initialYield) {
             return false;
+        }
 
         stmtList->prepend(initialYield);
         return true;
     }
 
     ParseNode* newSetThis(ParseNode* thisName, ParseNode* val) {
         MOZ_ASSERT(thisName->getOp() == JSOP_GETNAME);
         thisName->setOp(JSOP_SETNAME);
@@ -509,36 +530,38 @@ class FullParseHandler
         return new_<NullaryNode>(ParseNodeKind::EmptyStatement, pos);
     }
 
     ParseNode* newImportDeclaration(ParseNode* importSpecSet,
                                     ParseNode* moduleSpec, const TokenPos& pos)
     {
         ParseNode* pn = new_<BinaryNode>(ParseNodeKind::Import, JSOP_NOP, pos,
                                          importSpecSet, moduleSpec);
-        if (!pn)
+        if (!pn) {
             return null();
+        }
         return pn;
     }
 
     ParseNode* newImportSpec(ParseNode* importNameNode, ParseNode* bindingName) {
         return newBinary(ParseNodeKind::ImportSpec, importNameNode, bindingName);
     }
 
     ParseNode* newExportDeclaration(ParseNode* kid, const TokenPos& pos) {
         return new_<UnaryNode>(ParseNodeKind::Export, pos, kid);
     }
 
     ParseNode* newExportFromDeclaration(uint32_t begin, ParseNode* exportSpecSet,
                                         ParseNode* moduleSpec)
     {
         ParseNode* pn = new_<BinaryNode>(ParseNodeKind::ExportFrom, JSOP_NOP, exportSpecSet,
                                          moduleSpec);
-        if (!pn)
+        if (!pn) {
             return null();
+        }
         pn->pn_pos.begin = begin;
         return pn;
     }
 
     ParseNode* newExportDefaultDeclaration(ParseNode* kid, ParseNode* maybeBinding,
                                            const TokenPos& pos) {
         if (maybeBinding) {
             MOZ_ASSERT(maybeBinding->isKind(ParseNodeKind::Name));
@@ -571,18 +594,19 @@ class FullParseHandler
         return new_<UnaryNode>(ParseNodeKind::ExpressionStatement,
                                TokenPos(expr->pn_pos.begin, end), expr);
     }
 
     ParseNode* newIfStatement(uint32_t begin, ParseNode* cond, ParseNode* thenBranch,
                               ParseNode* elseBranch)
     {
         ParseNode* pn = new_<TernaryNode>(ParseNodeKind::If, cond, thenBranch, elseBranch);
-        if (!pn)
+        if (!pn) {
             return null();
+        }
         pn->pn_pos.begin = begin;
         return pn;
     }
 
     ParseNode* newDoWhileStatement(ParseNode* body, ParseNode* cond, const TokenPos& pos) {
         return new_<BinaryNode>(ParseNodeKind::DoWhile, JSOP_NOP, pos, body, cond);
     }
 
@@ -594,18 +618,19 @@ class FullParseHandler
     ParseNode* newForStatement(uint32_t begin, ParseNode* forHead, ParseNode* body,
                                unsigned iflags)
     {
         /* A FOR node is binary, left is loop control and right is the body. */
         JSOp op = forHead->isKind(ParseNodeKind::ForIn) ? JSOP_ITER : JSOP_NOP;
         BinaryNode* pn = new_<BinaryNode>(ParseNodeKind::For, op,
                                           TokenPos(begin, body->pn_pos.end),
                                           forHead, body);
-        if (!pn)
+        if (!pn) {
             return null();
+        }
         pn->pn_iflags = iflags;
         return pn;
     }
 
     ParseNode* newForHead(ParseNode* init, ParseNode* test, ParseNode* update,
                           const TokenPos& pos)
     {
         return new_<TernaryNode>(ParseNodeKind::ForHead, init, test, update, pos);
@@ -684,29 +709,31 @@ class FullParseHandler
     bool setupCatchScope(ParseNode* lexicalScope, ParseNode* catchName, ParseNode* catchBody) {
         ParseNode* catchpn;
         if (catchName) {
             catchpn = new_<BinaryNode>(ParseNodeKind::Catch, JSOP_NOP, catchName, catchBody);
         } else {
             catchpn = new_<BinaryNode>(ParseNodeKind::Catch, JSOP_NOP, catchBody->pn_pos,
                                        catchName, catchBody);
         }
-        if (!catchpn)
+        if (!catchpn) {
             return false;
+        }
         lexicalScope->setScopeBody(catchpn);
         return true;
     }
 
     inline MOZ_MUST_USE bool setLastFunctionFormalParameterDefault(ParseNode* funcpn,
                                                                    ParseNode* pn);
 
   private:
     void checkAndSetIsDirectRHSAnonFunction(ParseNode* pn) {
-        if (IsAnonymousFunctionDefinition(pn))
+        if (IsAnonymousFunctionDefinition(pn)) {
             pn->setDirectRHSAnonFunction(true);
+        }
     }
 
   public:
     ParseNode* newFunctionStatement(const TokenPos& pos) {
         return new_<CodeNode>(ParseNodeKind::Function, JSOP_NOP, pos);
     }
 
     ParseNode* newFunctionExpression(const TokenPos& pos) {
@@ -871,20 +898,21 @@ class FullParseHandler
         return decl->pn_head;
     }
 
     ParseNode* newCommaExpressionList(ParseNode* kid) {
         return new_<ListNode>(ParseNodeKind::Comma, JSOP_NOP, kid);
     }
 
     void addList(ParseNode* list, ParseNode* kid) {
-        if (sourceKind_ == SourceKind::Text)
+        if (sourceKind_ == SourceKind::Text) {
             list->append(kid);
-        else
+        } else {
             list->appendWithoutOrderAssumption(kid);
+        }
     }
 
     void setOp(ParseNode* pn, JSOp op) {
         pn->setOp(op);
     }
     void setListFlag(ParseNode* pn, unsigned flag) {
         MOZ_ASSERT(pn->isArity(PN_LIST));
         pn->pn_xflags |= flag;
@@ -953,18 +981,19 @@ inline bool
 FullParseHandler::setLastFunctionFormalParameterDefault(ParseNode* funcpn,
                                                         ParseNode* defaultValue)
 {
     MOZ_ASSERT(funcpn->isKind(ParseNodeKind::Function));
     MOZ_ASSERT(funcpn->isArity(PN_CODE));
 
     ParseNode* arg = funcpn->pn_body->last();
     ParseNode* pn = newAssignment(ParseNodeKind::Assign, arg, defaultValue);
-    if (!pn)
+    if (!pn) {
         return false;
+    }
 
     funcpn->pn_body->pn_pos.end = pn->pn_pos.end;
     ParseNode* pnchild = funcpn->pn_body->pn_head;
     ParseNode* pnlast = funcpn->pn_body->last();
     MOZ_ASSERT(pnchild);
     if (pnchild == pnlast) {
         funcpn->pn_body->pn_head = pn;
     } else {
--- a/js/src/frontend/IfEmitter.cpp
+++ b/js/src/frontend/IfEmitter.cpp
@@ -27,37 +27,42 @@ IfEmitter::IfEmitter(BytecodeEmitter* bc
 IfEmitter::IfEmitter(BytecodeEmitter* bce)
   : IfEmitter(bce, Kind::MayContainLexicalAccessInBranch)
 {}
 
 bool
 BranchEmitterBase::emitThenInternal(SrcNoteType type)
 {
     // The end of TDZCheckCache for cond for else-if.
-    if (kind_ == Kind::MayContainLexicalAccessInBranch)
+    if (kind_ == Kind::MayContainLexicalAccessInBranch) {
         tdzCache_.reset();
+    }
 
     // Emit an annotated branch-if-false around the then part.
-    if (!bce_->newSrcNote(type))
+    if (!bce_->newSrcNote(type)) {
         return false;
-    if (!bce_->emitJump(JSOP_IFEQ, &jumpAroundThen_))
+    }
+    if (!bce_->emitJump(JSOP_IFEQ, &jumpAroundThen_)) {
         return false;
+    }
 
     // To restore stack depth in else part, save depth of the then part.
 #ifdef DEBUG
     // If DEBUG, this is also necessary to calculate |pushed_|.
     thenDepth_ = bce_->stackDepth;
 #else
-    if (type == SRC_COND || type == SRC_IF_ELSE)
+    if (type == SRC_COND || type == SRC_IF_ELSE) {
         thenDepth_ = bce_->stackDepth;
+    }
 #endif
 
     // Enclose then-branch with TDZCheckCache.
-    if (kind_ == Kind::MayContainLexicalAccessInBranch)
+    if (kind_ == Kind::MayContainLexicalAccessInBranch) {
         tdzCache_.emplace(bce_);
+    }
 
     return true;
 }
 
 void
 BranchEmitterBase::calculateOrCheckPushed()
 {
 #ifdef DEBUG
@@ -79,32 +84,35 @@ BranchEmitterBase::emitElseInternal()
     if (kind_ == Kind::MayContainLexicalAccessInBranch) {
         MOZ_ASSERT(tdzCache_.isSome());
         tdzCache_.reset();
     }
 
     // Emit a jump from the end of our then part around the else part. The
     // patchJumpsToTarget call at the bottom of this function will fix up
     // the offset with jumpsAroundElse value.
-    if (!bce_->emitJump(JSOP_GOTO, &jumpsAroundElse_))
+    if (!bce_->emitJump(JSOP_GOTO, &jumpsAroundElse_)) {
         return false;
+    }
 
     // Ensure the branch-if-false comes here, then emit the else.
-    if (!bce_->emitJumpTargetAndPatch(jumpAroundThen_))
+    if (!bce_->emitJumpTargetAndPatch(jumpAroundThen_)) {
         return false;
+    }
 
     // Clear jumpAroundThen_ offset, to tell emitEnd there was an else part.
     jumpAroundThen_ = JumpList();
 
     // Restore stack depth of the then part.
     bce_->stackDepth = thenDepth_;
 
     // Enclose else-branch with TDZCheckCache.
-    if (kind_ == Kind::MayContainLexicalAccessInBranch)
+    if (kind_ == Kind::MayContainLexicalAccessInBranch) {
         tdzCache_.emplace(bce_);
+    }
 
     return true;
 }
 
 bool
 BranchEmitterBase::emitEndInternal()
 {
     // The end of TDZCheckCache for then or else-clause.
@@ -113,123 +121,132 @@ BranchEmitterBase::emitEndInternal()
         tdzCache_.reset();
     }
 
     calculateOrCheckPushed();
 
     if (jumpAroundThen_.offset != -1) {
         // No else part for the last branch, fixup the branch-if-false to
         // come here.
-        if (!bce_->emitJumpTargetAndPatch(jumpAroundThen_))
+        if (!bce_->emitJumpTargetAndPatch(jumpAroundThen_)) {
             return false;
+        }
     }
 
     // Patch all the jumps around else parts.
-    if (!bce_->emitJumpTargetAndPatch(jumpsAroundElse_))
+    if (!bce_->emitJumpTargetAndPatch(jumpsAroundElse_)) {
         return false;
+    }
 
     return true;
 }
 
 bool
 IfEmitter::emitIf(const Maybe<uint32_t>& ifPos)
 {
     MOZ_ASSERT(state_ == State::Start);
 
     if (ifPos) {
         // Make sure this code is attributed to the "if" so that it gets a
         // useful column number, instead of the default 0 value.
-        if (!bce_->updateSourceCoordNotes(*ifPos))
+        if (!bce_->updateSourceCoordNotes(*ifPos)) {
             return false;
+        }
     }
 
 #ifdef DEBUG
     state_ = State::If;
 #endif
     return true;
 }
 
 bool
 IfEmitter::emitThen()
 {
     MOZ_ASSERT(state_ == State::If || state_ == State::ElseIf);
     MOZ_ASSERT_IF(state_ == State::ElseIf, tdzCache_.isSome());
     MOZ_ASSERT_IF(state_ != State::ElseIf, tdzCache_.isNothing());
 
-    if (!emitThenInternal(SRC_IF))
+    if (!emitThenInternal(SRC_IF)) {
         return false;
+    }
 
 #ifdef DEBUG
     state_ = State::Then;
 #endif
     return true;
 }
 
 bool
 IfEmitter::emitThenElse()
 {
     MOZ_ASSERT(state_ == State::If || state_ == State::ElseIf);
     MOZ_ASSERT_IF(state_ == State::ElseIf, tdzCache_.isSome());
     MOZ_ASSERT_IF(state_ != State::ElseIf, tdzCache_.isNothing());
 
-    if (!emitThenInternal(SRC_IF_ELSE))
+    if (!emitThenInternal(SRC_IF_ELSE)) {
         return false;
+    }
 
 #ifdef DEBUG
     state_ = State::ThenElse;
 #endif
     return true;
 }
 
 bool
 IfEmitter::emitElseIf(const Maybe<uint32_t>& ifPos)
 {
     MOZ_ASSERT(state_ == State::ThenElse);
 
-    if (!emitElseInternal())
+    if (!emitElseInternal()) {
         return false;
+    }
 
     if (ifPos) {
         // Make sure this code is attributed to the "if" so that it gets a
         // useful column number, instead of the default 0 value.
-        if (!bce_->updateSourceCoordNotes(*ifPos))
+        if (!bce_->updateSourceCoordNotes(*ifPos)) {
             return false;
+        }
     }
 
 #ifdef DEBUG
     state_ = State::ElseIf;
 #endif
     return true;
 }
 
 bool
 IfEmitter::emitElse()
 {
     MOZ_ASSERT(state_ == State::ThenElse);
 
-    if (!emitElseInternal())
+    if (!emitElseInternal()) {
         return false;
+    }
 
 #ifdef DEBUG
     state_ = State::Else;
 #endif
     return true;
 }
 
 bool
 IfEmitter::emitEnd()
 {
     MOZ_ASSERT(state_ == State::Then || state_ == State::Else);
     // If there was an else part for the last branch, jumpAroundThen_ is
     // already fixed up when emitting the else part.
     MOZ_ASSERT_IF(state_ == State::Then, jumpAroundThen_.offset != -1);
     MOZ_ASSERT_IF(state_ == State::Else, jumpAroundThen_.offset == -1);
 
-    if (!emitEndInternal())
+    if (!emitEndInternal()) {
         return false;
+    }
 
 #ifdef DEBUG
     state_ = State::End;
 #endif
     return true;
 }
 
 InternalIfEmitter::InternalIfEmitter(BytecodeEmitter* bce)
@@ -254,45 +271,48 @@ CondEmitter::emitCond()
 #endif
     return true;
 }
 
 bool
 CondEmitter::emitThenElse()
 {
     MOZ_ASSERT(state_ == State::Cond);
-    if (!emitThenInternal(SRC_COND))
+    if (!emitThenInternal(SRC_COND)) {
         return false;
+    }
 
 #ifdef DEBUG
     state_ = State::ThenElse;
 #endif
     return true;
 }
 
 bool
 CondEmitter::emitElse()
 {
     MOZ_ASSERT(state_ == State::ThenElse);
 
-    if (!emitElseInternal())
+    if (!emitElseInternal()) {
         return false;
+    }
 
 #ifdef DEBUG
     state_ = State::Else;
 #endif
     return true;
 }
 
 bool
 CondEmitter::emitEnd()
 {
     MOZ_ASSERT(state_ == State::Else);
     MOZ_ASSERT(jumpAroundThen_.offset == -1);
 
-    if (!emitEndInternal())
+    if (!emitEndInternal()) {
         return false;
+    }
 
 #ifdef DEBUG
     state_ = State::End;
 #endif
     return true;
 }