jscript: Implement the String.sup() method.
authorAndrew Nguyen <arethusa26@gmail.com>
Wed, 10 Dec 2008 09:07:46 +0000 (03:07 -0600)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 10 Dec 2008 10:50:23 +0000 (11:50 +0100)
dlls/jscript/string.c
dlls/jscript/tests/api.js

index c0ee3115d99bd6496d5c13ad9bd744965b8e7205..eeceb1f6932a0a76720d8aec5a7ca5b5710f507e 100644 (file)
@@ -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,
index 72b64d26cae4dcd8010b193c2a9e2af15cc52a5d..2868c0f7aedeb7298bb5b9be991f487cffcd3b7b 100644 (file)
@@ -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");