jscript: Fixed deleting nonexisting properties from member expression.
This commit is contained in:
parent
9de9c353ac
commit
7f07bb9a7a
|
@ -1516,10 +1516,12 @@ HRESULT disp_delete_name(script_ctx_t *ctx, IDispatch *disp, jsstr_t *name, BOOL
|
|||
dispex_prop_t *prop;
|
||||
|
||||
hres = find_prop_name(jsdisp, string_hash(name->str), name->str, &prop);
|
||||
if(prop)
|
||||
if(prop) {
|
||||
hres = delete_prop(prop, ret);
|
||||
else
|
||||
hres = DISP_E_MEMBERNOTFOUND;
|
||||
}else {
|
||||
*ret = TRUE;
|
||||
hres = S_OK;
|
||||
}
|
||||
|
||||
jsdisp_release(jsdisp);
|
||||
return hres;
|
||||
|
|
|
@ -1121,6 +1121,8 @@ ok(typeof(tmp.test) === "undefined", "tmp.test type = " + typeof(tmp.test));
|
|||
ok(!("test" in tmp), "test is still in tmp after delete?");
|
||||
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");
|
||||
|
||||
tmp = new Object();
|
||||
tmp.test = false;
|
||||
|
|
Loading…
Reference in New Issue