Commit 257e15da authored by Andrew Nguyen's avatar Andrew Nguyen Committed by Alexandre Julliard

jscript: Implement the String.sub() method.

parent f2388d92
......@@ -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 */
......
......@@ -332,6 +332,15 @@ ok(tmp === "<STRIKE>test</STRIKE>", "'test'.strike() = " + tmp);
tmp = "test".strike(3);
ok(tmp === "<STRIKE>test</STRIKE>", "'test'.strike(3) = " + tmp);
tmp = "".sub();
ok(tmp === "<SUB></SUB>", "''.sub() = " + tmp);
tmp = "".sub(3);
ok(tmp === "<SUB></SUB>", "''.sub(3) = " + tmp);
tmp = "test".sub();
ok(tmp === "<SUB>test</SUB>", "'test'.sub() = " + tmp);
tmp = "test".sub(3);
ok(tmp === "<SUB>test</SUB>", "'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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment