diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index af3c3a1bed18..f4dd03f2bdbc 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -2159,7 +2159,8 @@ 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);