jscript: Implement the String.sub() method.
This commit is contained in:
parent
f2388d9269
commit
257e15da39
@ -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,
|
static HRESULT String_sub(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
|
||||||
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
|
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
|
||||||
{
|
{
|
||||||
FIXME("\n");
|
static const WCHAR subtagW[] = {'S','U','B',0};
|
||||||
return E_NOTIMPL;
|
return do_attributeless_tag_format(dispex, lcid, flags, dp, retv, ei, sp, subtagW);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ECMA-262 3rd Edition 15.5.4.15 */
|
/* ECMA-262 3rd Edition 15.5.4.15 */
|
||||||
|
@ -332,6 +332,15 @@ ok(tmp === "<STRIKE>test</STRIKE>", "'test'.strike() = " + tmp);
|
|||||||
tmp = "test".strike(3);
|
tmp = "test".strike(3);
|
||||||
ok(tmp === "<STRIKE>test</STRIKE>", "'test'.strike(3) = " + tmp);
|
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();
|
var arr = new Array();
|
||||||
ok(typeof(arr) === "object", "arr () is not object");
|
ok(typeof(arr) === "object", "arr () is not object");
|
||||||
ok((arr.length === 0), "arr.length is not 0");
|
ok((arr.length === 0), "arr.length is not 0");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user