From 66aa6b595c47231958a855e4b166f5d55df1184d Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 29 Apr 2018 13:39:11 +0200 Subject: Bug 1411415. --- dom/bindings/BindingUtils.cpp | 20 ++++++++++---------- dom/bindings/ErrorResult.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'dom/bindings') diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index 33f5f7a445..7056658a78 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -259,8 +259,8 @@ TErrorResult::ThrowJSException(JSContext* cx, JS::Handle::SetPendingJSException(JSContext* cx) mJSException = exception; // If JS_WrapValue failed, not much we can do about it... No matter // what, go ahead and unroot mJSException. - js::RemoveRawValueRoot(cx, &mJSException); + js::RemoveRawValueRoot(cx, &mJSException.asValueRef()); mResult = NS_OK; #ifdef DEBUG @@ -395,8 +395,8 @@ TErrorResult::ClearUnionData() if (IsJSException()) { JSContext* cx = dom::danger::GetJSContext(); MOZ_ASSERT(cx); - mJSException.setUndefined(); - js::RemoveRawValueRoot(cx, &mJSException); + mJSException.asValueRef().setUndefined(); + js::RemoveRawValueRoot(cx, &mJSException.asValueRef()); #ifdef DEBUG mUnionState = HasNothing; #endif // DEBUG @@ -439,13 +439,13 @@ TErrorResult::operator=(TErrorResult&& aRHS) } else if (aRHS.IsJSException()) { JSContext* cx = dom::danger::GetJSContext(); MOZ_ASSERT(cx); - mJSException.setUndefined(); - if (!js::AddRawValueRoot(cx, &mJSException, "TErrorResult::mJSException")) { + mJSException.asValueRef().setUndefined(); + if (!js::AddRawValueRoot(cx, &mJSException.asValueRef(), "TErrorResult::mJSException")) { MOZ_CRASH("Could not root mJSException, we're about to OOM"); } mJSException = aRHS.mJSException; - aRHS.mJSException.setUndefined(); - js::RemoveRawValueRoot(cx, &aRHS.mJSException); + aRHS.mJSException.asValueRef().setUndefined(); + js::RemoveRawValueRoot(cx, &aRHS.mJSException.asValueRef()); } else if (aRHS.IsDOMException()) { mDOMExceptionInfo = aRHS.mDOMExceptionInfo; aRHS.mDOMExceptionInfo = nullptr; @@ -497,7 +497,7 @@ TErrorResult::CloneTo(TErrorResult& aRv) const aRv.mUnionState = HasJSException; #endif JSContext* cx = dom::danger::GetJSContext(); - JS::Rooted exception(cx, mJSException); + JS::Rooted exception(cx, mJSException.asValueRef()); aRv.ThrowJSException(cx, exception); } } diff --git a/dom/bindings/ErrorResult.h b/dom/bindings/ErrorResult.h index c45e7ea3b3..7c3fc9e2f9 100644 --- a/dom/bindings/ErrorResult.h +++ b/dom/bindings/ErrorResult.h @@ -461,7 +461,7 @@ private: // (and deallocated) by SetPendingDOMException. union { Message* mMessage; // valid when IsErrorWithMessage() - JS::Value mJSException; // valid when IsJSException() + JS::UninitializedValue mJSException; // valid when IsJSException() DOMExceptionInfo* mDOMExceptionInfo; // valid when IsDOMException() }; -- cgit v1.2.3