Bug 786339 - Remove two implicit conversions from NULL to false in the JS code; r=luke
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 28 Aug 2012 13:22:42 -0400
changeset 105727 1ec9c51ac5a1210ce547165d0814a9120f53421a
parent 105726 a151960d655c50d516f9edf1fdef8f158a496126
child 105728 0b4bc3760d51cbb235f01b737c67efd9728a9dd7
child 105733 152d19d479b20dd06bd68866ecdf6a6508f6ea58
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersluke
bugs786339
milestone18.0a1
Bug 786339 - Remove two implicit conversions from NULL to false in the JS code; r=luke
js/src/frontend/BytecodeCompiler.cpp
js/src/vm/Stack.cpp
--- a/js/src/frontend/BytecodeCompiler.cpp
+++ b/js/src/frontend/BytecodeCompiler.cpp
@@ -330,17 +330,17 @@ frontend::CompileFunctionBody(JSContext 
         return false;
 
     BytecodeEmitter funbce(/* parent = */ NULL, &parser, &funsc, script, /* callerFrame = */ NULL,
                            /* hasGlobalScope = */ false, options.lineno);
     if (!funbce.init())
         return false;
 
     if (!NameFunctions(cx, pn))
-        return NULL;
+        return false;
 
     if (fn->pn_body) {
         JS_ASSERT(fn->pn_body->isKind(PNK_ARGSBODY));
         fn->pn_body->append(pn);
         fn->pn_body->pn_pos = pn->pn_pos;
         pn = fn->pn_body;
     }
 
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -1134,17 +1134,17 @@ ContextStack::popGeneratorFrame(const Ge
     JS_ASSERT(ImplicitCast<const FrameGuard>(gfg).pushed());
 }
 
 bool
 ContextStack::saveFrameChain()
 {
     bool pushedSeg;
     if (!ensureOnTop(cx_, REPORT_ERROR, 0, CANT_EXTEND, &pushedSeg))
-        return NULL;
+        return false;
 
     JS_ASSERT(pushedSeg);
     JS_ASSERT(!hasfp());
     JS_ASSERT(onTop());
     JS_ASSERT(seg_->isEmpty());
     return true;
 }