Bug 887334 - Don't rethrow in quickstubs if there's already an exception pending. r=luke

This commit is contained in:
Bobby Holley 2013-07-17 11:53:52 -07:00
parent c8c93ab150
commit 0c5572cc76

View File

@ -218,13 +218,13 @@ ThrowCallFailed(JSContext *cx, nsresult rv,
const char* format;
const char* name;
/*
* If there is a pending exception when the native call returns and
* it has the same error result as returned by the native call, then
* the native call may be passing through an error from a previous JS
* call. So we'll just throw that exception into our JS.
*/
if (XPCThrower::CheckForPendingException(rv, cx))
// If the cx already has a pending exception, just throw that.
//
// We used to check here to make sure the exception matched rv (whatever
// that means). But this meant that we'd be calling into JSAPI below with
// a pending exception, which isn't really kosher. The first exception thrown
// should generally take precedence anyway.
if (JS_IsExceptionPending(cx))
return false;
// else...