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

Unified Diff: test/mjsunit/es6/debug-promises-throw-in-reject.js

Issue 266533003: Reland "Trigger exception debug event for promises at the throw site." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix Created 6 years, 8 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
Index: test/mjsunit/es6/debug-promises-throw-in-reject.js
diff --git a/test/mjsunit/es6/debug-promises-throw-in-reject.js b/test/mjsunit/es6/debug-promises-throw-in-reject.js
index 6ae064dcd291d9bdd22d3eedf8ef1b417564ac65..cdf759606c68a2c152d0ac50d5ce982ac2872ef8 100644
--- a/test/mjsunit/es6/debug-promises-throw-in-reject.js
+++ b/test/mjsunit/es6/debug-promises-throw-in-reject.js
@@ -6,7 +6,7 @@
// Test debug events when an exception is thrown inside a Promise, which is
// caught by a custom promise, which throws a new exception in its reject
-// handler. We expect a PendingExceptionInPromise event to be triggered.
+// handler. We expect an Exception debug event with a promise to be triggered.
Debug = debug.Debug;
@@ -21,7 +21,7 @@ var p = new Promise(function(resolve, reject) {
function MyPromise(resolver) {
var reject = function() {
log.push("throw reject");
- throw new Error("reject");
+ throw new Error("reject"); // event
};
var resolve = function() { };
log.push("construct");
@@ -39,12 +39,12 @@ var q = p.chain(
function listener(event, exec_state, event_data, data) {
try {
- if (event == Debug.DebugEvent.PendingExceptionInPromise) {
+ if (event == Debug.DebugEvent.Exception) {
assertEquals(["resolve", "construct", "end main",
"throw caught", "throw reject"], log);
- assertEquals("caught", event_data.exception().message);
- } else if (event == Debug.DebugEvent.Exception) {
- assertUnreachable();
+ assertEquals("reject", event_data.exception().message);
+ assertEquals(q, event_data.promise());
+ assertTrue(exec_state.frame(0).sourceLineText().indexOf('// event') > 0);
}
} catch (e) {
// Signal a failure with exit code 1. This is necessary since the

Powered by Google App Engine
This is Rietveld 408576698