js/src/jit-test/tests/baseline/try-finally-2.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     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);

mercurial