Bug 942376 - Make shell quit() and terminate() functions print to stderr in JS_MORE_DETERMINISTIC builds. r=bhackett
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 27 Nov 2013 13:57:34 +0100
changeset 157816 d85ff23b7d1b58441c2bb26c6d777b008fe64bfb
parent 157815 2f8abdba302fa6fa69f43e48b262d77e25b3ebc7
child 157817 32aa215becb49ba3218a509bd81a38e579fe08df
push id25726
push usercbook@mozilla.com
push dateThu, 28 Nov 2013 10:47:25 +0000
treeherdermozilla-central@cdca43b7657d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs942376
milestone28.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 942376 - Make shell quit() and terminate() functions print to stderr in JS_MORE_DETERMINISTIC builds. r=bhackett
js/src/builtin/TestingFunctions.cpp
js/src/shell/js.cpp
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -898,16 +898,22 @@ DumpHeapComplete(JSContext *cx, unsigned
 
     JS_SET_RVAL(cx, vp, JSVAL_VOID);
     return true;
 }
 
 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;
 }
 
 static bool
 EnableSPSProfilingAssertions(JSContext *cx, unsigned argc, jsval *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -1346,16 +1346,22 @@ PrintErr(JSContext *cx, unsigned argc, j
 }
 
 static bool
 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);
 
     gQuitting = true;
     return false;
 }
 
 static const char *