Bug 889714 - Remove unused ExitCode machinery. r=mrbkap
authorBobby Holley <bobbyholley@gmail.com>
Tue, 16 Jul 2013 20:38:45 -0700
changeset 138808 5383f9b140c0a2bc46427314b48cf3383be5d811
parent 138807 d2a8922b7f55b4a157137c8be5e167d0d9eead99
child 138809 fe80ac2b0e25b2365def7ea0ea1485fbf2ab1ca7
push id24969
push useremorley@mozilla.com
push dateWed, 17 Jul 2013 14:44:12 +0000
treeherdermozilla-central@4527a488d1f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs889714
milestone25.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 889714 - Remove unused ExitCode machinery. r=mrbkap This stuff is cribbed from xpcshell, where it makes sense. But it doens't really make sense in the IPC context, and doesn't appear to be used either.
ipc/testshell/XPCShellEnvironment.cpp
ipc/testshell/XPCShellEnvironment.h
--- a/ipc/testshell/XPCShellEnvironment.cpp
+++ b/ipc/testshell/XPCShellEnvironment.cpp
@@ -41,19 +41,16 @@
 #include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
 
 #include "BackstagePass.h"
 
 #include "TestShellChild.h"
 #include "TestShellParent.h"
 
-#define EXITCODE_RUNTIME_ERROR 3
-#define EXITCODE_FILE_NOT_FOUND 4
-
 using mozilla::ipc::XPCShellEnvironment;
 using mozilla::ipc::TestShellChild;
 using mozilla::ipc::TestShellParent;
 
 namespace {
 
 static const char kDefaultRuntimeScriptFilename[] = "xpcshell.js";
 
@@ -161,19 +158,16 @@ ScriptErrorReporter(JSContext *cx,
             }
             continue;
         }
         fputc('.', stderr);
         j++;
     }
     fputs("^\n", stderr);
  out:
-    if (!JSREPORT_IS_WARNING(report->flags)) {
-        Environment(cx)->SetExitCode(EXITCODE_RUNTIME_ERROR);
-    }
     JS_free(cx, prefix);
 }
 
 JSContextCallback gOldContextCallback = NULL;
 
 static JSBool
 ContextCallback(JSContext *cx,
                 unsigned contextOp)
@@ -313,21 +307,17 @@ BuildDate(JSContext *cx, unsigned argc, 
     return JS_TRUE;
 }
 
 static JSBool
 Quit(JSContext *cx,
      unsigned argc,
      JS::Value *vp)
 {
-    int exitCode = 0;
-    JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), "/ i", &exitCode);
-
     XPCShellEnvironment* env = Environment(cx);
-    env->SetExitCode(exitCode);
     env->SetIsQuitting();
 
     return JS_FALSE;
 }
 
 static JSBool
 DumpXPC(JSContext *cx,
         unsigned argc,
@@ -656,17 +646,16 @@ XPCShellEnvironment::CreateEnvironment()
         env = nullptr;
     }
     return env;
 }
 
 XPCShellEnvironment::XPCShellEnvironment()
 :   mCx(NULL),
     mJSPrincipals(NULL),
-    mExitCode(0),
     mQuitting(JS_FALSE)
 {
 }
 
 XPCShellEnvironment::~XPCShellEnvironment()
 {
     if (mCx) {
         JS_BeginRequest(mCx);
--- a/ipc/testshell/XPCShellEnvironment.h
+++ b/ipc/testshell/XPCShellEnvironment.h
@@ -38,39 +38,31 @@ public:
     JSObject* GetGlobalObject() {
         return mGlobalHolder.ToJSObject();
     }
 
     JSContext* GetContext() {
         return mCx;
     }
 
-    void SetExitCode(int aExitCode) {
-        mExitCode = aExitCode;
-    }
-    int ExitCode() {
-        return mExitCode;
-    }
-
     void SetIsQuitting() {
         mQuitting = JS_TRUE;
     }
     JSBool IsQuitting() {
         return mQuitting;
     }
 
 protected:
     XPCShellEnvironment();
     bool Init();
 
 private:
     JSContext* mCx;
     nsAutoJSValHolder mGlobalHolder;
     JSPrincipals* mJSPrincipals;
 
-    int mExitCode;
     JSBool mQuitting;
 };
 
 } /* namespace ipc */
 } /* namespace mozilla */
 
 #endif /* _IPC_TESTSHELL_XPCSHELLENVIRONMENT_H_ */