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

Unified 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 side-by-side diff with in-line comments
Download patch
« src/ia32/fast-codegen-ia32.cc ('K') | « src/x64/macro-assembler-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/try.js
diff --git a/test/mjsunit/try.js b/test/mjsunit/try.js
index 0bd78b4332ee5cf8b55484253387c0b861c13869..794860a7c6484df04139be599285c7d7579cbd35 100644
--- a/test/mjsunit/try.js
+++ b/test/mjsunit/try.js
@@ -347,3 +347,48 @@ assertTrue(broke);
assertFalse(caught);
assertTrue(finalized);
+function return_from_nested_finally_in_finally() {
+ try {
+ return 1;
+ } finally {
+ try {
+ return 2;
+ } finally {
+ return 42;
+ }
+ }
+}
+
+assertEquals(42, return_from_nested_finally_in_finally());
+
+function break_from_nested_finally_in_finally() {
+ L: try {
+ return 1;
+ } finally {
+ try {
+ return 2;
+ } finally {
+ break L;
+ }
+ }
+ return 42;
+}
+
+assertEquals(42, break_from_nested_finally_in_finally());
+
+function continue_from_nested_finally_in_finally() {
+ do {
+ try {
+ return 1;
+ } finally {
+ try {
+ return 2;
+ } finally {
+ continue;
+ }
+ }
+ } while (false);
+ return 42;
+}
+
+assertEquals(42, continue_from_nested_finally_in_finally());
« 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