Author: akhaldi
Date: Sat Jun 3 22:28:34 2017
New Revision: 74812
URL:
http://svn.reactos.org/svn/reactos?rev=74812&view=rev
Log:
[JSCRIPT_WINETEST] Sync with Wine Staging 2.9. CORE-13362
Modified:
trunk/rostests/winetests/jscript/lang.js
Modified: trunk/rostests/winetests/jscript/lang.js
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/jscript/lang.js…
==============================================================================
--- trunk/rostests/winetests/jscript/lang.js [iso-8859-1] (original)
+++ trunk/rostests/winetests/jscript/lang.js [iso-8859-1] Sat Jun 3 22:28:34 2017
@@ -264,6 +264,8 @@
eval("testRes(); testRes()");
tmp = eval("3; if(false) {4;} else {};;;")
ok(tmp === 3, "tmp = " + tmp);
+tmp = eval("try { 1; } finally { 2; }")
+ok(tmp === 2, "tmp = " + tmp);
testNoRes();
testRes() && testRes();
@@ -977,6 +979,164 @@
i++;
}
return i;
+})();
+
+(function() {
+ var ret, x;
+
+ function unreachable() {
+ ok(false, "unreachable");
+ }
+
+ function expect(value, expect_value) {
+ ok(value === expect_value, "got " + value + " expected " +
expect_value);
+ }
+
+ ret = (function() {
+ try {
+ return "try";
+ unreachable();
+ }catch(e) {
+ unreachable();
+ }finally {
+ return "finally";
+ unreachable();
+ }
+ unreachable();
+ })();
+ expect(ret, "finally");
+
+ x = "";
+ ret = (function() {
+ try {
+ x += "try,";
+ return x;
+ unreachable();
+ }catch(e) {
+ unreachable();
+ }finally {
+ x += "finally,";
+ }
+ unreachable();
+ })();
+ expect(ret, "try,");
+ expect(x, "try,finally,");
+
+ x = "";
+ ret = (function() {
+ try {
+ x += "try,"
+ throw 1;
+ unreachable();
+ }catch(e) {
+ x += "catch,";
+ return "catch";
+ unreachable();
+ }finally {
+ x += "finally,";
+ return "finally";
+ unreachable();
+ }
+ unreachable();
+ })();
+ expect(ret, "finally");
+ expect(x, "try,catch,finally,");
+
+ x = "";
+ ret = (function() {
+ try {
+ x += "try,"
+ throw 1;
+ unreachable();
+ }catch(e) {
+ x += "catch,";
+ return "catch";
+ unreachable();
+ }finally {
+ x += "finally,";
+ }
+ unreachable();
+ })();
+ expect(ret, "catch");
+ expect(x, "try,catch,finally,");
+
+ x = "";
+ ret = (function() {
+ try {
+ x += "try,"
+ try {
+ x += "try2,";
+ return "try2";
+ }catch(e) {
+ unreachable();
+ }finally {
+ x += "finally2,";
+ }
+ unreachable();
+ }catch(e) {
+ unreachable();
+ }finally {
+ x += "finally,";
+ }
+ unreachable();
+ })();
+ expect(ret, "try2");
+ expect(x, "try,try2,finally2,finally,");
+
+ x = "";
+ ret = (function() {
+ while(true) {
+ try {
+ x += "try,"
+ try {
+ x += "try2,";
+ break;
+ }catch(e) {
+ unreachable();
+ }finally {
+ x += "finally2,";
+ }
+ unreachable();
+ }catch(e) {
+ unreachable();
+ }finally {
+ x += "finally,";
+ }
+ unreachable();
+ }
+ x += "ret";
+ return "ret";
+ })();
+ expect(ret, "ret");
+ expect(x, "try,try2,finally2,finally,ret");
+
+ x = "";
+ ret = (function() {
+ while(true) {
+ try {
+ x += "try,"
+ try {
+ x += "try2,";
+ continue;
+ }catch(e) {
+ unreachable();
+ }finally {
+ x += "finally2,";
+ }
+ unreachable();
+ }catch(e) {
+ unreachable();
+ }finally {
+ x += "finally,";
+ break;
+ }
+ unreachable();
+ }
+ x += "ret";
+ return "ret";
+ })();
+ expect(ret, "ret");
+ expect(x, "try,try2,finally2,finally,ret");
})();
tmp = eval("1");
@@ -1597,6 +1757,15 @@
})();
ok(tmp, "tmp = " + tmp);
+tmp = (function() {
+ for(var iter in [1,2,3,4]) {
+ var ret = false;
+ with({ret: true})
+ return ret;
+ }
+})();
+ok(tmp, "tmp = " + tmp);
+
(function() {
ok(typeof(func) === "function", "typeof(func) = " +
typeof(func));
with(new Object()) {