Reviewers: Søren Gjesse,

Description:
Ensure v8 is initialized before initializing debug context

Please review this at http://codereview.chromium.org/1756018/show

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/api.cc
  M     test/cctest/test-debug.cc


Index: test/cctest/test-debug.cc
===================================================================
--- test/cctest/test-debug.cc   (revision 4528)
+++ test/cctest/test-debug.cc   (working copy)
@@ -6147,3 +6147,12 @@
 }


+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);
+  // Make sure debugger is unloaded before running other tests.
+  v8::internal::ForceUnloadDebugger();
+  CheckDebuggerUnloaded();
+}
Index: src/api.cc
===================================================================
--- src/api.cc  (revision 4525)
+++ src/api.cc  (working copy)
@@ -4020,6 +4020,7 @@
 }

 Local<Context> Debug::GetDebugContext() {
+  EnsureInitialized("v8::Debug::GetDebugContext()");
   ENTER_V8;
   return Utils::ToLocal(i::Debugger::GetDebugContext());
 }


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to