From edba282951c07966273118e261b4b7fdef15efd5 Mon Sep 17 00:00:00 2001 From: Andrew Nguyen Date: Sun, 30 Nov 2008 06:40:30 -0600 Subject: [PATCH] jscript: Implement the String.italics() 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 f99d9ad732..5afbe464d5 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -418,8 +418,8 @@ static HRESULT String_indexOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPAR static HRESULT String_italics(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + static const WCHAR italicstagW[] = {'I',0}; + return do_attributeless_tag_format(dispex, lcid, flags, dp, retv, ei, sp, italicstagW); } static HRESULT String_lastIndexOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index c8e8d2c6c0..d8df87f208 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -305,6 +305,15 @@ ok(tmp === "test", "'test'.fixed() = " + tmp); tmp = "test".fixed(3); ok(tmp === "test", "'test'.fixed(3) = " + tmp); +tmp = "".italics(); +ok(tmp === "", "''.italics() = " + tmp); +tmp = "".italics(3); +ok(tmp === "", "''.italics(3) = " + tmp); +tmp = "test".italics(); +ok(tmp === "test", "'test'.italics() = " + tmp); +tmp = "test".italics(3); +ok(tmp === "test", "'test'.italics(3) = " + tmp); + var arr = new Array(); ok(typeof(arr) === "object", "arr () is not object"); ok((arr.length === 0), "arr.length is not 0");