Bug 1398601 - Fix wunused-variable errors when MOZ_DIAGNOSTIC_ASSERT isn't available. a=RyanVM
authorTed Campbell <tcampbell@mozilla.com>
Thu, 14 Sep 2017 06:35:00 -0400
changeset 430350 ef0f1085d54eae99d62bbf039952b0deb84f396d
parent 430349 754d3df0517d5c374ac2b1515fab3621892c327d
child 430351 943c2c2a1daf5cd0d3287c1974eb510615d5ed5b
child 430407 9cff81ada79469b69384bc4f8e5a1e7c94e9a1a9
child 430448 ea39b11826c9f4299ae84231d76a97abecbf9747
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRyanVM
bugs1398601
milestone57.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 1398601 - Fix wunused-variable errors when MOZ_DIAGNOSTIC_ASSERT isn't available. a=RyanVM MozReview-Commit-ID: 1kvKcQBqog9
js/xpconnect/loader/mozJSSubScriptLoader.cpp
--- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp
+++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
@@ -206,19 +206,21 @@ EvalScript(JSContext* cx,
         if (!loadScope) {
             // A null loadScope means we are cross-compartment. In this case, we
             // should check the target isn't in the JSM loader shared-global or
             // we will contaiminate all JSMs in the compartment.
             //
             // NOTE: If loadScope is already a shared-global JSM, we can't
             // determine which JSM the target belongs to and have to assume it
             // is in our JSM.
+#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
             JSObject* targetGlobal = js::GetGlobalForObjectCrossCompartment(targetObj);
             MOZ_DIAGNOSTIC_ASSERT(!mozJSComponentLoader::Get()->IsLoaderGlobal(targetGlobal),
                                   "Don't load subscript into target in a shared-global JSM");
+#endif
             if (!JS::CloneAndExecuteScript(cx, envChain, script, retval)) {
                 return false;
             }
         } else if (JS_IsGlobalObject(loadScope)) {
             if (!JS::CloneAndExecuteScript(cx, envChain, script, retval)) {
                 return false;
             }
         } else {