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

jscript: Added ArrayInstance::on_put implementation.

parent 06d19171
......@@ -194,7 +194,23 @@ static void Array_destructor(DispatchEx *dispex)
static void Array_on_put(DispatchEx *dispex, const WCHAR *name)
{
FIXME("\n");
ArrayInstance *array = (ArrayInstance*)dispex;
const WCHAR *ptr = name;
DWORD id = 0;
if(!isdigitW(*ptr))
return;
while(*ptr && isdigitW(*ptr)) {
id = id*10 + (*ptr-'0');
ptr++;
}
if(*ptr)
return;
if(id >= array->length)
array->length = id+1;
}
static const builtin_prop_t Array_props[] = {
......
......@@ -28,6 +28,9 @@ ok(arr["0"] === 1, "arr[0] is not 1");
ok(arr["1"] === 2, "arr[1] is not 2");
ok(arr["2"] === "test", "arr[2] is not \"test\"");
arr["7"] = true;
ok((arr.length === 8), "arr.length is not 8");
var arr = new Array(6);
ok(typeof(arr) === "object", "arr (6) is not object");
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