https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6b881f65022e958a8b66d…
commit 6b881f65022e958a8b66d6929df6d8bd963fb768
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Mon Jun 4 03:39:17 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Mon Jun 4 03:39:17 2018 +0100
[JSCRIPT_WINETEST] Sync with Wine Staging 3.9. CORE-14656
---
modules/rostests/winetests/jscript/api.js | 10 ++++++++++
modules/rostests/winetests/jscript/lang.js | 9 +++++++++
2 files changed, 19 insertions(+)
diff --git a/modules/rostests/winetests/jscript/api.js
b/modules/rostests/winetests/jscript/api.js
index 4207f5a769..f9178a9713 100644
--- a/modules/rostests/winetests/jscript/api.js
+++ b/modules/rostests/winetests/jscript/api.js
@@ -408,6 +408,12 @@ ok(str.toString() === "", "str.toString() = " +
str.toString());
var str = new String("test", "abc");
ok(str.toString() === "test", "str.toString() = " + str.toString());
+str = new String("test");
+ok(str.length === 4, "str.length = " + str.length);
+str.length = 3;
+str.length = 5;
+ok(str.length === 4, "str.length = " + str.length);
+
var strObj = new Object();
strObj.toString = function() { return "abcd" };
strObj.substr = String.prototype.substr;
@@ -1810,6 +1816,7 @@ ok(isNaN(tmp), "Math.tan(-Infinity) is not NaN");
return;
var stringify_tests = [
+ [[], undefined],
[[true], "true"],
[[false], "false"],
[[null], "null"],
@@ -1836,6 +1843,9 @@ ok(isNaN(tmp), "Math.tan(-Infinity) is not NaN");
"["+i+"] stringify(" + stringify_tests[i][0] + ")
returned " + s + " expected " + stringify_tests[i][1]);
}
+ s = JSON.stringify();
+ ok(s === undefined, "stringify() returned " + s + " expected
undefined");
+
s = JSON.stringify(testObj);
ok(s === undefined || s === "undefined" /* broken on some old versions */,
"stringify(testObj) returned " + s + " expected undfined");
diff --git a/modules/rostests/winetests/jscript/lang.js
b/modules/rostests/winetests/jscript/lang.js
index ef4c3165b1..e6ff4dd059 100644
--- a/modules/rostests/winetests/jscript/lang.js
+++ b/modules/rostests/winetests/jscript/lang.js
@@ -48,6 +48,9 @@ tmp = 07777777777777777777777;
ok(typeof(tmp) === "number" && tmp > 0xffffffff, "tmp = "
+ tmp);
tmp = 07777777779777777777777;
ok(typeof(tmp) === "number" && tmp > 0xffffffff, "tmp = "
+ tmp);
+ok(0xffffffff === 4294967295, "0xffffffff = " + 0xffffffff);
+tmp = 0x10000000000000000000000000000000000000000000000000000000000000000;
+ok(tmp === Math.pow(2, 256), "0x1000...00 != 2^256");
ok(1 !== 2, "1 !== 2 is false");
ok(null !== undefined, "null !== undefined is false");
@@ -632,6 +635,12 @@ tmp = 10;
ok((tmp |= 0x10) === 26, "tmp(10) |= 0x10 !== 26");
ok(getVT(tmp) === "VT_I4", "getVT(tmp |= 10) = " + getVT(tmp));
+tmp = (123 * Math.pow(2,32) + 2) | 0;
+ok(tmp === 2, "123*2^32+2 | 0 = " + tmp);
+
+tmp = (-123 * Math.pow(2,32) + 2) | 0;
+ok(tmp === 2, "123*2^32+2 | 0 = " + tmp);
+
tmp = 3 & 5;
ok(tmp === 1, "3 & 5 !== 1");
ok(getVT(tmp) === "VT_I4", "getVT(3|5) = " + getVT(tmp));