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

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-03-01 23:58:25 +01:00 committed by Alexandre Julliard
parent 5f9f9a45e9
commit 89da4559ee
2 changed files with 5 additions and 2 deletions

View File

@ -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))

View File

@ -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;