michael@0: var count = 0; michael@0: michael@0: // OSR into a finally block should not throw away the frame's michael@0: // return value. michael@0: function test1() { michael@0: try { michael@0: return [1, 2, 3]; michael@0: } finally { michael@0: for (var i=0; i<20; i++) { count++; } michael@0: } michael@0: } michael@0: assertEq(test1().toString(), "1,2,3"); michael@0: assertEq(count, 20); michael@0: michael@0: // OSR into the finally block, with exception pending. michael@0: function test2() { michael@0: try { michael@0: throw 3; michael@0: } finally { michael@0: for (var i=0; i<20; i++) { count++; } michael@0: } michael@0: } michael@0: try { michael@0: test2(); michael@0: assertEq(0, 1); michael@0: } catch(e) { michael@0: assertEq(e, 3); michael@0: } michael@0: assertEq(count, 40);