jscript: Added Object default value implementation.
This commit is contained in:
parent
5fa649cae6
commit
c6188fdffc
|
@ -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};
|
||||
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,
|
||||
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
|
||||
{
|
||||
|
@ -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,
|
||||
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
|
||||
{
|
||||
FIXME("\n");
|
||||
return E_NOTIMPL;
|
||||
TRACE("\n");
|
||||
|
||||
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)
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
|
||||
var tmp;
|
||||
|
||||
tmp = "" + new Object();
|
||||
ok(tmp === "[object Object]", "'' + new Object() = " + tmp);
|
||||
|
||||
ok("".length === 0, "\"\".length = " + "".length);
|
||||
ok(getVT("".length) == "VT_I4", "\"\".length = " + "".length);
|
||||
ok("abc".length === 3, "\"abc\".length = " + "abc".length);
|
||||
|
|
Loading…
Reference in New Issue