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

@ -69,25 +69,6 @@ struct SetDOMProxyInformation
SetDOMProxyInformation gSetDOMProxyInformation;
// static
void
DOMProxyHandler::ClearExternalRefsForWrapperRelease(JSObject* obj)
{
MOZ_ASSERT(IsDOMProxy(obj), "expected a DOM proxy object");
JS::Value v = js::GetProxyExtra(obj, JSPROXYSLOT_EXPANDO);
if (v.isUndefined() || v.isObject()) {
// No expando, or an expando that we reference from our slot anyway, so
// don't have to clear state for.
return;
}
// Prevent having a dangling pointer to our expando from the
// ExpandoAndGeneration.
js::ExpandoAndGeneration* expandoAndGeneration =
static_cast<js::ExpandoAndGeneration*>(v.toPrivate());
expandoAndGeneration->expando = UndefinedValue();
}
// static
JSObject*
DOMProxyHandler::GetAndClearExpandoObject(JSObject* obj)