зеркало из https://github.com/mozilla/gecko-dev.git
Bug 719841 - Do not innerize an object assigned to __proto__. r=mrbkap
This commit is contained in:
Родитель
b61f9b0c32
Коммит
c2952ca599
|
@ -188,26 +188,15 @@ obj_setProto(JSContext *cx, JSObject *obj, jsid id, JSBool strict, Value *vp)
|
|||
}
|
||||
|
||||
if (!vp->isObjectOrNull())
|
||||
return JS_TRUE;
|
||||
return true;
|
||||
|
||||
JSObject *pobj = vp->toObjectOrNull();
|
||||
if (pobj) {
|
||||
/*
|
||||
* Innerize pobj here to avoid sticking unwanted properties on the
|
||||
* outer object. This ensures that any with statements only grant
|
||||
* access to the inner object.
|
||||
*/
|
||||
OBJ_TO_INNER_OBJECT(cx, pobj);
|
||||
if (!pobj)
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
uintN attrs;
|
||||
id = ATOM_TO_JSID(cx->runtime->atomState.protoAtom);
|
||||
if (!CheckAccess(cx, obj, id, JSAccessMode(JSACC_PROTO|JSACC_WRITE), vp, &attrs))
|
||||
return JS_FALSE;
|
||||
return false;
|
||||
|
||||
return SetProto(cx, obj, pobj, JS_TRUE);
|
||||
return SetProto(cx, obj, pobj, true);
|
||||
}
|
||||
|
||||
#else /* !JS_HAS_OBJ_PROTO_PROP */
|
||||
|
|
Загрузка…
Ссылка в новой задаче