Bug 990353 - Flip off source discarding for XPCShell. r=fabrice
authorBobby Holley <bobbyholley@gmail.com>
Tue, 22 Apr 2014 14:08:29 -0700
changeset 180056 8ff30e42330e27cb7d2a12eb8f829b71182f6393
parent 180055 744e3fa4bb8a42bc0f948440fbf4c069882269c0
child 180057 a256a26923ffda372b886c9b3c6936202dea8726
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersfabrice
bugs990353
milestone31.0a1
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;
             }