Issue #2678 - Remove now-unnecessary ClearExternalRefsForWrapperRelease.

All DOMProxyHandler::ClearExternalRefsForWrapperRelease now does is clear
a backpointer to the expando, and that's handled during reflector
finalization already, making it redundant.
This commit is contained in:
Moonchild 2025-01-16 23:01:00 +01:00 committed by roytam1
commit 0121aefb61
3 changed files with 0 additions and 37 deletions

View file

@ -7,7 +7,6 @@
#include "js/Class.h"
#include "js/Proxy.h"
#include "mozilla/dom/DOMJSProxyHandler.h"
#include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/HoldDropJSObjects.h"
#include "nsCycleCollectionTraversalCallback.h"
@ -49,13 +48,6 @@ void
nsWrapperCache::ReleaseWrapper(void* aScriptObjectHolder)
{
if (PreservingWrapper()) {
// PreserveWrapper puts new DOM bindings in the JS holders hash, but they
// can also be in the DOM expando hash, so we need to try to remove them
// from both here.
JSObject* obj = GetWrapperPreserveColor();
if (IsDOMBinding() && obj && js::IsProxy(obj)) {
DOMProxyHandler::ClearExternalRefsForWrapperRelease(obj);
}
SetPreservingWrapper(false);
cyclecollector::DropJSObjectsImpl(aScriptObjectHolder);
}