Commit f39d5e46 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Make Array.slice generic.

parent 00644c54
......@@ -456,8 +456,9 @@ static HRESULT Array_slice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS
if(is_class(dispex, JSCLASS_ARRAY)) {
length = ((ArrayInstance*)dispex)->length;
}else {
FIXME("not Array this\n");
return E_NOTIMPL;
hres = get_jsdisp_length(dispex, lcid, ei, &length);
if(FAILED(hres))
return hres;
}
if(arg_cnt(dp)) {
......
......@@ -628,6 +628,15 @@ arr[12] = 2;
ok(arr.slice(5).toString() === "a,,,,,,,2", "arr.slice(5).toString() = " + arr.slice(5).toString());
ok(arr.slice(5).length === 8, "arr.slice(5).length = " + arr.slice(5).length);
obj = new Object();
obj.length = 3;
obj[0] = 1;
obj[1] = 2;
obj[2] = 3;
tmp = Array.prototype.slice.call(obj, 1, 2);
ok(tmp.length === 1, "tmp.length = " + tmp.length);
ok(tmp[0] === 2, "tmp[0] = " + tmp[0]);
var num = new Number(2);
ok(num.toString() === "2", "num(2).toString !== 2");
var num = new Number();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment