Commit 1f134b41 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Added String default value implementation.

parent 3925f130
......@@ -638,8 +638,26 @@ static HRESULT String_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, D
static HRESULT String_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{
FIXME("\n");
return E_NOTIMPL;
StringInstance *This = (StringInstance*)dispex;
TRACE("\n");
switch(flags) {
case DISPATCH_PROPERTYGET: {
BSTR str = SysAllocString(This->str);
if(!str)
return E_OUTOFMEMORY;
V_VT(retv) = VT_BSTR;
V_BSTR(retv) = str;
break;
}
default:
FIXME("flags %x\n", flags);
return E_NOTIMPL;
}
return S_OK;
}
static void String_destructor(DispatchEx *dispex)
......
......@@ -66,6 +66,9 @@ ok(str.toString() === "", "str.toString() = " + str.toString());
var str = new String("test", "abc");
ok(str.toString() === "test", "str.toString() = " + str.toString());
tmp = "value " + str;
ok(tmp === "value test", "'value ' + str = " + tmp);
tmp = "abc".charAt(0);
ok(tmp === "a", "'abc',charAt(0) = " + tmp);
tmp = "abc".charAt(1);
......
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