jscript: Fixed deleting nonexistent identifiers.
This commit is contained in:
parent
7f07bb9a7a
commit
4dbd777de2
|
@ -1631,16 +1631,22 @@ static HRESULT interp_delete_ident(exec_ctx_t *ctx)
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return 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");
|
FIXME("Unsupported exprval\n");
|
||||||
exprval_release(&exprval);
|
exprval_release(&exprval);
|
||||||
return E_NOTIMPL;
|
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));
|
return stack_push(ctx, jsval_bool(ret));
|
||||||
}
|
}
|
||||||
|
|
|
@ -1123,6 +1123,7 @@ for(iter in tmp)
|
||||||
ok(false, "tmp has prop " + iter);
|
ok(false, "tmp has prop " + iter);
|
||||||
ok((delete tmp.test) === true, "deleting test didn't return true");
|
ok((delete tmp.test) === true, "deleting test didn't return true");
|
||||||
ok((delete tmp.nonexistent) === true, "deleting nonexistent 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 = new Object();
|
||||||
tmp.test = false;
|
tmp.test = false;
|
||||||
|
|
Loading…
Reference in New Issue