зеркало из https://github.com/mozilla/pjs.git
Set XOWs' prototypes to null to avoid confusion. bug 405726, r+sr=jst a=beltzner
This commit is contained in:
Родитель
4cf89a7e4d
Коммит
1d2b73a2f7
|
@ -493,9 +493,15 @@ XPC_XOW_WrapObject(JSContext *cx, JSObject *parent, jsval *vp)
|
|||
return JS_FALSE;
|
||||
}
|
||||
|
||||
// Sever the prototype link from Object.prototype so we don't
|
||||
// accidentally inherit properties like __proto__ and __parent__.
|
||||
if (!JS_SetPrototype(cx, outerObj, nsnull)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
if (!JS_SetReservedSlot(cx, outerObj, XPCWrapper::sWrappedObjSlot, *vp) ||
|
||||
!JS_SetReservedSlot(cx, outerObj, XPCWrapper::sResolvingSlot,
|
||||
BOOLEAN_TO_JSVAL(JS_FALSE)) ||
|
||||
JSVAL_FALSE) ||
|
||||
!JS_SetReservedSlot(cx, outerObj, XPC_XOW_ScopeSlot,
|
||||
PRIVATE_TO_JSVAL(parentScope))) {
|
||||
return JS_FALSE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче