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

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


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

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

jscript: Implement the String.bold() 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 94f4733..426436b 100644
--- a/dlls/jscript/string.c
+++ b/dlls/jscript/string.c
@@ -174,8 +174,8 @@ static HRESULT String_blink(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
 static HRESULT String_bold(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
         VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
 {
-    FIXME("\n");
-    return E_NOTIMPL;
+    static const WCHAR boldtagW[] = {'B',0};
+    return do_attributeless_tag_format(dispex, lcid, flags, dp, retv, ei, sp, boldtagW);
 }
 
 /* ECMA-262 3rd Edition    15.5.4.5 */
diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js
index 7668509..4355d34 100644
--- a/dlls/jscript/tests/api.js
+++ b/dlls/jscript/tests/api.js
@@ -287,6 +287,15 @@ ok(tmp === "<BLINK>test</BLINK>", "'test'.blink() = " + tmp);
 tmp = "test".blink(3);
 ok(tmp === "<BLINK>test</BLINK>", "'test'.blink(3) = " + tmp);
 
+tmp = "".bold();
+ok(tmp === "<B></B>", "''.bold() = " + tmp);
+tmp = "".bold(3);
+ok(tmp === "<B></B>", "''.bold(3) = " + tmp);
+tmp = "test".bold();
+ok(tmp === "<B>test</B>", "'test'.bold() = " + tmp);
+tmp = "test".bold(3);
+ok(tmp === "<B>test</B>", "'test'.bold(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