From 9b5f5a54bb34e33ba7eca21bace5313ee0507e8d Mon Sep 17 00:00:00 2001 From: Ted Campbell Date: Thu, 14 Sep 2017 06:35:00 -0400 Subject: [PATCH] Bug 1398601 - Fix wunused-variable errors when MOZ_DIAGNOSTIC_ASSERT isn't available. a=RyanVM MozReview-Commit-ID: 1kvKcQBqog9 --- js/xpconnect/loader/mozJSSubScriptLoader.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/js/xpconnect/loader/mozJSSubScriptLoader.cpp b/js/xpconnect/loader/mozJSSubScriptLoader.cpp index aff43328ade3..bc98e48f5640 100644 --- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp +++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp @@ -211,9 +211,11 @@ EvalScript(JSContext* cx, // 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; }