summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/harmony/do-expressions.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit/harmony/do-expressions.js')
-rw-r--r--deps/v8/test/mjsunit/harmony/do-expressions.js32
1 files changed, 31 insertions, 1 deletions
diff --git a/deps/v8/test/mjsunit/harmony/do-expressions.js b/deps/v8/test/mjsunit/harmony/do-expressions.js
index c3f9e0cd86..e7e513a230 100644
--- a/deps/v8/test/mjsunit/harmony/do-expressions.js
+++ b/deps/v8/test/mjsunit/harmony/do-expressions.js
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Flags: --harmony-do-expressions --harmony-sloppy-let --allow-natives-syntax
-// Flags: --harmony-default-parameters --harmony-destructuring
+// Flags: --harmony-default-parameters --harmony-destructuring-bind
// Flags: --harmony-completion
function returnValue(v) { return v; }
@@ -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 = [];