Bug 562448 - Function.prototype.apply should accept any arraylike arguments. r=brendan

This commit is contained in:
Jeff Walden
2010-07-16 14:53:37 -05:00
parent 0a09604d55
commit ea074835aa
8 changed files with 208 additions and 66 deletions

View File

@@ -585,19 +585,6 @@ js_HasLengthProperty(JSContext *cx, JSObject *obj, jsuint *lengthp)
return !tvr.value().isNull();
}
JSBool
js_IsArrayLike(JSContext *cx, JSObject *obj, JSBool *answerp, jsuint *lengthp)
{
JSObject *wrappedObj = obj->wrappedObject(cx);
*answerp = wrappedObj->isArguments() || wrappedObj->isArray();
if (!*answerp) {
*lengthp = 0;
return JS_TRUE;
}
return js_GetLengthProperty(cx, obj, lengthp);
}
/*
* Since SpiderMonkey supports cross-class prototype-based delegation, we have
* to be careful about the length getter and setter being called on an object