Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: test/mjsunit/try.js

Issue 40290: Experimental: Merge 1395:1441 from bleeding_edge branch to the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/global/
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/sparse-array-reverse.js ('k') | tools/js2c.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 assertEquals(5, f({}, 'bar', 5).bar); 58 assertEquals(5, f({}, 'bar', 5).bar);
59 59
60 function guard(f) { try { f(); } catch (o) { return o; } } 60 function guard(f) { try { f(); } catch (o) { return o; } }
61 assertEquals('baz', guard(function() { throw 'baz'; })); 61 assertEquals('baz', guard(function() { throw 'baz'; }));
62 assertEquals(2, (function() { try { throw {}; } catch(e) {} finally { return 2; } })()); 62 assertEquals(2, (function() { try { throw {}; } catch(e) {} finally { return 2; } })());
63 assertEquals(1, guard(function() { try { throw 1; } finally { } })); 63 assertEquals(1, guard(function() { try { throw 1; } finally { } }));
64 assertEquals(2, guard(function() { try { throw 2; } finally { var x = 12; } })); 64 assertEquals(2, guard(function() { try { throw 2; } finally { var x = 12; } }));
65 assertEquals(4, guard(function() { try { throw 3; } finally { throw 4; } })); 65 assertEquals(4, guard(function() { try { throw 3; } finally { throw 4; } }));
66 66
67 (function () { 67 (function () {
68 var iter = 10000000; 68 var iter = 1000000;
69 for (var i = 1; i <= iter; i++) { 69 for (var i = 1; i <= iter; i++) {
70 try { 70 try {
71 if (i == iter) gc(); 71 if (i == iter) gc();
72 } finally { 72 } finally {
73 if (i == iter) gc(); 73 if (i == iter) gc();
74 } 74 }
75 } 75 }
76 })(); 76 })();
77 77
78 function trycatch(a) { 78 function trycatch(a) {
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 broke = false; 340 broke = false;
341 } catch (o) { 341 } catch (o) {
342 caught = true; 342 caught = true;
343 } finally { 343 } finally {
344 finalized = true; 344 finalized = true;
345 } 345 }
346 assertTrue(broke); 346 assertTrue(broke);
347 assertFalse(caught); 347 assertFalse(caught);
348 assertTrue(finalized); 348 assertTrue(finalized);
349 349
OLDNEW
« no previous file with comments | « test/mjsunit/sparse-array-reverse.js ('k') | tools/js2c.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698