}
Local<Context> Debug::GetDebugContext() {
- i::EnterDebugger debugger;
- return Utils::ToLocal(i::Debug::debug_context());
+ ENTER_V8;
+ return Utils::ToLocal(i::Debugger::GetDebugContext());
}
#endif // ENABLE_DEBUGGER_SUPPORT
}
+Handle<Context> Debugger::GetDebugContext() {
+ never_unload_debugger_ = true;
+ EnterDebugger debugger;
+ return Debug::debug_context();
+}
+
+
void Debugger::UnloadDebugger() {
// Make sure that there are no breakpoints left.
Debug::ClearAllBreakPoints();
static void CallMessageDispatchHandler();
+ static Handle<Context> GetDebugContext();
+
// Unload the debugger if possible. Only called when no debugger is currently
// active.
static void UnloadDebugger();
debugger_context = v8::Handle<v8::Context>();
CheckDebuggerUnloaded();
}
+
+
+TEST(DebugContextIsPreservedBetweenAccesses) {
+ v8::HandleScope scope;
+ v8::Local<v8::Context> context1 = v8::Debug::GetDebugContext();
+ v8::Local<v8::Context> context2 = v8::Debug::GetDebugContext();
+ CHECK_EQ(*context1, *context2);
+}
+