Andrew Nguyen : jscript: Implement the String.sup() method.
Alexandre Julliard
julliard at winehq.org
Wed Dec 10 07:41:57 CST 2008
Module: wine
Branch: master
Commit: abedd774fbbf055692814492235d299ce9c4ad3c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=abedd774fbbf055692814492235d299ce9c4ad3c
Author: Andrew Nguyen <arethusa26 at gmail.com>
Date: Wed Dec 10 03:07:46 2008 -0600
jscript: Implement the String.sup() 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 c0ee311..eeceb1f 100644
--- a/dlls/jscript/string.c
+++ b/dlls/jscript/string.c
@@ -1089,8 +1089,8 @@ static HRESULT String_substr(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA
static HRESULT String_sup(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{
- FIXME("\n");
- return E_NOTIMPL;
+ static const WCHAR suptagW[] = {'S','U','P',0};
+ return do_attributeless_tag_format(dispex, lcid, flags, dp, retv, ei, sp, suptagW);
}
static HRESULT String_toLowerCase(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js
index 72b64d2..2868c0f 100644
--- a/dlls/jscript/tests/api.js
+++ b/dlls/jscript/tests/api.js
@@ -341,6 +341,15 @@ ok(tmp === "<SUB>test</SUB>", "'test'.sub() = " + tmp);
tmp = "test".sub(3);
ok(tmp === "<SUB>test</SUB>", "'test'.sub(3) = " + tmp);
+tmp = "".sup();
+ok(tmp === "<SUP></SUP>", "''.sup() = " + tmp);
+tmp = "".sup(3);
+ok(tmp === "<SUP></SUP>", "''.sup(3) = " + tmp);
+tmp = "test".sup();
+ok(tmp === "<SUP>test</SUP>", "'test'.sup() = " + tmp);
+tmp = "test".sup(3);
+ok(tmp === "<SUP>test</SUP>", "'test'.sup(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