]> khamidou — GitHub mirrors - electron.git/commitdiff
Parse the debug args of Node
authorCheng Zhao <zcbenz@gmail.com>
Mon, 20 Apr 2015 07:12:46 +0000 (15:12 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 20 Apr 2015 07:12:46 +0000 (15:12 +0800)
atom/common/node_bindings.cc
vendor/node

index 4a0292e2b51d367fbe5fb49131eaab90a65bb6b6..10ab8f4929a411e284a0a5e85e1c5823beabe39e 100644 (file)
@@ -128,6 +128,11 @@ void NodeBindings::Initialize() {
   node::g_standalone_mode = is_browser_;
   node::g_upstream_node_mode = false;
 
+  // Parse the debug args.
+  auto args = AtomCommandLine::argv();
+  for (const std::string& arg : args)
+    node::ParseDebugOpt(arg.c_str());
+
   // Init node.
   // (we assume node::Init would not modify the parameters under embedded mode).
   node::Init(nullptr, nullptr, nullptr, nullptr);
@@ -165,6 +170,7 @@ node::Environment* NodeBindings::CreateEnvironment(
 }
 
 void NodeBindings::LoadEnvironment(node::Environment* env) {
+  node::node_isolate = env->isolate();
   if (node::use_debug_agent)
     node::StartDebug(env, node::debug_wait_connect);
 
index a17c44028101d80605556f047a844b3e7ab95677..a7e75da3cae48cf6e55fa7c9f13d689f11021795 160000 (submodule)
@@ -1 +1 @@
-Subproject commit a17c44028101d80605556f047a844b3e7ab95677
+Subproject commit a7e75da3cae48cf6e55fa7c9f13d689f11021795