зеркало из https://github.com/mozilla/gecko-dev.git
Bug 505494 - Unwrap invisible wrappers when they're passed to Function.prototype.apply. r=mrbkap
This commit is contained in:
Родитель
bbe9e48fbc
Коммит
d587813ddb
|
@ -581,7 +581,7 @@ js_IsArrayLike(JSContext *cx, JSObject *obj, JSBool *answerp, jsuint *lengthp)
|
|||
{
|
||||
JSClass *clasp;
|
||||
|
||||
clasp = OBJ_GET_CLASS(cx, obj);
|
||||
clasp = OBJ_GET_CLASS(cx, js_GetWrappedObject(cx, obj));
|
||||
*answerp = (clasp == &js_ArgumentsClass || clasp == &js_ArrayClass ||
|
||||
clasp == &js_SlowArrayClass);
|
||||
if (!*answerp) {
|
||||
|
|
|
@ -111,6 +111,15 @@
|
|||
is(XPCSafeJSObjectWrapper.prototype + '',
|
||||
"[object XPCSafeJSObjectWrapper]",
|
||||
"able to convert XPCSafeJSObjectWrapper.prototype to string");
|
||||
|
||||
try {
|
||||
is((function(x) { return x+1; }).apply(this,
|
||||
XPCSafeJSObjectWrapper([1])),
|
||||
2);
|
||||
} catch (e) {
|
||||
ok(false,
|
||||
"Unable to call apply() with a XPCSafeJSObjectWrapped array");
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Загрузка…
Ссылка в новой задаче