Commit 1388a6f4 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Added String.valueOf implementation.

parent 304e9fe0
...@@ -114,11 +114,13 @@ static HRESULT String_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPA ...@@ -114,11 +114,13 @@ static HRESULT String_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPA
return S_OK; return S_OK;
} }
/* ECMA-262 3rd Edition 15.5.4.2 */
static HRESULT String_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, static HRESULT String_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{ {
FIXME("\n"); TRACE("\n");
return E_NOTIMPL;
return String_toString(dispex, lcid, flags, dp, retv, ei, sp);
} }
static HRESULT String_anchor(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, static HRESULT String_anchor(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
......
...@@ -33,6 +33,13 @@ ok(tmp === "test", "''.toString() = " + tmp); ...@@ -33,6 +33,13 @@ ok(tmp === "test", "''.toString() = " + tmp);
tmp = "test".toString(3); tmp = "test".toString(3);
ok(tmp === "test", "''.toString(3) = " + tmp); 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); tmp = "abc".charAt(0);
ok(tmp === "a", "'abc',charAt(0) = " + tmp); ok(tmp === "a", "'abc',charAt(0) = " + tmp);
tmp = "abc".charAt(1); tmp = "abc".charAt(1);
......
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