diff --git a/dom/bindings/DOMJSProxyHandler.cpp b/dom/bindings/DOMJSProxyHandler.cpp index f0ebf4385486..0b9444e0f2a3 100644 --- a/dom/bindings/DOMJSProxyHandler.cpp +++ b/dom/bindings/DOMJSProxyHandler.cpp @@ -112,8 +112,9 @@ DOMProxyHandler::EnsureExpandoObject(JSContext* cx, JS::Handle obj) expandoAndGeneration = nullptr; } + JS::Rooted parent(cx, js::GetObjectParent(obj)); JS::Rooted expando(cx, - JS_NewObjectWithGivenProto(cx, nullptr, JS::NullPtr())); + JS_NewObjectWithGivenProto(cx, nullptr, JS::NullPtr(), parent)); if (!expando) { return nullptr; }