mirror of
https://github.com/roytam1/UXP.git
synced 2026-05-26 13:58:49 +00:00
Revert "[DOM] Ensure the GC sees consistent states while adopting DOM nodes."
This reverts commit 07c08f37be33ccff30fdc07b8fd6f2ec282e15bf.
This commit is contained in:
@@ -2210,6 +2210,11 @@ ReparentWrapper(JSContext* aCx, JS::Handle<JSObject*> aObjArg, ErrorResult& aErr
|
||||
js::GetReservedOrProxyPrivateSlot(aObj, DOM_OBJECT_SLOT));
|
||||
js::SetReservedOrProxyPrivateSlot(aObj, DOM_OBJECT_SLOT, JS::PrivateValue(nullptr));
|
||||
|
||||
aObj = xpc::TransplantObject(aCx, aObj, newobj);
|
||||
if (!aObj) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
|
||||
nsWrapperCache* cache = nullptr;
|
||||
CallQueryInterface(native, &cache);
|
||||
bool preserving = cache->PreservingWrapper();
|
||||
@@ -2217,20 +2222,6 @@ ReparentWrapper(JSContext* aCx, JS::Handle<JSObject*> aObjArg, ErrorResult& aErr
|
||||
cache->SetWrapper(aObj);
|
||||
cache->SetPreservingWrapper(preserving);
|
||||
|
||||
aObj = xpc::TransplantObject(aCx, aObj, newobj);
|
||||
if (!aObj) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
|
||||
// Update the wrapper cache again if transplanting didn't use newobj but
|
||||
// returned some other object.
|
||||
if (aObj != newobj) {
|
||||
preserving = cache->PreservingWrapper();
|
||||
cache->SetPreservingWrapper(false);
|
||||
cache->SetWrapper(aObj);
|
||||
cache->SetPreservingWrapper(preserving);
|
||||
}
|
||||
|
||||
if (propertyHolder) {
|
||||
JS::Rooted<JSObject*> copyTo(aCx);
|
||||
if (isProxy) {
|
||||
|
||||
Reference in New Issue
Block a user