From: Andrew Nguyen Date: Wed, 10 Dec 2008 09:07:35 +0000 (-0600) Subject: jscript: Implement the String.sub() method. X-Git-Tag: 1.0.10-eter3~4^2~5^2~3 X-Git-Url: http://git.etersoft.ru/projects/?a=commitdiff_plain;h=257e15da39c34870cd13f3b7852246fd1a95f44f;p=wine%2Feterwine.git jscript: Implement the String.sub() method. --- diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index 6dff58ecf1..c0ee3115d9 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -1004,8 +1004,8 @@ static HRESULT String_strike(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA static HRESULT String_sub(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + static const WCHAR subtagW[] = {'S','U','B',0}; + return do_attributeless_tag_format(dispex, lcid, flags, dp, retv, ei, sp, subtagW); } /* ECMA-262 3rd Edition 15.5.4.15 */ diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 1a0a88d213..72b64d26ca 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -332,6 +332,15 @@ ok(tmp === "test", "'test'.strike() = " + tmp); tmp = "test".strike(3); ok(tmp === "test", "'test'.strike(3) = " + tmp); +tmp = "".sub(); +ok(tmp === "", "''.sub() = " + tmp); +tmp = "".sub(3); +ok(tmp === "", "''.sub(3) = " + tmp); +tmp = "test".sub(); +ok(tmp === "test", "'test'.sub() = " + tmp); +tmp = "test".sub(3); +ok(tmp === "test", "'test'.sub(3) = " + tmp); + var arr = new Array(); ok(typeof(arr) === "object", "arr () is not object"); ok((arr.length === 0), "arr.length is not 0");