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

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gabriel Ivăncescu 2021-03-11 18:01:10 +02:00 committed by Alexandre Julliard
parent ba1f47a770
commit 0ae1669ec2

View file

@ -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();