jscript: Added Array.toString implementation.

This commit is contained in:
Jacek Caban 2008-09-21 15:36:46 +02:00 committed by Alexandre Julliard
parent f62dd2a9fd
commit 8b13719cd2
2 changed files with 14 additions and 2 deletions

View File

@ -279,11 +279,18 @@ static HRESULT Array_splice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
return E_NOTIMPL;
}
/* ECMA-262 3rd Edition 15.4.4.2 */
static HRESULT Array_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{
FIXME("\n");
return E_NOTIMPL;
TRACE("\n");
if(!is_class(dispex, JSCLASS_ARRAY)) {
WARN("not Array object\n");
return E_FAIL;
}
return array_join(dispex, lcid, ((ArrayInstance*)dispex)->length, default_separatorW, retv, ei, sp);
}
static HRESULT Array_toLocaleString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,

View File

@ -79,4 +79,9 @@ ok(tmp === "1;2;;false;;;a", "arr.join(';') = " + tmp);
tmp = arr.join("");
ok(tmp === "12falsea", "arr.join('') = " + tmp);
tmp = arr.toString();
ok(tmp === "1,2,,false,,,a", "arr.toString() = " + tmp);
tmp = arr.toString("test");
ok(tmp === "1,2,,false,,,a", "arr.toString() = " + tmp);
reportSuccess();