Skip to content

Commit 75a3c78

Browse files
committed
Fix src for node v4
1 parent 9a0fca7 commit 75a3c78

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/debug.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,13 @@ namespace nodex {
9494
if (expression.IsEmpty())
9595
RETURN(Undefined());
9696

97-
Context::Scope context_scope(v8::Debug::GetDebugContext());
97+
Local<Context> debug_context = v8::Debug::GetDebugContext();
98+
if (debug_context.IsEmpty()) {
99+
// Force-load the debug context.
100+
v8::Debug::GetMirror(info.GetIsolate()->GetCurrentContext(), info[0]);
101+
debug_context = v8::Debug::GetDebugContext();
102+
}
103+
Context::Scope context_scope(debug_context);
98104

99105
TryCatch tryCatch;
100106
MaybeLocal<Value> result;

0 commit comments

Comments
 (0)