Reflecting arguments in Call must happen irrespective of JSRESOLVE_ASSIGNING (396584, r=igor).

This commit is contained in:
brendan@mozilla.org 2007-12-11 13:40:51 -08:00
parent fe766425b6
commit bb37e6a7fe

View File

@ -859,23 +859,21 @@ call_resolve(JSContext *cx, JSObject *obj, jsval id, uintN flags,
return JS_TRUE;
}
if (!(flags & JSRESOLVE_ASSIGNING)) {
/*
* Resolve arguments so that we never store a particular Call object's
* arguments object reference in a Call prototype's |arguments| slot.
*/
atom = cx->runtime->atomState.argumentsAtom;
if (id == ATOM_KEY(atom)) {
if (!js_DefineNativeProperty(cx, obj,
ATOM_TO_JSID(atom), JSVAL_VOID,
NULL, NULL, JSPROP_PERMANENT,
SPROP_HAS_SHORTID, CALL_ARGUMENTS,
NULL)) {
return JS_FALSE;
}
*objp = obj;
return JS_TRUE;
/*
* Resolve arguments so that we never store a particular Call object's
* arguments object reference in a Call prototype's |arguments| slot.
*/
atom = cx->runtime->atomState.argumentsAtom;
if (id == ATOM_KEY(atom)) {
if (!js_DefineNativeProperty(cx, obj,
ATOM_TO_JSID(atom), JSVAL_VOID,
NULL, NULL, JSPROP_PERMANENT,
SPROP_HAS_SHORTID, CALL_ARGUMENTS,
NULL)) {
return JS_FALSE;
}
*objp = obj;
return JS_TRUE;
}
return JS_TRUE;
}