Andrew Nguyen : jscript: Implement the String.fixed() method.

Alexandre Julliard julliard at winehq.org
Tue Dec 2 11:02:16 CST 2008


Module: wine
Branch: master
Commit: c80a23c639ded0e196a72f3b8ea46441d4ab24cf
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c80a23c639ded0e196a72f3b8ea46441d4ab24cf

Author: Andrew Nguyen <arethusa26 at gmail.com>
Date:   Sun Nov 30 06:40:22 2008 -0600

jscript: Implement the String.fixed() method.

---

 dlls/jscript/string.c     |    4 ++--
 dlls/jscript/tests/api.js |    9 +++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c
index 426436b..f99d9ad 100644
--- a/dlls/jscript/string.c
+++ b/dlls/jscript/string.c
@@ -329,8 +329,8 @@ static HRESULT String_concat(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA
 static HRESULT String_fixed(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
         VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
 {
-    FIXME("\n");
-    return E_NOTIMPL;
+    static const WCHAR fixedtagW[] = {'T','T',0};
+    return do_attributeless_tag_format(dispex, lcid, flags, dp, retv, ei, sp, fixedtagW);
 }
 
 static HRESULT String_fontcolor(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js
index 4355d34..c8e8d2c 100644
--- a/dlls/jscript/tests/api.js
+++ b/dlls/jscript/tests/api.js
@@ -296,6 +296,15 @@ ok(tmp === "<B>test</B>", "'test'.bold() = " + tmp);
 tmp = "test".bold(3);
 ok(tmp === "<B>test</B>", "'test'.bold(3) = " + tmp);
 
+tmp = "".fixed();
+ok(tmp === "<TT></TT>", "''.fixed() = " + tmp);
+tmp = "".fixed(3);
+ok(tmp === "<TT></TT>", "''.fixed(3) = " + tmp);
+tmp = "test".fixed();
+ok(tmp === "<TT>test</TT>", "'test'.fixed() = " + tmp);
+tmp = "test".fixed(3);
+ok(tmp === "<TT>test</TT>", "'test'.fixed(3) = " + tmp);
+
 var arr = new Array();
 ok(typeof(arr) === "object", "arr () is not object");
 ok((arr.length === 0), "arr.length is not 0");




More information about the wine-cvs mailing list