Bug 663748 - js shell doesn't sometimes output exceptions on Win64. r=luke
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Mon, 05 Sep 2011 11:24:48 +0900
changeset 76543 6d0812c1f610f972a724c9e1fc23bb600a596dd2
parent 76542 7fb15a645955ee2b808e639f2245b344833be6e1
child 76544 3fdf87297e66df3fe04d63b9b742c3d5c1ef60e3
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersluke
bugs663748
milestone9.0a1
Bug 663748 - js shell doesn't sometimes output exceptions on Win64. r=luke
js/src/shell/js.cpp
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -4866,16 +4866,17 @@ static void
 my_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report)
 {
     int i, j, k, n;
     char *prefix, *tmp;
     const char *ctmp;
 
     if (!report) {
         fprintf(gErrFile, "%s\n", message);
+        fflush(gErrFile);
         return;
     }
 
     /* Conditionally ignore reported warnings. */
     if (JSREPORT_IS_WARNING(report->flags) && !reportWarnings)
         return;
 
     prefix = NULL;
@@ -4928,16 +4929,17 @@ my_ErrorReporter(JSContext *cx, const ch
             }
             continue;
         }
         fputc('.', gErrFile);
         j++;
     }
     fputs("^\n", gErrFile);
  out:
+    fflush(gErrFile);
     if (!JSREPORT_IS_WARNING(report->flags)) {
         if (report->errorNumber == JSMSG_OUT_OF_MEMORY) {
             gExitCode = EXITCODE_OUT_OF_MEMORY;
         } else {
             gExitCode = EXITCODE_RUNTIME_ERROR;
         }
     }
     JS_free(cx, prefix);