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

Unified Diff: test/mjsunit/es6/debug-promises/reject-caught-by-default-reject-handler.js

Issue 2278643002: Do not trigger ExceptionEvents for another forwarding case (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/js/promise.js ('k') | test/mjsunit/es6/debug-promises/throw-caught-by-default-reject-handler.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/debug-promises/reject-caught-by-default-reject-handler.js
diff --git a/test/mjsunit/es6/debug-promises/reject-caught-by-default-reject-handler.js b/test/mjsunit/es6/debug-promises/reject-caught-by-default-reject-handler.js
index cd13dbf9d2c5a720a3edc5219d5afa83209890ab..6cd28259e1498af679dd7305eca2543ba41df1e7 100644
--- a/test/mjsunit/es6/debug-promises/reject-caught-by-default-reject-handler.js
+++ b/test/mjsunit/es6/debug-promises/reject-caught-by-default-reject-handler.js
@@ -6,13 +6,13 @@
// Test debug events when we only listen to uncaught exceptions and
// there is only a default reject handler for the to-be-rejected Promise.
-// We expect two Exception debug events:
-// - when the first Promise is rejected and only has default reject handlers.
-// - when the default reject handler passes the rejection on.
+// We expect only one debug event: when the first Promise is rejected
+// and only has default reject handlers. No event is triggered when
+// simply forwarding the rejection with .then's default handler.
Debug = debug.Debug;
-var expected_events = 2;
+var expected_events = 1;
var log = [];
var resolve, reject;
@@ -43,15 +43,9 @@ function listener(event, exec_state, event_data, data) {
assertTrue(expected_events >= 0);
assertTrue(event_data.uncaught());
assertTrue(event_data.promise() instanceof Promise);
- if (expected_events == 1) {
- // p1 is rejected, uncaught, with the error from the Promise.reject line
- assertNotNull(event_data.sourceLineText().match("Promise.reject"));
- assertSame(p1, event_data.promise());
- } else {
- // p2 is rejected by p1's default reject handler.
- assertEquals(0, exec_state.frameCount());
- assertSame(p2, event_data.promise());
- }
+ // p1 is rejected, uncaught, with the error from the Promise.reject line
+ assertNotNull(event_data.sourceLineText().match("Promise.reject"));
+ assertSame(p1, event_data.promise());
}
} catch (e) {
%AbortJS(e + "\n" + e.stack);
« no previous file with comments | « src/js/promise.js ('k') | test/mjsunit/es6/debug-promises/throw-caught-by-default-reject-handler.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698