[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: tests/khtmltests/regression/tests/js
From: Maks Orlovich <maksim () kde ! org>
Date: 2008-05-16 18:17:44
Message-ID: 1210961864.844346.25521.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 808481 by orlovich:
Add in a testcase graciously contributed by Oliver Hunt from Apple...
M +51 -2 break-finally.js
--- trunk/tests/khtmltests/regression/tests/js/break-finally.js #808480:808481
@@ -67,7 +67,6 @@
}
out += "after-loop";
shouldBe('out', '"loop;finally;after-loop"');
-print(out);
// Multi-level breaks. Fun.
out = "";
@@ -87,4 +86,54 @@
out += "after-1";
shouldBe('out', '"out;in;finally;after-1"');
-print(out);
+
+
+// This testcase is by Oliver Hunt (oliver at apple dt com)
+msg="global";
+
+out="";
+function record(str) {
+ out += "<" + str + ">";
+}
+
+function f() {
+ L3: do {
+ try {
+ with ({msg:"outer3"}) {
+ L2: do {
+ try {
+ with ({msg:"outer2"}) {
+ L1: do {
+ try {
+ with ({msg:"outer1"}) {
+ record(msg);
+ continue L1;
+ }
+ } finally {
+ record("finally1")
+ return;
+ }
+ } while(0)
+ record(msg);
+ continue L2;
+ }
+ } finally {
+ record("finally2")
+ return;
+ }
+ } while(0)
+ record(msg);
+ continue L3;
+ }
+ } finally {
+ record("finally3")
+ return;
+ }
+ record("while");
+ } while(0);
+}
+f();
+record(msg);
+shouldBe('out', '"<outer1><finally1><finally2><finally3><global>"');
+
+print("Done.");
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic