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

Unified Diff: src/runtime.cc

Issue 249503002: Trigger debug event on not yet caught exception in promises. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 c508b4a644fb2540caf3c178d11af3ab7841a057..7fffa3275fc452e6e86a4cc28678f79c69867ce9 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -5649,6 +5649,20 @@ RUNTIME_FUNCTION(Runtime_DebugPrepareStepInIfStepping) {
}
+// Notify the debugger if an expcetion in a promise is not caught (yet).
+RUNTIME_FUNCTION(Runtime_DebugPendingExceptionInPromise) {
+ SealHandleScope shs(isolate);
+#ifdef ENABLE_DEBUGGER_SUPPORT
+ ASSERT(args.length() == 2);
+ HandleScope scope(isolate);
rossberg 2014/04/24 07:27:36 Why have both a SHS and a HS in the same function?
rossberg 2014/04/24 08:08:38 Seems like you missed this one.
+ CONVERT_ARG_HANDLE_CHECKED(Object, exception, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Object, deferred_promise, 1);
rossberg 2014/04/24 07:27:36 One more.
Yang 2014/04/24 10:42:04 Done.
+ isolate->debugger()->OnException(exception, false, deferred_promise);
yurys 2014/04/24 07:48:43 It might make sense to report the exception as unc
Yang 2014/04/24 07:59:59 Done. Alternatively, we could always fire this ru
yurys 2014/04/24 08:49:50 I believe this is not necessary. We have three mod
+#endif // ENABLE_DEBUGGER_SUPPORT
+ return isolate->heap()->undefined_value();
+}
+
+
// Set a local property, even if it is READ_ONLY. If the property does not
// exist, it will be added with attributes NONE.
RUNTIME_FUNCTION(Runtime_IgnoreAttributesAndSetProperty) {

Powered by Google App Engine
This is Rietveld 408576698