зеркало из https://github.com/mozilla/pjs.git
Remove a now-unnecessary eval hack. bug 420642, r+sr=jst a=beltzner
This commit is contained in:
Родитель
82a016fdd5
Коммит
ef2cba9f81
|
@ -381,13 +381,6 @@ 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,20 +353,6 @@ 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)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче