mirror of
https://github.com/reactos/reactos.git
synced 2025-05-07 18:56:48 +00:00
[JSCRIPT_WINETEST] Sync with Wine Staging 2.9. CORE-13362
svn path=/trunk/; revision=74812
This commit is contained in:
parent
96d090509e
commit
dac59d58ed
1 changed files with 169 additions and 0 deletions
|
@ -264,6 +264,8 @@ ok(tmp === 3, "tmp = " + tmp);
|
||||||
eval("testRes(); testRes()");
|
eval("testRes(); testRes()");
|
||||||
tmp = eval("3; if(false) {4;} else {};;;")
|
tmp = eval("3; if(false) {4;} else {};;;")
|
||||||
ok(tmp === 3, "tmp = " + tmp);
|
ok(tmp === 3, "tmp = " + tmp);
|
||||||
|
tmp = eval("try { 1; } finally { 2; }")
|
||||||
|
ok(tmp === 2, "tmp = " + tmp);
|
||||||
|
|
||||||
testNoRes();
|
testNoRes();
|
||||||
testRes() && testRes();
|
testRes() && testRes();
|
||||||
|
@ -979,6 +981,164 @@ case 3:
|
||||||
return 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");
|
tmp = eval("1");
|
||||||
ok(tmp === 1, "eval(\"1\") !== 1");
|
ok(tmp === 1, "eval(\"1\") !== 1");
|
||||||
eval("{ ok(tmp === 1, 'eval: tmp !== 1'); } tmp = 2;");
|
eval("{ ok(tmp === 1, 'eval: tmp !== 1'); } tmp = 2;");
|
||||||
|
@ -1597,6 +1757,15 @@ tmp = (function() {
|
||||||
})();
|
})();
|
||||||
ok(tmp, "tmp = " + tmp);
|
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() {
|
(function() {
|
||||||
ok(typeof(func) === "function", "typeof(func) = " + typeof(func));
|
ok(typeof(func) === "function", "typeof(func) = " + typeof(func));
|
||||||
with(new Object()) {
|
with(new Object()) {
|
||||||
|
|
Loading…
Reference in a new issue