GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: fix NODE_OPTIONS parsing bug · nodejs/node@2c5dfef

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node.cc
  • test/parallel
    • test-cli-node-options.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2921,7 +2921,8 @@ void Init(std::vector<std::string>* argv,
29212921
index = node_options.find(' ', index + 1);
29222922
if (index - prev_index == 1) continue;
29232923

2924-
const std::string option = node_options.substr(prev_index + 1, index);
2924+
const std::string option = node_options.substr(
2925+
prev_index + 1, index - prev_index - 1);
29252926
if (!option.empty())
29262927
env_argv.emplace_back(std::move(option));
29272928
} while (index != std::string::npos);
Collapse file

‎test/parallel/test-cli-node-options.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-cli-node-options.js
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ const tmpdir = require('../common/tmpdir');
1414
tmpdir.refresh();
1515
process.chdir(tmpdir.path);
1616

17-
expect(`-r ${require.resolve('../fixtures/printA.js')}`, 'A\nB\n');
17+
const printA = require.resolve('../fixtures/printA.js');
18+
expect(`-r ${printA}`, 'A\nB\n');
19+
expect(`-r ${printA} -r ${printA}`, 'A\nB\n');
1820
expect('--no-deprecation', 'B\n');
1921
expect('--no-warnings', 'B\n');
2022
expect('--trace-warnings', 'B\n');
@@ -29,6 +31,9 @@ expect('--v8-pool-size=10', 'B\n');
2931
expect('--trace-event-categories node', 'B\n');
3032
// eslint-disable-next-line no-template-curly-in-string
3133
expect('--trace-event-file-pattern {pid}-${rotation}.trace_events', 'B\n');
34+
// eslint-disable-next-line no-template-curly-in-string
35+
expect('--trace-event-file-pattern {pid}-${rotation}.trace_events ' +
36+
'--trace-event-categories node.async_hooks', 'B\n');
3237

3338
if (!common.isWindows) {
3439
expect('--perf-basic-prof', 'B\n');

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.