fix: dont parse arguments after a -- in the inspector (#14333)
This commit is contained in:
parent
ff539c1d61
commit
97058837e7
2 changed files with 10 additions and 2 deletions
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include "atom/browser/node_debugger.h"
|
#include "atom/browser/node_debugger.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#include "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "libplatform/libplatform.h"
|
#include "libplatform/libplatform.h"
|
||||||
|
@ -25,10 +27,15 @@ void NodeDebugger::Start(node::MultiIsolatePlatform* platform) {
|
||||||
node::DebugOptions options;
|
node::DebugOptions options;
|
||||||
for (auto& arg : base::CommandLine::ForCurrentProcess()->argv()) {
|
for (auto& arg : base::CommandLine::ForCurrentProcess()->argv()) {
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
options.ParseOption("Electron", base::UTF16ToUTF8(arg));
|
const std::string nice_arg = base::UTF16ToUTF8(arg);
|
||||||
#else
|
#else
|
||||||
options.ParseOption("Electron", arg);
|
const std::string& nice_arg = arg;
|
||||||
#endif
|
#endif
|
||||||
|
// Stop handling arguments after a "--" to be consistent with Chromium
|
||||||
|
if (nice_arg == "--")
|
||||||
|
break;
|
||||||
|
|
||||||
|
options.ParseOption("Electron", nice_arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set process._debugWaitConnect if --inspect-brk was specified to stop
|
// Set process._debugWaitConnect if --inspect-brk was specified to stop
|
||||||
|
|
|
@ -211,6 +211,7 @@ void NodeBindings::Initialize() {
|
||||||
|
|
||||||
// Init node.
|
// Init node.
|
||||||
// (we assume node::Init would not modify the parameters under embedded mode).
|
// (we assume node::Init would not modify the parameters under embedded mode).
|
||||||
|
// NOTE: If you change this line, please ping @codebytere or @MarshallOfSound
|
||||||
node::Init(nullptr, nullptr, nullptr, nullptr);
|
node::Init(nullptr, nullptr, nullptr, nullptr);
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue