зеркало из https://github.com/mozilla/gecko-dev.git
Back out the patch from bug 420642 because it broke gmail (bug 421571)
This commit is contained in:
Родитель
be6fb851ef
Коммит
690afd3fb9
|
@ -381,6 +381,13 @@ WrapSameOriginProp(JSContext *cx, JSObject *outerObj, jsval *vp)
|
|||
return XPC_XOW_WrapObject(cx, STOBJ_GET_PARENT(outerObj), vp);
|
||||
}
|
||||
|
||||
if (JS_ObjectIsFunction(cx, wrappedObj) &&
|
||||
JS_GetFunctionNative(cx, reinterpret_cast<JSFunction *>
|
||||
(xpc_GetJSPrivate(wrappedObj))) ==
|
||||
XPCWrapper::sEvalNative) {
|
||||
return XPC_XOW_WrapFunction(cx, outerObj, wrappedObj, vp);
|
||||
}
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -353,6 +353,20 @@ XPCWrapper::NewResolve(JSContext *cx, JSObject *wrapperObj,
|
|||
|
||||
OBJ_DROP_PROPERTY(cx, innerObjp, prop);
|
||||
|
||||
// Hack alert: we only do this for same-origin calls on XOWs: we want
|
||||
// to preserve 'eval' function wrapper on the wrapper object itself
|
||||
// to preserve eval's identity.
|
||||
if (!preserveVal && isXOW && !JSVAL_IS_PRIMITIVE(v)) {
|
||||
JSObject *obj = JSVAL_TO_OBJECT(v);
|
||||
if (JS_ObjectIsFunction(cx, obj)) {
|
||||
JSFunction *fun = reinterpret_cast<JSFunction *>(xpc_GetJSPrivate(obj));
|
||||
if (JS_GetFunctionNative(cx, fun) == sEvalNative &&
|
||||
!WrapFunction(cx, wrapperObj, obj, &v, JS_FALSE)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jsval oldSlotVal;
|
||||
if (!::JS_GetReservedSlot(cx, wrapperObj, sResolvingSlot, &oldSlotVal) ||
|
||||
!::JS_SetReservedSlot(cx, wrapperObj, sResolvingSlot, JSVAL_TRUE)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче