Bug 889714 - Remove unused ExitCode machinery. r=mrbkap
☠☠ backed out by b3d0c2498b42 ☠ ☠
authorBobby Holley <bobbyholley@gmail.com>
Fri, 26 Jul 2013 18:56:53 -0700
changeset 143713 3242b9e0f6b07d362787661b1154140d09e2e995
parent 143712 7b45f302e40e47cedd70422d80a3d994cae715c6
child 143714 43e8b15601b8c303e779d152bcbd1ff51841a3cc
push idunknown
push userunknown
push dateunknown
reviewersmrbkap
bugs889714
milestone24.0a2
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_ */