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
Родитель 42e0ebf0e3
Коммит 6804174c0c
1 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@ -6625,6 +6625,17 @@ nsWindowSH::NewResolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
// property // property
*objp = obj; *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; return NS_OK;
} }