Fix old bogus error reporting suppression around shell's implicit ToString on command result values, and clean up related #if 0 cruft after it (167325, not part of default build).

This commit is contained in:
brendan%mozilla.org 2002-09-08 21:46:13 +00:00
parent 0f8ab08c03
commit df74dcc41c

View File

@ -370,31 +370,12 @@ Process(JSContext *cx, JSObject *obj, char *filename)
ok = JS_ExecuteScript(cx, obj, script, &result);
if (ok && result != JSVAL_VOID) {
/* Suppress error reports from JS_ValueToString(). */
older = JS_SetErrorReporter(cx, NULL);
str = JS_ValueToString(cx, result);
JS_SetErrorReporter(cx, older);
if (str)
fprintf(gOutFile, "%s\n", JS_GetStringBytes(str));
else
ok = JS_FALSE;
}
#if 0
#if JS_HAS_ERROR_EXCEPTIONS
/*
* Require that any time we return failure, an exception has
* been set.
*/
JS_ASSERT(ok || JS_IsExceptionPending(cx));
/*
* Also that any time an exception has been set, we've
* returned failure.
*/
JS_ASSERT(!JS_IsExceptionPending(cx) || !ok);
#endif /* JS_HAS_ERROR_EXCEPTIONS */
#endif
JS_DestroyScript(cx, script);
}
} while (!hitEOF);