Index: test/mjsunit/harmony/async-debug-caught-exception.js |
diff --git a/test/mjsunit/harmony/async-debug-caught-exception.js b/test/mjsunit/harmony/async-debug-caught-exception.js |
index b2ae18437d7c6860355da3aae93bd376eb59bd6b..b2ceeb99589c4128e2f8182d0f5a0a0ab83d0683 100644 |
--- a/test/mjsunit/harmony/async-debug-caught-exception.js |
+++ b/test/mjsunit/harmony/async-debug-caught-exception.js |
@@ -87,3 +87,37 @@ Debug.setListener(null); |
Debug.clearBreakOnUncaughtException(); |
assertEquals([], log); |
assertNull(exception); |
+ |
+log = []; |
+Debug.setListener(listener); |
+Debug.setBreakOnException(); |
+ |
+// "rethrown" uncaught exceptions in return don't cause another event |
+async function propagate_inner() { return thrower(); } |
+async function propagate_outer() { return propagate_inner(); } |
+ |
+propagate_outer(); |
+%RunMicrotasks(); |
+assertEquals(["a"], log); |
+assertNull(exception); |
+ |
+// Also don't propagate if an await interceded |
+log = []; |
+async function propagate_await() { await 1; return thrower(); } |
+async function propagate_await_outer() { return propagate_await(); } |
+propagate_await_outer(); |
+%RunMicrotasks(); |
+assertEquals(["a"], log); |
+assertNull(exception); |
+ |
+Debug.clearBreakOnException(); |
+Debug.setBreakOnUncaughtException(); |
+ |
+log = []; |
+Promise.resolve().then(() => Promise.reject()).catch(() => log.push("d")); // Exception c |
+%RunMicrotasks(); |
+assertEquals(["d"], log); |
+assertNull(exception); |
+ |
+Debug.clearBreakOnUncaughtException(); |
+Debug.setListener(null); |