[PATCH v7 01/11] jscript: Treat prototype refs as non-existent when deleting.

Gabriel Ivăncescu gabrielopcode at gmail.com
Wed Nov 24 08:10:30 CST 2021


Delete only affects own properties.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
 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 e64a520..df81e1a 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 63aa669..f259c70 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 d5f33dd..041025c 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);
-- 
2.31.1




More information about the wine-devel mailing list