зеркало из https://github.com/mozilla/pjs.git
bug 580128 - Fix a bug in early XrayWrappers that allowed Holders to get in here. r=gal
This commit is contained in:
Родитель
9effc3a49a
Коммит
bb8641798d
|
@ -78,6 +78,17 @@ WrapperFactory::Rewrap(JSContext *cx, JSObject *obj, JSObject *wrappedProto, JSO
|
|||
if (!obj)
|
||||
return nsnull;
|
||||
|
||||
// Ugly hack to avoid wrapping holder objects instead of the actual
|
||||
// underlying wrapped native JS object.
|
||||
if (JS_GET_CLASS(cx, obj) == &HolderClass) {
|
||||
obj = XrayWrapper<JSCrossCompartmentWrapper>::unwrapHolder(cx, obj);
|
||||
OBJ_TO_OUTER_OBJECT(cx, obj);
|
||||
if (!JS_WrapObject(cx, &obj))
|
||||
return nsnull;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
JSCompartment *origin = obj->getCompartment(cx);
|
||||
JSCompartment *target = cx->compartment;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче