summaryrefslogtreecommitdiff
path: root/deps/v8/test/inspector/isolate-data.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/inspector/isolate-data.cc')
-rw-r--r--deps/v8/test/inspector/isolate-data.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/deps/v8/test/inspector/isolate-data.cc b/deps/v8/test/inspector/isolate-data.cc
index e698ac45dd..e26a955be6 100644
--- a/deps/v8/test/inspector/isolate-data.cc
+++ b/deps/v8/test/inspector/isolate-data.cc
@@ -339,10 +339,16 @@ void InspectorIsolateData::PromiseRejectHandler(v8::PromiseRejectMessage data) {
int exception_id = HandleMessage(
v8::Exception::CreateMessage(isolate, exception), exception);
if (exception_id) {
- promise
- ->SetPrivate(isolate->GetCurrentContext(), id_private,
- v8::Int32::New(isolate, exception_id))
- .ToChecked();
+ if (promise
+ ->SetPrivate(isolate->GetCurrentContext(), id_private,
+ v8::Int32::New(isolate, exception_id))
+ .IsNothing()) {
+ // Handling the |message| above calls back into JavaScript (by reporting
+ // it via CDP) in case of `inspector-test`, and can lead to terminating
+ // execution on the |isolate|, in which case the API call above will
+ // return immediately.
+ DCHECK(isolate->IsExecutionTerminating());
+ }
}
}