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(); |
} |