jscript: Added Object_valueOf implementation.

This commit is contained in:
Piotr Caban 2009-07-07 14:07:47 +02:00 committed by Alexandre Julliard
parent 7fcded1fc3
commit 3a1698ff06
2 changed files with 13 additions and 2 deletions

View File

@ -49,8 +49,16 @@ static HRESULT Object_toLocaleString(DispatchEx *dispex, LCID lcid, WORD flags,
static HRESULT Object_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{
FIXME("\n");
return E_NOTIMPL;
TRACE("\n");
if(retv) {
IDispatchEx_AddRef(_IDispatchEx_(dispex));
V_VT(retv) = VT_DISPATCH;
V_DISPATCH(retv) = (IDispatch*)_IDispatchEx_(dispex);
}
return S_OK;
}
static HRESULT Object_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,

View File

@ -439,6 +439,9 @@ ok(arr.sort() === arr, "arr.sort() !== arr");
for(var i=0; i < arr.length; i++)
ok(arr[i] === tmp[i], "arr[" + i + "] = " + arr[i] + " expected " + tmp[i]);
ok(arr.valueOf === Object.prototype.valueOf, "arr.valueOf !== Object.prototype.valueOf");
ok(arr === arr.valueOf(), "arr !== arr.valueOf");
var num = new Number(6);
arr = [0,1,2];
tmp = arr.concat(3, [4,5], num);