Bug 837192 followup: In js::FunctionToString, fold variable into its only remaining usage-site (an assertion) to fix opt Werror build failures. rs=Waldo
authorDaniel Holbert <dholbert@cs.stanford.edu>
Mon, 14 Mar 2016 14:43:14 -0700
changeset 288638 e79cc51e486ceae0084e34ee3918e54e2942cf7e
parent 288637 9d99253b3e008d7fad83a89f51002ee07f5220a2
child 288639 4dceeab3d7c52c946dfe5d06f443710b5ea718eb
push id30087
push usercbook@mozilla.com
push dateTue, 15 Mar 2016 09:43:43 +0000
treeherdermozilla-central@5e14887312d4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs837192
milestone48.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 837192 followup: In js::FunctionToString, fold variable into its only remaining usage-site (an assertion) to fix opt Werror build failures. rs=Waldo CLOSED TREE
js/src/jsfun.cpp
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -982,31 +982,29 @@ js::FunctionToString(JSContext* cx, Hand
     {
         return nullptr;
     }
     if (haveSource) {
         Rooted<JSFlatString*> src(cx, script->sourceData(cx));
         if (!src)
             return nullptr;
 
-        bool exprBody = fun->isExprBody();
-
         // The source data for functions created by calling the Function
         // constructor is only the function's body.  This depends on the fact,
         // asserted below, that in Function("function f() {}"), the inner
         // function's sourceStart points to the '(', not the 'f'.
         bool funCon = !fun->isArrow() &&
                       script->sourceStart() == 0 &&
                       script->sourceEnd() == script->scriptSource()->length() &&
                       script->scriptSource()->argumentsNotIncluded();
 
         // Functions created with the constructor can't be arrow functions or
         // expression closures.
         MOZ_ASSERT_IF(funCon, !fun->isArrow());
-        MOZ_ASSERT_IF(funCon, !exprBody);
+        MOZ_ASSERT_IF(funCon, !fun->isExprBody());
         MOZ_ASSERT_IF(!funCon && !fun->isArrow(),
                       src->length() > 0 && src->latin1OrTwoByteChar(0) == '(');
 
         bool buildBody = funCon;
         if (buildBody) {
             // This function was created with the Function constructor. We don't
             // have source for the arguments, so we have to generate that. Part
             // of bug 755821 should be cobbling the arguments passed into the