зеркало из https://github.com/mozilla/gecko-dev.git
Bug 582100 - Only enumerate exposed properties. r=gal
--HG-- extra : rebase_source : 462b9167d01a699ae67effae1c1a710a8f7bece1
This commit is contained in:
Родитель
48a88bd928
Коммит
172d91a45d
|
@ -644,7 +644,23 @@ XPC_COW_Enumerate(JSContext *cx, JSObject *obj)
|
|||
return ThrowException(NS_ERROR_FAILURE, cx);
|
||||
}
|
||||
|
||||
return XPCWrapper::Enumerate(cx, obj, wrappedObj);
|
||||
jsval exposedProps;
|
||||
if (!JS_GetReservedSlot(cx, obj, sExposedPropsSlot, &exposedProps)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
JSObject *propertyContainer;
|
||||
if (JSVAL_IS_VOID(exposedProps)) {
|
||||
// TODO For now, expose whatever properties are on our object.
|
||||
propertyContainer = wrappedObj;
|
||||
} else if (!JSVAL_IS_PRIMITIVE(exposedProps)) {
|
||||
// Just expose whatever the object exposes through __exposedProps__.
|
||||
propertyContainer = JSVAL_TO_OBJECT(exposedProps);
|
||||
} else {
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
return XPCWrapper::Enumerate(cx, obj, propertyContainer);
|
||||
}
|
||||
|
||||
static JSBool
|
||||
|
|
Загрузка…
Ссылка в новой задаче