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

Unified Diff: src/runtime.cc

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: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 7eddc41977d0d335b4495072e17c365a57639651..216009b4ee2507bf3c4fe3f1df59976b403fdc93 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -5657,13 +5657,22 @@ RUNTIME_FUNCTION(Runtime_DebugPrepareStepInIfStepping) {
}
-// Notify the debugger if an expcetion in a promise is not caught (yet).
-RUNTIME_FUNCTION(Runtime_DebugPendingExceptionInPromise) {
- ASSERT(args.length() == 2);
+// The argument is a closure that is kept until the epilogue is called.
+// On exception, the closure is called, which returns the promise if the
+// exception is considered uncaught, or undefined otherwise.
+RUNTIME_FUNCTION(Runtime_DebugPromiseHandlePrologue) {
+ ASSERT(args.length() == 1);
HandleScope scope(isolate);
- CONVERT_ARG_HANDLE_CHECKED(Object, exception, 0);
- CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 1);
- isolate->debugger()->OnException(exception, true, promise);
+ CONVERT_ARG_HANDLE_CHECKED(JSFunction, promise_getter, 0);
+ isolate->debug()->PromiseHandlePrologue(promise_getter);
+ return isolate->heap()->undefined_value();
+}
+
+
+RUNTIME_FUNCTION(Runtime_DebugPromiseHandleEpilogue) {
+ ASSERT(args.length() == 0);
+ SealHandleScope shs(isolate);
+ isolate->debug()->PromiseHandleEpilogue();
return isolate->heap()->undefined_value();
}
« src/debug.cc ('K') | « src/runtime.h ('k') | test/mjsunit/es6/debug-promises-caught-all.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698