Gabriel Ivăncescu : jscript/tests: Add more tests for setting prototype to different builtin types.

Alexandre Julliard julliard at winehq.org
Thu Mar 11 15:59:37 CST 2021


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

Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date:   Thu Mar 11 18:01:10 2021 +0200

jscript/tests: Add more tests for setting prototype to different builtin types.

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/tests/lang.js | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js
index 94c33295abb..fa8407cecea 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();




More information about the wine-cvs mailing list