Module: wine Branch: master Commit: ecfa129d669c2e77f33719f2905ae885151de6d6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=ecfa129d669c2e77f33719f290...
Author: Piotr Caban piotr.caban@gmail.com Date: Thu Jul 9 20:09:20 2009 +0200
jscript: Added String_anchor implementation.
---
dlls/jscript/string.c | 6 ++++-- dlls/jscript/tests/api.js | 13 +++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index efdff17..4777f18 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -201,8 +201,10 @@ static HRESULT do_attribute_tag_format(DispatchEx *dispex, LCID lcid, WORD flags static HRESULT String_anchor(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + static const WCHAR fontW[] = {'A',0}; + static const WCHAR colorW[] = {'N','A','M','E',0}; + + return do_attribute_tag_format(dispex, lcid, flags, dp, retv, ei, sp, fontW, colorW); }
static HRESULT String_big(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index fe20939..66d1280 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -269,6 +269,19 @@ ok(tmp === "TEST", "''.toUpperCase() = " + tmp); tmp = "tEsT".toUpperCase(3); ok(tmp === "TEST", "''.toUpperCase(3) = " + tmp);
+tmp = "".anchor(); +ok(tmp === "<A NAME="undefined"></A>", "''.anchor() = " + tmp); +tmp = "".anchor(3); +ok(tmp === "<A NAME="3"></A>", "''.anchor(3) = " + tmp); +tmp = "".anchor("red"); +ok(tmp === "<A NAME="red"></A>", "''.anchor('red') = " + tmp); +tmp = "test".anchor(); +ok(tmp === "<A NAME="undefined">test</A>", "'test'.anchor() = " + tmp); +tmp = "test".anchor(3); +ok(tmp === "<A NAME="3">test</A>", "'test'.anchor(3) = " + tmp); +tmp = "test".anchor("green"); +ok(tmp === "<A NAME="green">test</A>", "'test'.anchor('green') = " + tmp); + tmp = "".big(); ok(tmp === "<BIG></BIG>", "''.big() = " + tmp); tmp = "".big(3);