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

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

Issue 492002: Fast-codegen: Implementing try/finally on top of nesting context. (Closed)
Patch Set: Updated to be based on latest release. Created 11 years 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
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 329 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
350 function return_from_nested_finally_in_finally() {
351 try {
352 return 1;
353 } finally {
354 try {
355 return 2;
356 } finally {
357 return 42;
358 }
359 }
360 }
361
362 assertEquals(42, return_from_nested_finally_in_finally());
363
364 function break_from_nested_finally_in_finally() {
365 L: try {
366 return 1;
367 } finally {
368 try {
369 return 2;
370 } finally {
371 break L;
372 }
373 }
374 return 42;
375 }
376
377 assertEquals(42, break_from_nested_finally_in_finally());
378
379 function continue_from_nested_finally_in_finally() {
380 do {
381 try {
382 return 1;
383 } finally {
384 try {
385 return 2;
386 } finally {
387 continue;
388 }
389 }
390 } while (false);
391 return 42;
392 }
393
394 assertEquals(42, continue_from_nested_finally_in_finally());
OLDNEW
« src/ia32/fast-codegen-ia32.cc ('K') | « src/x64/macro-assembler-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698