Bug 1162187 - Remove ignoreReportedErrors. r=glandium

Now that we don't have to worry about XPCShellErrorReporter being invoked at
weird times, we can get rid of this nastiness - though it unfortunately means
getting rid of one of my best comments in the tree. :-(
This commit is contained in:
Bobby Holley 2015-05-12 12:25:03 -07:00
parent 6d67d3295a
commit 379ffa0ccf
4 changed files with 1 additions and 46 deletions

View File

@ -105,7 +105,6 @@ static FILE* gErrFile = nullptr;
static FILE* gInFile = nullptr;
static int gExitCode = 0;
static bool gIgnoreReportedErrors = false;
static bool gQuitting = false;
static bool reportWarnings = true;
static bool compileOnly = false;
@ -397,21 +396,6 @@ Quit(JSContext* cx, unsigned argc, jsval* vp)
return false;
}
// Provide script a way to disable the xpcshell error reporter, preventing
// reported errors from being logged to the console and also from affecting the
// exit code returned by the xpcshell binary.
static bool
IgnoreReportedErrors(JSContext* cx, unsigned argc, jsval* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
if (args.length() != 1 || !args[0].isBoolean()) {
JS_ReportError(cx, "Bad arguments");
return false;
}
gIgnoreReportedErrors = args[0].toBoolean();
return true;
}
static bool
DumpXPC(JSContext* cx, unsigned argc, jsval* vp)
{
@ -669,7 +653,6 @@ static const JSFunctionSpec glob_functions[] = {
JS_FS("readline", ReadLine, 1,0),
JS_FS("load", Load, 1,0),
JS_FS("quit", Quit, 0,0),
JS_FS("ignoreReportedErrors", IgnoreReportedErrors, 1,0),
JS_FS("version", Version, 1,0),
JS_FS("build", BuildDate, 0,0),
JS_FS("dumpXPC", DumpXPC, 1,0),
@ -1558,7 +1541,7 @@ XRE_XPCShellMain(int argc, char** argv, char** envp)
if (!ProcessArgs(aes, argv, argc, &dirprovider)) {
if (gExitCode) {
result = gExitCode;
} else if (gQuitting || gIgnoreReportedErrors) {
} else if (gQuitting) {
result = 0;
} else {
result = EXITCODE_RUNTIME_ERROR;

View File

@ -11,15 +11,6 @@ var gThreadClient;
Components.utils.import('resource:///modules/devtools/SourceMap.jsm');
// Deep in the complicated labyrinth of code that this test invokes, beneath
// debugger callbacks, sandboxes and nested event loops, lies an exception.
// This exception lay sleeping since the dawn of time, held captive in a
// delicate balance of custom xpcshell error reporters and garbage data about
// the XPCCallContext stack. But bholley dug too greedily, and too deep, and
// awoke shadow and flame in the darkness of nsExternalHelperAppService.cpp.
// We must now trust in deep magic to ensure that it does not awaken again.
ignoreReportedErrors(true);
function run_test()
{
initTestDebuggerServer();

View File

@ -11,15 +11,6 @@ var gThreadClient;
Components.utils.import('resource:///modules/devtools/SourceMap.jsm');
// Deep in the complicated labyrinth of code that this test invokes, beneath
// debugger callbacks, sandboxes and nested event loops, lies an exception.
// This exception lay sleeping since the dawn of time, held captive in a
// delicate balance of custom xpcshell error reporters and garbage data about
// the XPCCallContext stack. But bholley dug too greedily, and too deep, and
// awoke shadow and flame in the darkness of nsExternalHelperAppService.cpp.
// We must now trust in deep magic to ensure that it does not awaken again.
ignoreReportedErrors(true);
function run_test()
{
initTestDebuggerServer();

View File

@ -70,22 +70,12 @@ function get_modules_under(uri) {
function load_modules_under(spec, uri) {
var entries = get_modules_under(uri).sort();
// The precompilation of JS here sometimes reports errors, which we don't
// really care about. But if the errors are ever reported to xpcshell's
// error reporter, it will cause it to return an error code, which will break
// automation. Currently they won't be, because the component loader spins up
// its JSContext before xpcshell has time to set its context callback (which
// overrides the error reporter on all newly-created JSContexts). But as we
// move towards a singled-cxed browser, we'll run into this. So let's be
// forward-thinking and deal with it now.
ignoreReportedErrors(true);
for each (let entry in entries) {
try {
dump(spec + entry + "\n");
Cu.import(spec + entry, null);
} catch(e) {}
}
ignoreReportedErrors(false);
}
function resolveResource(spec) {