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

Unified Diff: src/runtime.cc

Issue 260723002: Trigger exception debug event for promises at the throw site. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: comments addressed 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 6b7a446c5c962891345f8ba32ef13bc8ce4332a7..6148cfd9e6b3996dd7875363485f01d00021c917 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -5642,13 +5642,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