Index: test/mjsunit/es6/debug-promises/promise-race-uncaught.js |
diff --git a/test/mjsunit/es6/debug-promises/promise-race-uncaught.js b/test/mjsunit/es6/debug-promises/promise-race-uncaught.js |
index 57955c01ef079366436271a19fc05536d66f7c59..b8a424f14d730888335e327ff71bc45b4585706b 100644 |
--- a/test/mjsunit/es6/debug-promises/promise-race-uncaught.js |
+++ b/test/mjsunit/es6/debug-promises/promise-race-uncaught.js |
@@ -6,13 +6,14 @@ |
// Test debug events when we only listen to uncaught exceptions and a |
// Promise p3 created by Promise.race 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.race 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); |