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

Unified Diff: src/runtime/runtime.cc

Issue 607913002: Report promise reject with no handler (behind a flag). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: more comments Created 6 years, 3 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/runtime.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime.cc
diff --git a/src/runtime/runtime.cc b/src/runtime/runtime.cc
index 379a38f746d7f5bcbb00bd06607f8d69cb1a3fef..d562da5947223f8e18f5ecb9f8c5d69c8fc88c11 100644
--- a/src/runtime/runtime.cc
+++ b/src/runtime/runtime.cc
@@ -5341,12 +5341,19 @@ RUNTIME_FUNCTION(Runtime_DebugPromiseEvent) {
}
-RUNTIME_FUNCTION(Runtime_DebugPromiseRejectEvent) {
+RUNTIME_FUNCTION(Runtime_PromiseRejectEvent) {
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);
+ // Check whether the promise has been marked as having triggered a message.
+ Handle<Symbol> key = isolate->factory()->promise_debug_symbol();
+ Maybe<bool> marked = JSObject::HasOwnProperty(promise, key);
+ DCHECK(marked.has_value);
+ if (!marked.value) {
+ isolate->debug()->OnPromiseReject(promise, value);
+ isolate->ReportPromiseReject(promise, value, NULL);
+ }
return isolate->heap()->undefined_value();
}
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698