js/src/jit-test/tests/baseline/try-finally-osr.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;
     3 // OSR into a finally block should not throw away the frame's
     4 // return value.
     5 function test1() {
     6     try {
     7 	return [1, 2, 3];
     8     } finally {
     9 	for (var i=0; i<20; i++) { count++; }
    10     }
    11 }
    12 assertEq(test1().toString(), "1,2,3");
    13 assertEq(count, 20);
    15 // OSR into the finally block, with exception pending.
    16 function test2() {
    17     try {
    18 	throw 3;
    19     } finally {
    20 	for (var i=0; i<20; i++) { count++; }
    21     }
    22 }
    23 try {
    24     test2();
    25     assertEq(0, 1);
    26 } catch(e) {
    27     assertEq(e, 3);
    28 }
    29 assertEq(count, 40);

mercurial