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

Unified Diff: test/mjsunit/harmony/debug-async-function-async-task-event.js

Issue 2417093003: [async await] Fix debug async task event (Closed)
Patch Set: fmt Created 4 years, 2 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 | « src/js/async-await.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/debug-async-function-async-task-event.js
diff --git a/test/mjsunit/harmony/debug-async-function-async-task-event.js b/test/mjsunit/harmony/debug-async-function-async-task-event.js
index 90e13d8659a3f81856e1bdc3b8f972405f3cfe9c..b99f52fb31344d526dbbeac05c139e821793160b 100644
--- a/test/mjsunit/harmony/debug-async-function-async-task-event.js
+++ b/test/mjsunit/harmony/debug-async-function-async-task-event.js
@@ -43,6 +43,7 @@ function assertLog(msg) {
function listener(event, exec_state, event_data, data) {
if (event != Debug.DebugEvent.AsyncTaskEvent) return;
try {
+ if ("Promise.resolve" == event_data.name()) return;
if (base_id < 0)
base_id = event_data.id();
var id = event_data.id() - base_id + 1;
@@ -73,3 +74,24 @@ resolver();
%RunMicrotasks();
assertNull(exception);
+
+Debug.clearBreakOnUncaughtException();
+Debug.setListener(null);
+
+var resolve;
+var turnOnListenerPromise = new Promise(r => resolve = r);
+async function confused() {
+ await turnOnListenerPromise;
+ throw foo
+}
+
+confused();
+
+Promise.resolve().then(() => {
+ Debug.setListener(listener);
+ Debug.setBreakOnUncaughtException();
+ resolve();
+});
+
+%RunMicrotasks();
+assertNull(exception);
« no previous file with comments | « src/js/async-await.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698