Bug 1144750: Don't attempt to report errors that will cause the warnings only reporter to assert.
authorDave Townsend <dtownsend@oxymoronical.com>
Wed, 18 Mar 2015 14:51:18 -0700
changeset 417517 42906d06fe103add625712c4aa3b525fa72c49e9
parent 417516 920b6513a1260fc115df17a7a5648a3c9c6b093e
child 417518 f4f5221f449ccbefecc310c00dc57080a8b7d2d3
push id59611
push userdtownsend@mozilla.com
push dateFri, 20 Mar 2015 02:37:14 +0000
treeherdertry@f4f5221f449c [default view] [failures only]
bugs1144750
milestone39.0a1
Bug 1144750: Don't attempt to report errors that will cause the warnings only reporter to assert.
js/src/jscntxt.cpp
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -222,18 +222,22 @@ ReportError(JSContext *cx, const char *m
     MOZ_ASSERT(reportp);
     if ((!callback || callback == GetErrorMessage) &&
         reportp->errorNumber == JSMSG_UNCAUGHT_EXCEPTION)
     {
         reportp->flags |= JSREPORT_EXCEPTION;
     }
 
     if (cx->options().autoJSAPIOwnsErrorReporting() || JS_IsRunning(cx)) {
-        if (ErrorToException(cx, message, reportp, callback, userRef))
-            return;
+        ErrorToException(cx, message, reportp, callback, userRef);
+        /*
+         * The AutoJSAPI error reporter only allows warnings to be reported so
+         * just ignore this error rather than try to report it.
+         */
+        return;
     }
 
     /*
      * Call the error reporter only if an exception wasn't raised.
      */
     if (message)
         CallErrorReporter(cx, message, reportp);
 }