tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

try-finally-2.js (463B)


      1 var count = 0;
      2 function f() {
      3    try {
      4 try {
      5     try {
      6 	count += 2;
      7     } finally {
      8 	count += 3;
      9 	throw 3;
     10     }
     11 } catch(e) {
     12     count += 4;
     13     throw 4;
     14 }
     15    } finally {
     16 count += 5;
     17 try {
     18     count += 6;
     19 } catch(e) {
     20     count += 7;
     21     throw 123;
     22 } finally {
     23     count += 8;
     24 }
     25 count += 9;
     26    }
     27    count += 10;
     28 }
     29 for (var i=0; i<3; i++) {
     30    try {
     31 f();
     32 assertEq(0, 1);
     33    } catch(e) {
     34 assertEq(e, 4);
     35    }
     36 }
     37 assertEq(count, 111);