2008-06-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
authorcwzwarich@webkit.org <cwzwarich@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jun 2008 04:47:05 +0000 (04:47 +0000)
committercwzwarich@webkit.org <cwzwarich@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Jun 2008 04:47:05 +0000 (04:47 +0000)
        Reviewed by Oliver.

        Bug 17932: "ASSERTION FAILED: type != Continue" with do/while and try/finally
        <https://bugs.webkit.org/show_bug.cgi?id=17932>

        This bug was fixed by SquirrelFish, but we should add a test, as well
        as tests for related issues found while developing SquirrelFish.

        * fast/js/continue-break-multiple-labels-expected.txt:
        * fast/js/continue-break-multiple-labels.html:
        * fast/js/resources/continue-break-multiple-labels.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@34461 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/js/continue-break-multiple-labels-expected.txt
LayoutTests/fast/js/continue-break-multiple-labels.html
LayoutTests/fast/js/resources/continue-break-multiple-labels.js [new file with mode: 0644]

index 03de9be..002a8c7 100644 (file)
@@ -1,3 +1,17 @@
+2008-06-08  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
+
+        Reviewed by Oliver.
+
+        Bug 17932: "ASSERTION FAILED: type != Continue" with do/while and try/finally
+        <https://bugs.webkit.org/show_bug.cgi?id=17932>
+
+        This bug was fixed by SquirrelFish, but we should add a test, as well
+        as tests for related issues found while developing SquirrelFish.
+
+        * fast/js/continue-break-multiple-labels-expected.txt:
+        * fast/js/continue-break-multiple-labels.html:
+        * fast/js/resources/continue-break-multiple-labels.js: Added.
+
 2008-06-08  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Darin Alder.
index 78e74ca..7368e91 100644 (file)
@@ -1,6 +1,14 @@
-Expected: 12356789
-Actual: 12356789
-Expected: 123
-Actual: 123
-Test done
+This test checks break and continue behaviour in the presence of multiple labels.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS test1() is '12356789'
+PASS test2() is '123'
+PASS test3() is 10
+PASS test4() is 1
+PASS test5() is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
 
index 97495d8..ec7cf6d 100644 (file)
@@ -1,28 +1,13 @@
-<script>
-function print(msg) {
-    document.getElementById("log").innerHTML += msg;
-}
-function test() {
-    if (window.layoutTestController)
-        layoutTestController.dumpAsText();
-    print("Expected: 12356789<br>Actual: ");
-    a:
-    b:
-    for (var foo = 1; foo < 10; foo++) {
-       if (foo == 4)
-            continue a;
-       print(foo);
-    }
-    print("<br>Expected: 123<br>Actual: ");
-    c:
-    d:
-    for (var bar = 1; bar < 10; bar++) {
-       if (bar == 4)
-            break c;
-       print(bar);
-    }
-    print("<br>Test done<br>");
-}
-</script>
-<body onload="test()">
-<div id="log"></div>
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="resources/js-test-style.css">
+<script src="resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/continue-break-multiple-labels.js"></script>
+<script src="resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/js/resources/continue-break-multiple-labels.js b/LayoutTests/fast/js/resources/continue-break-multiple-labels.js
new file mode 100644 (file)
index 0000000..8589414
--- /dev/null
@@ -0,0 +1,90 @@
+description(
+'This test checks break and continue behaviour in the presence of multiple labels.'
+);
+
+function test1()
+{
+    var s = "";
+    
+    a:
+    b:
+    for (var i = 1; i < 10; i++) {
+       if (i == 4)
+            continue a;
+       s += i;
+    }
+    
+    return s;
+}
+
+shouldBe("test1()", "'12356789'");
+
+function test2()
+{
+    var s = "";
+    
+    a:
+    b:
+    for (var i = 1; i < 10; i++) {
+        if (i == 4)
+            break a;
+        s += i;
+    }
+    
+    return s;
+}
+
+shouldBe("test2()", "'123'");
+
+function test3()
+{
+    var i;
+    for (i = 1; i < 10; i++) {
+        try {
+            continue;
+        } finally {
+            innerLoop:
+            while (1) {
+                break innerLoop;
+            }
+        }
+    }
+    
+    return i;
+}
+
+shouldBe("test3()", "10");
+
+function test4()
+{
+    var i = 0;
+    
+    a:
+    i++;
+    while (1) {
+        break;
+    }
+    
+    return i;
+}
+
+shouldBe("test4()", "1");
+
+function test5()
+{
+    var i = 0;
+    
+    switch (1) {
+    default:
+        while (1) {
+            break;
+        }
+        i++;
+    }
+    
+    return i;
+}
+
+shouldBe("test5()", "1");
+
+var successfullyParsed = true;