Bug 1519612 - Handle exception while reporting unhandled rejections. r=jorendorff
authorTooru Fujisawa <arai_a@mac.com>
Mon, 14 Jan 2019 23:56:13 +0000
changeset 510978 d915d432405f0510b12f3de956dcc64344111809
parent 510977 6479cf440470253698f46ebb688ac58fa15480ae
child 510979 738e1ee854eb24b72679b35252a4889b9603c003
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorendorff
bugs1519612
milestone66.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 1519612 - Handle exception while reporting unhandled rejections. r=jorendorff Differential Revision: https://phabricator.services.mozilla.com/D16386
js/src/shell/js.cpp
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -10729,16 +10729,17 @@ static int Shell(JSContext* cx, OptionPa
    * uncaught exceptions have been reported since draining runs callbacks.
    */
   if (!GetShellContext(cx)->quitting) {
     js::RunJobs(cx);
   }
 
   // Only if there's no other error, report unhandled rejections.
   if (!result && !sc->exitCode) {
+    AutoReportException are(cx);
     if (!ReportUnhandledRejections(cx)) {
       FILE* fp = ErrorFilePointer();
       fputs("Error while printing unhandled rejection\n", fp);
     }
   }
 
   if (sc->exitCode) {
     result = sc->exitCode;