Jeff Smith : mshtml/tests: Add tests showing how toString has changed in IE9+.

Alexandre Julliard julliard at winehq.org
Fri Aug 7 10:42:27 CDT 2020


Module: wine
Branch: stable
Commit: a1e8694059cca9723cf0b2ddbafa42a8edd09f9a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a1e8694059cca9723cf0b2ddbafa42a8edd09f9a

Author: Jeff Smith <whydoubt at gmail.com>
Date:   Mon Mar 16 23:36:36 2020 -0500

mshtml/tests: Add tests showing how toString has changed in IE9+.

Signed-off-by: Jeff Smith <whydoubt at gmail.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 79cde059ea2497194dfdf39140295fbf731b286b)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/jscript/tests/api.js |  6 ++++++
 dlls/mshtml/tests/es5.js  | 23 +++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js
index 1a81253a02..d4aa7f4383 100644
--- a/dlls/jscript/tests/api.js
+++ b/dlls/jscript/tests/api.js
@@ -351,6 +351,12 @@ tmp = Object.prototype.toString.call(new VBArray(createArray()));
 ok(tmp === "[object Object]", "toString.call(new VBArray()) = " + tmp);
 (tmp = new Enumerator()).f = Object.prototype.toString;
 ok(tmp.f() === "[object Object]", "tmp.f() = " + tmp.f());
+tmp = Object.prototype.toString.call(null);
+ok(tmp === "[object Object]", "toString.call(null) = " + tmp);
+tmp = Object.prototype.toString.call(undefined);
+ok(tmp === "[object Object]", "toString.call(undefined) = " + tmp);
+tmp = Object.prototype.toString.call();
+ok(tmp === "[object Object]", "toString.call() = " + tmp);
 
 function TSTestConstr() {}
 TSTestConstr.prototype = { toString: function() { return "test"; } };
diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js
index 7ee8cc1e03..7a5b9d57ea 100644
--- a/dlls/mshtml/tests/es5.js
+++ b/dlls/mshtml/tests/es5.js
@@ -767,6 +767,28 @@ function test_getPrototypeOf() {
     next_test();
 }
 
+function test_toString() {
+    var tmp;
+
+    (function () { tmp = Object.prototype.toString.call(arguments); })();
+    todo_wine.
+    ok(tmp === "[object Arguments]", "toString.call(arguments) = " + tmp);
+    tmp = Object.prototype.toString.call(this);
+    todo_wine.
+    ok(tmp === "[object Window]", "toString.call(null) = " + tmp);
+    tmp = Object.prototype.toString.call(null);
+    todo_wine.
+    ok(tmp === "[object Null]", "toString.call(null) = " + tmp);
+    tmp = Object.prototype.toString.call(undefined);
+    todo_wine.
+    ok(tmp === "[object Undefined]", "toString.call(undefined) = " + tmp);
+    tmp = Object.prototype.toString.call();
+    todo_wine.
+    ok(tmp === "[object Undefined]", "toString.call() = " + tmp);
+
+    next_test();
+}
+
 function test_bind() {
     var f, r;
     var o = new Object(), o2 = new Object();
@@ -860,5 +882,6 @@ var tests = [
     test_global_properties,
     test_string_split,
     test_getPrototypeOf,
+    test_toString,
     test_bind
 ];




More information about the wine-cvs mailing list