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

Unified Diff: test/mjsunit/harmony/async-debug-caught-exception.js

Issue 2244003003: Change which ExceptionEvents are triggered by Promises (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed typos Created 4 years, 4 months 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
« no previous file with comments | « test/mjsunit/es6/debug-promises/reject-uncaught-uncaught.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « test/mjsunit/es6/debug-promises/reject-uncaught-uncaught.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698