Commit 898cb6fc authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Added Array default value implementation.

parent 2efae9e7
...@@ -621,8 +621,17 @@ static HRESULT Array_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DI ...@@ -621,8 +621,17 @@ static HRESULT Array_isPrototypeOf(DispatchEx *dispex, LCID lcid, WORD flags, DI
static HRESULT Array_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, static HRESULT Array_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 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) static void Array_destructor(DispatchEx *dispex)
......
...@@ -58,6 +58,11 @@ ok(arr["2"] === "test", "arr[2] is not \"test\""); ...@@ -58,6 +58,11 @@ ok(arr["2"] === "test", "arr[2] is not \"test\"");
arr["7"] = true; arr["7"] = true;
ok((arr.length === 8), "arr.length is not 8"); 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); var arr = new Array(6);
ok(typeof(arr) === "object", "arr (6) is not object"); ok(typeof(arr) === "object", "arr (6) is not object");
ok((arr.length === 6), "arr.length is not 6"); ok((arr.length === 6), "arr.length is not 6");
......
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