[PATCH v3 3/3] jscript/tests: Add more tests for setting prototype to different builtin types.

Gabriel Ivăncescu gabrielopcode at gmail.com
Thu Mar 11 10:01:10 CST 2021


Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
 dlls/jscript/tests/lang.js | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js
index 94c3329..fa8407c 100644
--- a/dlls/jscript/tests/lang.js
+++ b/dlls/jscript/tests/lang.js
@@ -1887,6 +1887,24 @@ ok(!tmp.hasOwnProperty("y"), "tmp has 'y' property");
 ok(!tmp.propertyIsEnumerable("y"), "tmp has 'y' property enumerable");
 ok(tmp.toString() == "[object Object]", "tmp.toString returned " + tmp.toString());
 
+testNullPrototype.prototype = 42;
+tmp = new testNullPrototype();
+ok(tmp.hasOwnProperty("x"), "tmp does not have 'x' property");
+ok(!tmp.hasOwnProperty("y"), "tmp has 'y' property");
+ok(tmp.toString() == "[object Object]", "tmp.toString returned " + tmp.toString());
+
+testNullPrototype.prototype = true;
+tmp = new testNullPrototype();
+ok(tmp.hasOwnProperty("x"), "tmp does not have 'x' property");
+ok(!tmp.hasOwnProperty("y"), "tmp has 'y' property");
+ok(tmp.toString() == "[object Object]", "tmp.toString returned " + tmp.toString());
+
+testNullPrototype.prototype = "foobar";
+tmp = new testNullPrototype();
+ok(tmp.hasOwnProperty("x"), "tmp does not have 'x' property");
+ok(!tmp.hasOwnProperty("y"), "tmp has 'y' property");
+ok(tmp.toString() == "[object Object]", "tmp.toString returned " + tmp.toString());
+
 function do_test() {}
 function nosemicolon() {} nosemicolon();
 function () {} nosemicolon();
-- 
2.30.0




More information about the wine-devel mailing list