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
parent 04fe393f0c
commit 4b3957c0bc

View File

@ -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");