Index: src/inspector/java-script-call-frame.cc |
diff --git a/src/inspector/java-script-call-frame.cc b/src/inspector/java-script-call-frame.cc |
index 0d3f02c1ad6e89416623087197d84cbc900d52ea..f9d0585a8e43597b56fe3fb9bd990d6ed92de65c 100644 |
--- a/src/inspector/java-script-call-frame.cc |
+++ b/src/inspector/java-script-call-frame.cc |
@@ -91,7 +91,7 @@ bool JavaScriptCallFrame::isAtReturn() const { |
return result.As<v8::Boolean>()->BooleanValue(context).FromMaybe(false); |
} |
-v8::Local<v8::Object> JavaScriptCallFrame::details() const { |
+v8::MaybeLocal<v8::Object> JavaScriptCallFrame::details() const { |
v8::MicrotasksScope microtasks(m_isolate, |
v8::MicrotasksScope::kDoNotRunMicrotasks); |
v8::Local<v8::Context> context = |
@@ -101,8 +101,12 @@ v8::Local<v8::Object> JavaScriptCallFrame::details() const { |
v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast( |
callFrame->Get(context, toV8StringInternalized(m_isolate, "details")) |
.ToLocalChecked()); |
- return v8::Local<v8::Object>::Cast( |
- func->Call(context, callFrame, 0, nullptr).ToLocalChecked()); |
+ v8::TryCatch try_catch(m_isolate); |
+ v8::Local<v8::Value> details; |
+ if (func->Call(context, callFrame, 0, nullptr).ToLocal(&details)) { |
+ return v8::Local<v8::Object>::Cast(details); |
+ } |
+ return v8::MaybeLocal<v8::Object>(); |
} |
v8::MaybeLocal<v8::Value> JavaScriptCallFrame::evaluate( |
@@ -129,6 +133,7 @@ v8::MaybeLocal<v8::Value> JavaScriptCallFrame::restart() { |
v8::Local<v8::Function> restartFunction = v8::Local<v8::Function>::Cast( |
callFrame->Get(context, toV8StringInternalized(m_isolate, "restart")) |
.ToLocalChecked()); |
+ v8::TryCatch try_catch(m_isolate); |
v8::debug::SetLiveEditEnabled(m_isolate, true); |
v8::MaybeLocal<v8::Value> result = restartFunction->Call( |
m_debuggerContext.Get(m_isolate), callFrame, 0, nullptr); |
@@ -154,6 +159,7 @@ v8::MaybeLocal<v8::Value> JavaScriptCallFrame::setVariableValue( |
v8::Local<v8::Value> argv[] = { |
v8::Local<v8::Value>(v8::Integer::New(m_isolate, scopeNumber)), |
variableName, newValue}; |
+ v8::TryCatch try_catch(m_isolate); |
return setVariableValueFunction->Call(context, callFrame, arraysize(argv), |
argv); |
} |