diff options
Diffstat (limited to 'deps/v8/src/inspector/v8-inspector-impl.cc')
-rw-r--r-- | deps/v8/src/inspector/v8-inspector-impl.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/deps/v8/src/inspector/v8-inspector-impl.cc b/deps/v8/src/inspector/v8-inspector-impl.cc index 6272e4b4b2f..62790a6335b 100644 --- a/deps/v8/src/inspector/v8-inspector-impl.cc +++ b/deps/v8/src/inspector/v8-inspector-impl.cc @@ -188,6 +188,17 @@ InspectedContext* V8InspectorImpl::getContext(int contextId) const { return getContext(contextGroupId(contextId), contextId); } +v8::MaybeLocal<v8::Context> V8InspectorImpl::contextById( + int groupId, v8::Maybe<int> contextId) { + if (contextId.IsNothing()) { + v8::Local<v8::Context> context = + client()->ensureDefaultContextInGroup(groupId); + return context.IsEmpty() ? v8::MaybeLocal<v8::Context>() : context; + } + InspectedContext* context = getContext(contextId.FromJust()); + return context ? context->context() : v8::MaybeLocal<v8::Context>(); +} + void V8InspectorImpl::contextCreated(const V8ContextInfo& info) { int contextId = ++m_lastContextId; InspectedContext* context = new InspectedContext(this, info, contextId); |