jscript: Added String.valueOf implementation.

This commit is contained in:
Jacek Caban 2008-09-21 15:41:42 +02:00 committed by Alexandre Julliard
parent 304e9fe0d4
commit 1388a6f421
2 changed files with 11 additions and 2 deletions

View File

@ -114,11 +114,13 @@ static HRESULT String_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPA
return S_OK;
}
/* ECMA-262 3rd Edition 15.5.4.2 */
static HRESULT String_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{
FIXME("\n");
return E_NOTIMPL;
TRACE("\n");
return String_toString(dispex, lcid, flags, dp, retv, ei, sp);
}
static HRESULT String_anchor(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,

View File

@ -33,6 +33,13 @@ ok(tmp === "test", "''.toString() = " + tmp);
tmp = "test".toString(3);
ok(tmp === "test", "''.toString(3) = " + tmp);
tmp = "".valueOf();
ok(tmp === "", "''.valueOf() = " + tmp);
tmp = "test".valueOf();
ok(tmp === "test", "''.valueOf() = " + tmp);
tmp = "test".valueOf(3);
ok(tmp === "test", "''.valueOf(3) = " + tmp);
tmp = "abc".charAt(0);
ok(tmp === "a", "'abc',charAt(0) = " + tmp);
tmp = "abc".charAt(1);