Bug 1548759 - Always clear exception after PrintError. r=jorendorff
authorTom Schuster <evilpies@gmail.com>
Tue, 14 May 2019 17:58:21 +0000
changeset 532953 1177f0af9ec0c7500ca5419a88de6b62cc07caf4
parent 532952 3ebc795b98bac8c64597369f65b7774d18111a93
child 532954 09549fc20d2358a00cac6e9d6ec92e5031fe7e7b
push id11276
push userrgurzau@mozilla.com
push dateMon, 20 May 2019 13:11:24 +0000
treeherdermozilla-beta@847755a7c325 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1548759
milestone68.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 1548759 - Always clear exception after PrintError. r=jorendorff Differential Revision: https://phabricator.services.mozilla.com/D31083
js/src/shell/js.cpp
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -9477,16 +9477,17 @@ js::shell::AutoReportException::~AutoRep
     JS_ClearPendingException(cx);
     return;
   }
 
   MOZ_ASSERT(!JSREPORT_IS_WARNING(report.report()->flags));
 
   FILE* fp = ErrorFilePointer();
   PrintError(cx, fp, report.toStringResult(), report.report(), reportWarnings);
+  JS_ClearPendingException(cx);
 
   if (!PrintStackTrace(cx, stack)) {
     fputs("(Unable to print stack trace)\n", fp);
     JS_ClearPendingException(cx);
   }
 
 #if defined(DEBUG) || defined(JS_OOM_BREAKPOINT)
   // Don't quit the shell if an unhandled exception is reported during OOM