Bug 704259: part 2, don't set cx->generatingError in JS_ReportPendingException, r=luke
authorDavid Mandelin <dmandelin@mozilla.com>
Tue, 06 Mar 2012 18:49:05 -0800
changeset 88423 578789b11b8146a908807d5262a7796bb7a1c527
parent 88422 3b81add7efd21787370ed6371e3c2506e028f16d
child 88424 7af4878b1ee1a7ab4f26fb149627083330cdc5f1
push id22194
push usermak77@bonardo.net
push dateWed, 07 Mar 2012 09:33:54 +0000
treeherdermozilla-central@8ef88a69f861 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs704259
milestone13.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 704259: part 2, don't set cx->generatingError in JS_ReportPendingException, r=luke
js/src/jsapi.cpp
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -6462,33 +6462,20 @@ JS_ClearPendingException(JSContext *cx)
 {
     AssertNoGC(cx);
     cx->clearPendingException();
 }
 
 JS_PUBLIC_API(JSBool)
 JS_ReportPendingException(JSContext *cx)
 {
-    JSBool ok;
-    bool save;
-
-    AssertNoGC(cx);
-    CHECK_REQUEST(cx);
-
-    /*
-     * Set cx->generatingError to suppress the standard error-to-exception
-     * conversion done by all {js,JS}_Report* functions except for OOM.  The
-     * cx->generatingError flag was added to suppress recursive divergence
-     * under js_ErrorToException, but it serves for our purposes here too.
-     */
-    save = cx->generatingError;
-    cx->generatingError = JS_TRUE;
-    ok = js_ReportUncaughtException(cx);
-    cx->generatingError = save;
-    return ok;
+    AssertNoGC(cx);
+    CHECK_REQUEST(cx);
+
+    return js_ReportUncaughtException(cx);
 }
 
 struct JSExceptionState {
     JSBool throwing;
     jsval  exception;
 };
 
 JS_PUBLIC_API(JSExceptionState *)