Bug 797821 - Loosen the CompartmentPrivate contract so that having one does not imply being in the compartment set. r=mrbkap

The compartment set goes away in later patches anyway. This is to allow us to
create compartment privates for things like XUL prototype document globals
without having to put them in the set and trace expandos and such.
This commit is contained in:
Bobby Holley 2012-10-25 17:01:07 +02:00
parent 597176da8c
commit 2b65e9933d

View File

@ -231,18 +231,8 @@ CompartmentDestroyedCallback(JSFreeOp *fop, JSCompartment *compartment)
nsAutoPtr<CompartmentPrivate> priv(GetCompartmentPrivate(compartment));
JS_SetCompartmentPrivate(compartment, nullptr);
// JSD creates compartments in our runtime without going through our creation
// code. This means that those compartments aren't in our set, and don't have
// compartment privates. JSD is on the way out, so let's just handle that
// case for now.
if (!priv) {
MOZ_ASSERT(!set.has(compartment));
return;
}
// Remove the compartment from the set.
MOZ_ASSERT(set.has(compartment));
set.remove(compartment);
if (set.has(compartment))
set.remove(compartment);
return;
}