Bug 979951: Always preserve the worker wrapper to ensure that we have something to tell us what compartment to enter. r=bent

This commit is contained in:
Kyle Huey 2014-03-05 17:58:03 -08:00
parent 1ba96b6e8c
commit 874b0f2877

View File

@ -2142,7 +2142,15 @@ WorkerPrivateParent<Derived>::WrapObject(JSContext* aCx,
AssertIsOnParentThread();
return WorkerBinding::Wrap(aCx, aScope, ParentAsWorkerPrivate());
// XXXkhuey this should not need to be rooted, the analysis is dumb.
// See bug 980181.
JS::Rooted<JSObject*> wrapper(aCx,
WorkerBinding::Wrap(aCx, aScope, ParentAsWorkerPrivate()));
if (wrapper) {
MOZ_ALWAYS_TRUE(TryPreserveWrapper(wrapper));
}
return wrapper;
}
template <class Derived>