Jacek Caban : jscript: Fixed deleting nonexisting properties from member expression.

Alexandre Julliard julliard at winehq.org
Mon Dec 17 13:58:23 CST 2012


Module: wine
Branch: master
Commit: 7f07bb9a7a1dbb9cab148ce58ec45775764a2f73
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7f07bb9a7a1dbb9cab148ce58ec45775764a2f73

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Dec 17 13:36:08 2012 +0100

jscript: Fixed deleting nonexisting properties from member expression.

---

 dlls/jscript/dispex.c      |    8 +++++---
 dlls/jscript/tests/lang.js |    2 ++
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c
index 2cd4ad5..dbb1c63 100644
--- a/dlls/jscript/dispex.c
+++ b/dlls/jscript/dispex.c
@@ -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;
diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js
index 23e12cc..f9c05bd 100644
--- a/dlls/jscript/tests/lang.js
+++ b/dlls/jscript/tests/lang.js
@@ -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;




More information about the wine-cvs mailing list