Index: test/mjsunit/harmony/do-expressions.js |
diff --git a/test/mjsunit/harmony/do-expressions.js b/test/mjsunit/harmony/do-expressions.js |
index b0822e1593b7ccdffe689f68067309aa00310451..e7e513a2306d1c1b17f1ea8f5e1a440026662512 100644 |
--- a/test/mjsunit/harmony/do-expressions.js |
+++ b/test/mjsunit/harmony/do-expressions.js |
@@ -263,6 +263,36 @@ function TestHoisting() { |
TestHoisting(); |
+// v8:4661 |
+ |
+function tryFinallySimple() { (do { try {} finally {} }); } |
+tryFinallySimple(); |
+tryFinallySimple(); |
+tryFinallySimple(); |
+tryFinallySimple(); |
+ |
+var finallyRanCount = 0; |
+function tryFinallyDoExpr() { |
+ return (do { |
+ try { |
+ throw "BOO"; |
+ } catch (e) { |
+ "Caught: " + e + " (" + finallyRanCount + ")" |
+ } finally { |
+ ++finallyRanCount; |
+ } |
+ }); |
+} |
+assertEquals("Caught: BOO (0)", tryFinallyDoExpr()); |
+assertEquals(1, finallyRanCount); |
+assertEquals("Caught: BOO (1)", tryFinallyDoExpr()); |
+assertEquals(2, finallyRanCount); |
+assertEquals("Caught: BOO (2)", tryFinallyDoExpr()); |
+assertEquals(3, finallyRanCount); |
+assertEquals("Caught: BOO (3)", tryFinallyDoExpr()); |
+assertEquals(4, finallyRanCount); |
+ |
+ |
function TestOSR() { |
var numbers = do { |
let nums = []; |