Commit 89da4559 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Properly support missing array elements in Array.pop.

parent 5f9f9a45
......@@ -387,9 +387,10 @@ static HRESULT Array_pop(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned
hres = jsdisp_get_idx(jsthis, length, &val);
if(SUCCEEDED(hres))
hres = jsdisp_delete_idx(jsthis, length);
else if(hres == DISP_E_UNKNOWNNAME)
else if(hres == DISP_E_UNKNOWNNAME) {
val = jsval_undefined();
else
hres = S_OK;
}else
return hres;
if(SUCCEEDED(hres))
......
......@@ -909,6 +909,8 @@ arr = [,,,,,];
tmp = arr.pop();
ok(arr.length === 5, "arr.length = " + arr.length);
ok(tmp === undefined, "tmp = " + tmp);
tmp = [1,2,,,].pop();
ok(tmp === undefined, "tmp = " + tmp);
function PseudoArray() {
this[0] = 0;
......
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