jscript: Added Array default value implementation.

This commit is contained in:
Jacek Caban 2008-09-21 15:40:22 +02:00 committed by Alexandre Julliard
parent 2efae9e79b
commit 898cb6fcd4
2 changed files with 16 additions and 2 deletions

View File

@ -621,10 +621,19 @@ static HRESULT Array_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DI
static HRESULT Array_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp)
{
FIXME("\n");
TRACE("\n");
switch(flags) {
case INVOKE_PROPERTYGET:
return array_join(dispex, lcid, ((ArrayInstance*)dispex)->length, default_separatorW, retv, ei, sp);
default:
FIXME("unimplemented flags %x\n", flags);
return E_NOTIMPL;
}
return S_OK;
}
static void Array_destructor(DispatchEx *dispex)
{
heap_free(dispex);

View File

@ -58,6 +58,11 @@ ok(arr["2"] === "test", "arr[2] is not \"test\"");
arr["7"] = true;
ok((arr.length === 8), "arr.length is not 8");
tmp = "" + [];
ok(tmp === "", "'' + [] = " + tmp);
tmp = "" + [1,true];
ok(tmp === "1,true", "'' + [1,true] = " + tmp);
var arr = new Array(6);
ok(typeof(arr) === "object", "arr (6) is not object");
ok((arr.length === 6), "arr.length is not 6");