Bug 942376 - Make shell quit() and terminate() functions print to stderr in JS_MORE_DETERMINISTIC builds. r=bhackett

This commit is contained in:
Jan de Mooij 2013-11-27 13:57:34 +01:00
parent 6cf928a627
commit c50f375c4d
2 changed files with 12 additions and 0 deletions

View File

@ -903,6 +903,12 @@ DumpHeapComplete(JSContext *cx, unsigned argc, jsval *vp)
static bool
Terminate(JSContext *cx, unsigned arg, jsval *vp)
{
#ifdef JS_MORE_DETERMINISTIC
// Print a message to stderr in more-deterministic builds to help jsfunfuzz
// find uncatchable-exception bugs.
fprintf(stderr, "terminate called\n");
#endif
JS_ClearPendingException(cx);
return false;
}

View File

@ -1351,6 +1351,12 @@ Help(JSContext *cx, unsigned argc, jsval *vp);
static bool
Quit(JSContext *cx, unsigned argc, jsval *vp)
{
#ifdef JS_MORE_DETERMINISTIC
// Print a message to stderr in more-deterministic builds to help jsfunfuzz
// find uncatchable-exception bugs.
fprintf(stderr, "quit called\n");
#endif
CallArgs args = CallArgsFromVp(argc, vp);
JS_ConvertArguments(cx, args.length(), args.array(), "/ i", &gExitCode);