https://git.reactos.org/?p=reactos.git;a=commitdiff;h=20f9fb615047c34fa4e79…
commit 20f9fb615047c34fa4e79f12b900cbdaf6ea3be9
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Sat Jan 26 13:12:15 2019 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sat Jan 26 13:12:15 2019 +0100
[JSCRIPT_WINETEST] Sync with Wine Staging 4.0. CORE-15682
---
modules/rostests/winetests/jscript/api.js | 22 ++++++++++++++++++
modules/rostests/winetests/jscript/lang.js | 37 ++++++++++++++++++++++++++++++
modules/rostests/winetests/jscript/run.c | 2 +-
3 files changed, 60 insertions(+), 1 deletion(-)
diff --git a/modules/rostests/winetests/jscript/api.js
b/modules/rostests/winetests/jscript/api.js
index f9178a9713..ff6a6b781c 100644
--- a/modules/rostests/winetests/jscript/api.js
+++ b/modules/rostests/winetests/jscript/api.js
@@ -618,6 +618,28 @@ ok(r[0] === "1", "r[0] = " + r[0]);
ok(r[1] === "2", "r[1] = " + r[1]);
ok(r[2] === "3", "r[1] = " + r[1]);
+r = "1,2,3".split(undefined);
+ok(typeof(r) === "object", "typeof(r) = " + typeof(r));
+ok(r.length === 1, "r.length = " + r.length);
+ok(r[0] === "1,2,3", "r[0] = " + r[0]);
+
+r = "1,undefined2undefined,3".split(undefined);
+ok(typeof(r) === "object", "typeof(r) = " + typeof(r));
+ok(r.length === 3, "r.length = " + r.length);
+ok(r[0] === "1,", "r[0] = " + r[0]);
+ok(r[1] === "2", "r[1] = " + r[1]);
+ok(r[2] === ",3", "r[2] = " + r[2]);
+
+r = "1,undefined2undefined,3".split();
+ok(typeof(r) === "object", "typeof(r) = " + typeof(r));
+ok(r.length === 1, "r.length = " + r.length);
+ok(r[0] === "1,undefined2undefined,3", "r[0] = " + r[0]);
+
+r = "".split();
+ok(typeof(r) === "object", "typeof(r) = " + typeof(r));
+ok(r.length === 1, "r.length = " + r.length);
+ok(r[0] === "", "r[0] = " + r[0]);
+
tmp = "abcd".indexOf("bc",0);
ok(tmp === 1, "indexOf = " + tmp);
tmp = "abcd".indexOf("bc",1);
diff --git a/modules/rostests/winetests/jscript/lang.js
b/modules/rostests/winetests/jscript/lang.js
index e6ff4dd059..2a30ea35a7 100644
--- a/modules/rostests/winetests/jscript/lang.js
+++ b/modules/rostests/winetests/jscript/lang.js
@@ -480,6 +480,20 @@ ok(obj3.prop1 === 1, "obj3.prop1 is not 1");
ok(obj3.prop2 === "boolean", "obj3.prop2 is not
\"boolean\"");
ok(obj3.constructor === Object, "unexpected obj3.constructor");
+if(invokeVersion >= 2) {
+ eval("tmp = {prop: 'value',}");
+ ok(tmp.prop === "value", "tmp.prop = " + tmp.prop);
+ eval("tmp = {prop: 'value',second:2,}");
+ ok(tmp.prop === "value", "tmp.prop = " + tmp.prop);
+}else {
+ try {
+ eval("tmp = {prop: 'value',}");
+ }catch(e) {
+ tmp = true;
+ }
+ ok(tmp === true, "exception not fired");
+}
+
{
var blockVar = 1;
blockVar = 2;
@@ -1146,6 +1160,27 @@ case 3:
})();
expect(ret, "ret");
expect(x, "try,try2,finally2,finally,ret");
+
+ ret = (function() {
+ try {
+ return "try";
+ unreachable();
+ }catch(e) {
+ unreachable();
+ }finally {
+ new Object();
+ var tmp = (function() {
+ var s = new String();
+ try {
+ s.length;
+ }finally {
+ return 1;
+ }
+ })();
+ }
+ unreachable();
+ })();
+ expect(ret, "try");
})();
tmp = eval("1");
@@ -1797,6 +1832,8 @@ ok(tmp, "tmp = " + tmp);
ok(x === undefined, "x = " + x);
})();
+var get, set;
+
/* NoNewline rule parser tests */
while(true) {
if(true) break
diff --git a/modules/rostests/winetests/jscript/run.c
b/modules/rostests/winetests/jscript/run.c
index 887b264d8f..77cd74ebb3 100644
--- a/modules/rostests/winetests/jscript/run.c
+++ b/modules/rostests/winetests/jscript/run.c
@@ -1316,7 +1316,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id,
LCID lcid,
case DISPID_GLOBAL_TESTARGTYPES: {
VARIANT args[8], v;
- DISPPARAMS dp = {args, NULL, sizeof(args)/sizeof(*args), 0};
+ DISPPARAMS dp = {args, NULL, ARRAY_SIZE(args), 0};
HRESULT hres;
CHECK_EXPECT(global_testargtypes_i);