Jacek Caban : jscript: Added more tests.
Alexandre Julliard
julliard at winehq.org
Mon Jul 23 13:54:24 CDT 2012
Module: wine
Branch: master
Commit: de6e95213ae988c7accc4e04bce5ecc97d83a15d
URL: http://source.winehq.org/git/wine.git/?a=commit;h=de6e95213ae988c7accc4e04bce5ecc97d83a15d
Author: Jacek Caban <jacek at codeweavers.com>
Date: Mon Jul 23 15:54:01 2012 +0200
jscript: Added more tests.
---
dlls/jscript/tests/api.js | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js
index f6b22d3..f8885dd 100644
--- a/dlls/jscript/tests/api.js
+++ b/dlls/jscript/tests/api.js
@@ -198,6 +198,19 @@ tmp = "aA1~`!@#$%^&*()_+=-][{}';:/.,<>?\|";
ok(escape(tmp) === "aA1%7E%60%21@%23%24%25%5E%26*%28%29_+%3D-%5D%5B%7B%7D%27%3B%3A/.%2C%3C%3E%3F%7C", "escape('" + tmp + "') = " + escape(tmp));
ok(unescape(escape(tmp)) === tmp, "unescape(escape('" + tmp + "')) = " + unescape(escape(tmp)));
+ok(Object.prototype.hasOwnProperty('toString'), "Object.prototype.hasOwnProperty('toString') is false");
+ok(Object.prototype.hasOwnProperty('isPrototypeOf'), "Object.prototype.hasOwnProperty('isPrototypeOf') is false");
+ok(Function.prototype.hasOwnProperty('call'), "Function.prototype.hasOwnProperty('call') is false");
+
+obj = new Object();
+
+ok(!obj.hasOwnProperty('toString'), "obj.hasOwnProperty('toString') is true");
+ok(!obj.hasOwnProperty('isPrototypeOf'), "obj.hasOwnProperty('isPrototypeOf') is true");
+ok(!Object.hasOwnProperty('toString'), "Object.hasOwnProperty('toString') is true");
+ok(!Object.hasOwnProperty('isPrototypeOf'), "Object.hasOwnProperty('isPrototypeOf') is true");
+ok(!parseFloat.hasOwnProperty('call'), "parseFloat.hasOwnProperty('call') is true");
+ok(!Function.hasOwnProperty('call'), "Function.hasOwnProperty('call') is true");
+
tmp = "" + new Object();
ok(tmp === "[object Object]", "'' + new Object() = " + tmp);
(tmp = new Array).f = Object.prototype.toString;
@@ -225,6 +238,11 @@ ok(tmp === "[object Object]", "toString.call(arguments) = " + tmp);
tmp = Object.prototype.toString.call(new VBArray(createArray()));
ok(tmp === "[object Object]", "toString.call(new VBArray()) = " + tmp);
+function TSTestConstr() {}
+TSTestConstr.prototype = { toString: function() { return "test"; } };
+obj = new TSTestConstr();
+ok(obj.toString() === "test", "obj.toString() = " + obj.toString());
+
ok(Object(1) instanceof Number, "Object(1) is not instance of Number");
ok(Object("") instanceof String, "Object('') is not instance of String");
ok(Object(false) instanceof Boolean, "Object(false) is not instance of Boolean");
More information about the wine-cvs
mailing list