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

Unified Diff: src/runtime.cc

Issue 440773004: Trigger exception debug events on Promise reject. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: comments Created 6 years, 4 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
« no previous file with comments | « src/runtime.h ('k') | test/mjsunit/es6/debug-promise-events.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 55db916751f3c3e8e18f263f5976752c82562811..5e18c97bdcf0afdcf75ced9083bc35fdbb4dd14b 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -5465,22 +5465,19 @@ RUNTIME_FUNCTION(Runtime_DebugPrepareStepInIfStepping) {
}
-// 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) {
+RUNTIME_FUNCTION(Runtime_DebugPushPromise) {
DCHECK(args.length() == 1);
HandleScope scope(isolate);
- CONVERT_ARG_HANDLE_CHECKED(JSFunction, promise_getter, 0);
- isolate->debug()->PromiseHandlePrologue(promise_getter);
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0);
+ isolate->debug()->PushPromise(promise);
return isolate->heap()->undefined_value();
}
-RUNTIME_FUNCTION(Runtime_DebugPromiseHandleEpilogue) {
+RUNTIME_FUNCTION(Runtime_DebugPopPromise) {
DCHECK(args.length() == 0);
SealHandleScope shs(isolate);
- isolate->debug()->PromiseHandleEpilogue();
+ isolate->debug()->PopPromise();
return isolate->heap()->undefined_value();
}
@@ -5494,6 +5491,16 @@ RUNTIME_FUNCTION(Runtime_DebugPromiseEvent) {
}
+RUNTIME_FUNCTION(Runtime_DebugPromiseRejectEvent) {
+ DCHECK(args.length() == 2);
+ HandleScope scope(isolate);
+ CONVERT_ARG_HANDLE_CHECKED(JSObject, promise, 0);
+ CONVERT_ARG_HANDLE_CHECKED(Object, value, 1);
+ isolate->debug()->OnPromiseReject(promise, value);
+ return isolate->heap()->undefined_value();
+}
+
+
RUNTIME_FUNCTION(Runtime_DebugAsyncTaskEvent) {
DCHECK(args.length() == 1);
HandleScope scope(isolate);
« no previous file with comments | « src/runtime.h ('k') | test/mjsunit/es6/debug-promise-events.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698