Gabriel Ivăncescu : jscript: Treat prototype refs as non-existent when deleting.

Alexandre Julliard julliard at winehq.org
Wed Nov 24 15:17:18 CST 2021


Module: wine
Branch: master
Commit: 58722dfe35a1c760ba6baee809845923a409f293
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=58722dfe35a1c760ba6baee809845923a409f293

Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date:   Wed Nov 24 16:10:30 2021 +0200

jscript: Treat prototype refs as non-existent when deleting.

Delete only affects own properties.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/jscript/dispex.c             | 5 +++++
 dlls/jscript/tests/lang.js        | 5 +++++
 dlls/mshtml/tests/documentmode.js | 1 -
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c
index e64a5203564..df81e1a0d99 100644
--- a/dlls/jscript/dispex.c
+++ b/dlls/jscript/dispex.c
@@ -1621,6 +1621,11 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
 
 static HRESULT delete_prop(dispex_prop_t *prop, BOOL *ret)
 {
+    if(prop->type == PROP_PROTREF) {
+        *ret = TRUE;
+        return S_OK;
+    }
+
     if(!(prop->flags & PROPF_CONFIGURABLE)) {
         *ret = FALSE;
         return S_OK;
diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js
index 63aa6696f89..f259c70e92e 100644
--- a/dlls/jscript/tests/lang.js
+++ b/dlls/jscript/tests/lang.js
@@ -1565,6 +1565,11 @@ ok(arr["test1"] === true, "arr[test1] !== true");
 ok(arr["test2"] === true, "arr[test2] !== true");
 ok(arr["test3"] === true, "arr[test3] !== true");
 
+ok((delete inobj.test1) === true, "delete inobj.test1 returned false");
+ok(!("test1" in inobj), "test1 is still in inobj after delete");
+ok((delete inobj.test3) === true, "delete inobj.test3 returned false");
+ok("test3" in inobj, "test3 is not in inobj after delete");
+
 tmp = new Object();
 tmp.test = false;
 ok((delete tmp.test) === true, "delete returned false");
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js
index d5f33dd9521..041025c8032 100644
--- a/dlls/mshtml/tests/documentmode.js
+++ b/dlls/mshtml/tests/documentmode.js
@@ -1192,7 +1192,6 @@ sync_test("__proto__", function() {
     ok(obj.__proto__ === ctor.prototype, "obj.__proto__ !== ctor.prototype");
 
     r = (delete x.__proto__);
-    todo_wine.
     ok(r, "delete x.__proto__ returned " + r);
     ok(Object.prototype.hasOwnProperty("__proto__"), "__proto__ is not a property of Object.prototype after delete");
     r = Object.getPrototypeOf(x);




More information about the wine-cvs mailing list