diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index bd8f60bea70d..e12146c7ecf7 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -2153,7 +2153,7 @@ WorkerPrivateParent::WrapObject(JSContext* aCx, AssertIsOnParentThread(); - JSObject* obj = WorkerBinding::Wrap(aCx, aScope, ParentAsWorkerPrivate()); + JS::Rooted obj(aCx, WorkerBinding::Wrap(aCx, aScope, ParentAsWorkerPrivate())); if (mRooted) { PreserveWrapper(this); diff --git a/js/jsd/jsd_stak.cpp b/js/jsd/jsd_stak.cpp index 2ee69e9e4aaf..0ae6eda57573 100644 --- a/js/jsd/jsd_stak.cpp +++ b/js/jsd/jsd_stak.cpp @@ -485,8 +485,8 @@ jsd_ValToStringInStackFrame(JSDContext* jsdc, cx = jsdthreadstate->context; JS_ASSERT(cx); - exceptionState = JS_SaveExceptionState(cx); JS::RootedValue v(cx, val); + exceptionState = JS_SaveExceptionState(cx); retval = JS::ToString(cx, v); JS_RestoreExceptionState(cx, exceptionState);