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

Unified Diff: test/mjsunit/es6/debug-promises/promise-all-uncaught.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 | « src/runtime/runtime-internal.cc ('k') | test/mjsunit/es6/debug-promises/promise-race-uncaught.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/debug-promises/promise-all-uncaught.js
diff --git a/test/mjsunit/es6/debug-promises/promise-all-uncaught.js b/test/mjsunit/es6/debug-promises/promise-all-uncaught.js
index d183c5cf2d3b5711f9318e670b473852603a69e2..fce2a5da5ada4094ec86ac6fb6cdab39276f2698 100644
--- a/test/mjsunit/es6/debug-promises/promise-all-uncaught.js
+++ b/test/mjsunit/es6/debug-promises/promise-all-uncaught.js
@@ -6,13 +6,14 @@
// Test debug events when we only listen to uncaught exceptions and a
// Promise p3 created by Promise.all has no catch handler, and is rejected
-// because one of the Promises p2 passed to Promise.all is rejected. We
-// expect two Exception debug events to be triggered, for p2 and p3 each,
-// because neither has an user-defined catch handler.
+// because one of the Promises p2 passed to Promise.all is rejected.
+// We expect one event for p2; the system recognizes the rejection of p3
+// to be redundant and based on the rejection of p2 and does not trigger
+// an additional rejection.
var Debug = debug.Debug;
-var expected_events = 2;
+var expected_events = 1;
var log = [];
var p1 = Promise.resolve();
@@ -35,13 +36,9 @@ function listener(event, exec_state, event_data, data) {
assertTrue(expected_events >= 0);
assertEquals("uncaught", event_data.exception().message);
assertTrue(event_data.promise() instanceof Promise);
- if (expected_events === 1) {
- // Assert that the debug event is triggered at the throw site.
- assertTrue(exec_state.frame(0).sourceLineText().indexOf("// event") > 0);
- assertEquals("p2", event_data.promise().name);
- } else {
- assertEquals("p3", event_data.promise().name);
- }
+ // Assert that the debug event is triggered at the throw site.
+ assertTrue(exec_state.frame(0).sourceLineText().indexOf("// event") > 0);
+ assertEquals("p2", event_data.promise().name);
assertTrue(event_data.uncaught());
} catch (e) {
%AbortJS(e + "\n" + e.stack);
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | test/mjsunit/es6/debug-promises/promise-race-uncaught.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698