diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 5cfbec336740..dc439058d499 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -5848,7 +5848,9 @@ class CGProxyUnwrap(CGAbstractMethod): def declare(self): return "" def definition_body(self): - return """ if (xpc::WrapperFactory::IsXrayWrapper(obj)) { + return """ MOZ_ASSERT(js::IsProxy(obj)); + if (js::GetProxyHandler(obj) != DOMProxyHandler::getInstance()) { + MOZ_ASSERT(xpc::WrapperFactory::IsXrayWrapper(obj)); obj = js::UnwrapObject(obj); } MOZ_ASSERT(IsProxy(obj));