OLD | NEW |
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 Loading... |
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()); |
OLD | NEW |