Bug 862380 - Be more explicit about rejecting JSID_VOID for XOWs. r=mrkbap

We already do this, but it's helpful to be clear about it.
This commit is contained in:
Bobby Holley 2013-05-22 22:27:15 -06:00
Родитель a76f725f9c
Коммит 2fbd8f4d5c
1 изменённых файлов: 8 добавлений и 0 удалений

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

@ -228,6 +228,14 @@ AccessCheck::isCrossOriginAccessPermitted(JSContext *cx, JSObject *wrapperArg, j
RootedObject wrapper(cx, wrapperArg);
RootedObject obj(cx, Wrapper::wrappedObject(wrapper));
// Enumerate-like operations pass JSID_VOID to |enter|, since there isn't
// another sane value to pass. For XOWs, we generally want to deny such
// operations but fail silently (see CrossOriginAccessiblePropertiesOnly::
// deny). We could just fall through here and rely on the fact that none
// of the whitelisted properties below will match JSID_VOID, but EIBTI.
if (id == JSID_VOID)
return false;
const char *name;
js::Class *clasp = js::GetObjectClass(obj);
NS_ASSERTION(Jsvalify(clasp) != &XrayUtils::HolderClass, "shouldn't have a holder here");