Bug 554833 - Define 'document' on XPCNativeWrapped windows properly. r=jst

--HG--
extra : rebase_source : 99693fdf3dbd77039f17c31ad5b01050a5957792
This commit is contained in:
Blake Kaplan 2010-03-24 19:08:50 -07:00
parent 89a5523e7f
commit 3cab1f9ae4

View File

@ -6625,6 +6625,17 @@ nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
// property
*objp = obj;
if (ObjectIsNativeWrapper(cx, obj)) {
// Unless our object is a native wrapper, in which case we have to
// define it ourselves.
*_retval = JS_DefineProperty(cx, obj, "document", v, NULL, NULL,
JSPROP_READONLY | JSPROP_ENUMERATE);
if (!*_retval) {
return NS_ERROR_UNEXPECTED;
}
}
return NS_OK;
}