js/src/jit-test/tests/for-of/throw.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     1 // Control can exit a for-of loop via throw.
     3 function f() {
     4     for (var a of [1, 2, 3]) {
     5         for (var b of [1, 2, 3]) {
     6             for (var c of [1, 2, 3]) {
     7                 if (a !== b && b !== c && c !== a)
     8                     throw [a, b, c];
     9             }
    10         }
    11     }
    12 }
    14 var x = null;
    15 try {
    16     f();
    17 } catch (exc) {
    18     x = exc.join("");
    19 }
    20 assertEq(x, "123");

mercurial