Commit 4dbd777d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Fixed deleting nonexistent identifiers.

parent 7f07bb9a
......@@ -1631,16 +1631,22 @@ static HRESULT interp_delete_ident(exec_ctx_t *ctx)
if(FAILED(hres))
return hres;
if(exprval.type != EXPRVAL_IDREF) {
switch(exprval.type) {
case EXPRVAL_IDREF:
hres = disp_delete(exprval.u.idref.disp, exprval.u.idref.id, &ret);
IDispatch_Release(exprval.u.idref.disp);
if(FAILED(hres))
return ret;
break;
case EXPRVAL_INVALID:
ret = TRUE;
break;
default:
FIXME("Unsupported exprval\n");
exprval_release(&exprval);
return E_NOTIMPL;
}
hres = disp_delete(exprval.u.idref.disp, exprval.u.idref.id, &ret);
IDispatch_Release(exprval.u.idref.disp);
if(FAILED(hres))
return ret;
return stack_push(ctx, jsval_bool(ret));
}
......
......@@ -1123,6 +1123,7 @@ for(iter in tmp)
ok(false, "tmp has prop " + iter);
ok((delete tmp.test) === true, "deleting test didn't return true");
ok((delete tmp.nonexistent) === true, "deleting nonexistent didn't return true");
ok((delete nonexistent) === true, "deleting nonexistent didn't return true");
tmp = new Object();
tmp.test = false;
......
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