Commit c6188fdf authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Added Object default value implementation.

parent 5fa649ca
...@@ -30,6 +30,8 @@ static const WCHAR propertyIsEnumerableW[] = ...@@ -30,6 +30,8 @@ static const WCHAR propertyIsEnumerableW[] =
{'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0};
static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0};
static const WCHAR default_valueW[] = {'[','o','b','j','e','c','t',' ','O','b','j','e','c','t',']',0};
static HRESULT Object_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, static HRESULT Object_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{ {
...@@ -75,8 +77,21 @@ static HRESULT Object_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, D ...@@ -75,8 +77,21 @@ static HRESULT Object_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, D
static HRESULT Object_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, static HRESULT Object_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{ {
FIXME("\n"); TRACE("\n");
return E_NOTIMPL;
switch(flags) {
case DISPATCH_PROPERTYGET:
V_VT(retv) = VT_BSTR;
V_BSTR(retv) = SysAllocString(default_valueW);
if(!V_BSTR(retv))
return E_OUTOFMEMORY;
break;
default:
FIXME("unimplemented flags %x\n", flags);
return E_NOTIMPL;
}
return S_OK;
} }
static void Object_destructor(DispatchEx *dispex) static void Object_destructor(DispatchEx *dispex)
......
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
var tmp; var tmp;
tmp = "" + new Object();
ok(tmp === "[object Object]", "'' + new Object() = " + tmp);
ok("".length === 0, "\"\".length = " + "".length); ok("".length === 0, "\"\".length = " + "".length);
ok(getVT("".length) == "VT_I4", "\"\".length = " + "".length); ok(getVT("".length) == "VT_I4", "\"\".length = " + "".length);
ok("abc".length === 3, "\"abc\".length = " + "abc".length); ok("abc".length === 3, "\"abc\".length = " + "abc".length);
......
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