| Index: src/inspector/v8-debugger.cc
|
| diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc
|
| index 1509993a8261dc4a2fb6610ebc8a936e5a73805f..458cd47ea66c3fc6307cfb2292581de71cf0a620 100644
|
| --- a/src/inspector/v8-debugger.cc
|
| +++ b/src/inspector/v8-debugger.cc
|
| @@ -44,6 +44,7 @@ v8::MaybeLocal<v8::Value> V8Debugger::callDebuggerMethod(
|
| debuggerScript
|
| ->Get(context, toV8StringInternalized(m_isolate, functionName))
|
| .ToLocalChecked());
|
| + v8::TryCatch try_catch;
|
| return function->Call(context, debuggerScript, argc, argv);
|
| }
|
|
|
| @@ -437,16 +438,16 @@ JavaScriptCallFrames V8Debugger::currentCallFrames(int limit) {
|
| ->Get(debuggerContext(),
|
| toV8StringInternalized(m_isolate, "currentCallFrames"))
|
| .ToLocalChecked());
|
| - currentCallFramesV8 =
|
| - v8::DebugInterface::Call(debuggerContext(), currentCallFramesFunction,
|
| - v8::Integer::New(m_isolate, limit))
|
| - .ToLocalChecked();
|
| + if (!v8::DebugInterface::Call(debuggerContext(), currentCallFramesFunction,
|
| + v8::Integer::New(m_isolate, limit))
|
| + .ToLocal(¤tCallFramesV8))
|
| + return JavaScriptCallFrames();
|
| } else {
|
| v8::Local<v8::Value> argv[] = {m_executionState,
|
| v8::Integer::New(m_isolate, limit)};
|
| - currentCallFramesV8 =
|
| - callDebuggerMethod("currentCallFrames", arraysize(argv), argv)
|
| - .ToLocalChecked();
|
| + if (!callDebuggerMethod("currentCallFrames", arraysize(argv), argv)
|
| + .ToLocal(¤tCallFramesV8))
|
| + return JavaScriptCallFrames();
|
| }
|
| DCHECK(!currentCallFramesV8.IsEmpty());
|
| if (!currentCallFramesV8->IsArray()) return JavaScriptCallFrames();
|
| @@ -617,8 +618,10 @@ void V8Debugger::handleV8DebugEvent(
|
| isUncaught);
|
| } else if (event == v8::Break) {
|
| v8::Local<v8::Value> argv[] = {eventDetails.GetEventData()};
|
| - v8::Local<v8::Value> hitBreakpoints =
|
| - callDebuggerMethod("getBreakpointNumbers", 1, argv).ToLocalChecked();
|
| + v8::Local<v8::Value> hitBreakpoints;
|
| + if (!callDebuggerMethod("getBreakpointNumbers", 1, argv)
|
| + .ToLocal(&hitBreakpoints))
|
| + return;
|
| DCHECK(hitBreakpoints->IsArray());
|
| handleProgramBreak(eventContext, eventDetails.GetExecutionState(),
|
| v8::Local<v8::Value>(), hitBreakpoints.As<v8::Array>());
|
| @@ -779,9 +782,11 @@ v8::Local<v8::Value> V8Debugger::collectionEntries(
|
| return v8::Undefined(m_isolate);
|
| }
|
| v8::Local<v8::Value> argv[] = {object};
|
| - v8::Local<v8::Value> entriesValue =
|
| - callDebuggerMethod("getCollectionEntries", 1, argv).ToLocalChecked();
|
| - if (!entriesValue->IsArray()) return v8::Undefined(m_isolate);
|
| + v8::Local<v8::Value> entriesValue;
|
| + if (!callDebuggerMethod("getCollectionEntries", 1, argv)
|
| + .ToLocal(&entriesValue) ||
|
| + !entriesValue->IsArray())
|
| + return v8::Undefined(m_isolate);
|
|
|
| v8::Local<v8::Array> entries = entriesValue.As<v8::Array>();
|
| v8::Local<v8::Array> copiedArray =
|
| @@ -814,11 +819,11 @@ v8::Local<v8::Value> V8Debugger::generatorObjectLocation(
|
| return v8::Null(m_isolate);
|
| }
|
| v8::Local<v8::Value> argv[] = {object};
|
| - v8::Local<v8::Value> location =
|
| - callDebuggerMethod("getGeneratorObjectLocation", 1, argv)
|
| - .ToLocalChecked();
|
| + v8::Local<v8::Value> location;
|
| v8::Local<v8::Value> copied;
|
| - if (!copyValueFromDebuggerContext(m_isolate, debuggerContext(), context,
|
| + if (!callDebuggerMethod("getGeneratorObjectLocation", 1, argv)
|
| + .ToLocal(&location) ||
|
| + !copyValueFromDebuggerContext(m_isolate, debuggerContext(), context,
|
| location)
|
| .ToLocal(&copied) ||
|
| !copied->IsObject())
|
|
|