diff --git a/atom/browser/node_debugger.cc b/atom/browser/node_debugger.cc index 0a7bece6b4..2f17d46801 100644 --- a/atom/browser/node_debugger.cc +++ b/atom/browser/node_debugger.cc @@ -7,6 +7,7 @@ #include "base/command_line.h" #include "base/strings/utf_string_conversions.h" #include "libplatform/libplatform.h" +#include "native_mate/dictionary.h" namespace atom { @@ -35,6 +36,13 @@ void NodeDebugger::Start() { // with node's inspector agent platform_.reset(v8::platform::CreateDefaultPlatform()); + // Set process._debugWaitConnect if --inspect-brk was specified to stop + // the debugger on the first line + if (options.wait_for_connect()) { + mate::Dictionary process(env_->isolate(), env_->process_object()); + process.Set("_debugWaitConnect", true); + } + inspector->Start(platform_.get(), nullptr, options); } } diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index ae757b1da8..2a7be57627 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -198,12 +198,6 @@ node::Environment* NodeBindings::CreateEnvironment( PathService::Get(content::CHILD_PROCESS_EXE, &helper_exec_path); process.Set("helperExecPath", helper_exec_path); - // Set process._debugWaitConnect if --debug-brk was specified to stop - // the debugger on the first line - if (browser_env_ == BROWSER && - base::CommandLine::ForCurrentProcess()->HasSwitch("debug-brk")) - process.Set("_debugWaitConnect", true); - return env; }