diff --git a/atom/browser/javascript_environment.cc b/atom/browser/javascript_environment.cc index 0f87a2ca32fd..3cdd2c771ee6 100644 --- a/atom/browser/javascript_environment.cc +++ b/atom/browser/javascript_environment.cc @@ -34,11 +34,6 @@ void JavascriptEnvironment::OnMessageLoopDestroying() { bool JavascriptEnvironment::Initialize() { auto cmd = base::CommandLine::ForCurrentProcess(); - if (cmd->HasSwitch("debug-brk")) { - // Need to be called before v8::Initialize(). - const char expose_debug_as[] = "--expose_debug_as=v8debug"; - v8::V8::SetFlagsFromString(expose_debug_as, sizeof(expose_debug_as) - 1); - } // --js-flags. std::string js_flags = cmd->GetSwitchValueASCII(switches::kJavaScriptFlags); diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index d1db83b70850..f8e2573e0a14 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -185,6 +185,13 @@ node::Environment* NodeBindings::CreateEnvironment( base::FilePath helper_exec_path; 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 (is_browser_ && + base::CommandLine::ForCurrentProcess()->HasSwitch("debug-brk")) + process.Set("_debugWaitConnect", true); + return env; }