author | Boris Zbarsky <bzbarsky@mit.edu> |
Thu, 11 Apr 2013 14:31:06 -0400 | |
changeset 128486 | fc32e1f944e3ff2dc8f4696a3536e7fd36330f29 |
parent 128485 | df6981fad6a230cbfc557a791d850d02ad66a462 |
child 128487 | e1fd922ead11a7da6e17decb049356a7ac7709a9 |
push id | 24529 |
push user | ryanvm@gmail.com |
push date | Fri, 12 Apr 2013 11:51:36 +0000 |
treeherder | mozilla-central@5bc732a49eae [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | evilpie, smaug |
bugs | 860473 |
milestone | 23.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
|
--- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -116,17 +116,17 @@ ErrorResult::ClearMessage() { if (IsTypeError()) { delete mMessage; mMessage = nullptr; } } void -ErrorResult::ThrowJSException(JSContext* cx, JS::Value exn) +ErrorResult::ThrowJSException(JSContext* cx, JS::Handle<JS::Value> exn) { MOZ_ASSERT(mMightHaveUnreportedJSException, "Why didn't you tell us you planned to throw a JS exception?"); if (IsTypeError()) { delete mMessage; }
--- a/dom/bindings/CallbackObject.cpp +++ b/dom/bindings/CallbackObject.cpp @@ -140,18 +140,18 @@ CallbackObject::CallSetup::~CallSetup() // errors on it, unless we were told to re-throw them. if (mCx) { bool dealtWithPendingException = false; if (mExceptionHandling == eRethrowExceptions) { // Restore the old context options JS_SetOptions(mCx, mSavedJSContextOptions); mErrorResult.MightThrowJSException(); if (JS_IsExceptionPending(mCx)) { - JS::Value exn; - if (JS_GetPendingException(mCx, &exn)) { + JS::Rooted<JS::Value> exn(mCx); + if (JS_GetPendingException(mCx, exn.address())) { mErrorResult.ThrowJSException(mCx, exn); JS_ClearPendingException(mCx); dealtWithPendingException = true; } } } if (!dealtWithPendingException) {
--- a/dom/bindings/ErrorResult.h +++ b/dom/bindings/ErrorResult.h @@ -61,17 +61,17 @@ public: void ClearMessage(); bool IsTypeError() const { return ErrorCode() == NS_ERROR_TYPE_ERR; } // Facilities for throwing a preexisting JS exception value via this // ErrorResult. The contract is that any code which might end up calling // ThrowJSException() must call MightThrowJSException() even if no exception // is being thrown. Code that would call ReportJSException as needed must // first call WouldReportJSException even if this ErrorResult has not failed. - void ThrowJSException(JSContext* cx, JS::Value exn); + void ThrowJSException(JSContext* cx, JS::Handle<JS::Value> exn); void ReportJSException(JSContext* cx); bool IsJSException() const { return ErrorCode() == NS_ERROR_DOM_JS_EXCEPTION; } void MOZ_ALWAYS_INLINE MightThrowJSException() { #ifdef DEBUG mMightHaveUnreportedJSException = true; #endif }