Bug 990353 - Flip off source discarding for XPCShell. r=fabrice
authorBobby Holley <bobbyholley@gmail.com>
Tue, 22 Apr 2014 14:08:29 -0700
changeset 198161 8ff30e42330e27cb7d2a12eb8f829b71182f6393
parent 198160 744e3fa4bb8a42bc0f948440fbf4c069882269c0
child 198162 a256a26923ffda372b886c9b3c6936202dea8726
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs990353
milestone31.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 990353 - Flip off source discarding for XPCShell. r=fabrice
js/xpconnect/src/XPCShellImpl.cpp
--- a/js/xpconnect/src/XPCShellImpl.cpp
+++ b/js/xpconnect/src/XPCShellImpl.cpp
@@ -1545,16 +1545,21 @@ XRE_XPCShellMain(int argc, char **argv, 
             return 1;
 
         {
             JS::Rooted<JSObject*> glob(cx, holder->GetJSObject());
             if (!glob) {
                 return 1;
             }
 
+            // Even if we're building in a configuration where source is
+            // discarded, there's no reason to do that on XPCShell, and doing so
+            // might break various automation scripts.
+            JS::CompartmentOptionsRef(glob).setDiscardSource(false);
+
             backstagePass->SetGlobalObject(glob);
 
             JSAutoCompartment ac(cx, glob);
 
             if (!JS_InitReflect(cx, glob)) {
                 JS_EndRequest(cx);
                 return 1;
             }