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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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