diff --git a/src/node_options.cc b/src/node_options.cc index af160a7488f248..9238a2a65f04ba 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -604,19 +604,23 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { "Start the V8 heap profiler on start up, and write the heap profile " "to disk before exit. If --heap-prof-dir is not specified, write " "the profile to the current working directory.", - &EnvironmentOptions::heap_prof); + &EnvironmentOptions::heap_prof, + kAllowedInEnvvar); AddOption("--heap-prof-name", "specified file name of the V8 heap profile generated with " "--heap-prof", - &EnvironmentOptions::heap_prof_name); + &EnvironmentOptions::heap_prof_name, + kAllowedInEnvvar); AddOption("--heap-prof-dir", "Directory where the V8 heap profiles generated by --heap-prof " "will be placed.", - &EnvironmentOptions::heap_prof_dir); + &EnvironmentOptions::heap_prof_dir, + kAllowedInEnvvar); AddOption("--heap-prof-interval", "specified sampling interval in bytes for the V8 heap " "profile generated with --heap-prof. (default: 512 * 1024)", - &EnvironmentOptions::heap_prof_interval); + &EnvironmentOptions::heap_prof_interval, + kAllowedInEnvvar); #endif // HAVE_INSPECTOR AddOption("--max-http-header-size", "set the maximum size of HTTP headers (default: 16384 (16KB))", diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index 8d614e607177cd..2cbcf284bb23e8 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -22,6 +22,7 @@ expectNoWorker(`-r ${JSON.stringify(printSpaceA)}`, 'A\nB\n'); expectNoWorker(`-r ${printA} -r ${printA}`, 'A\nB\n'); expectNoWorker(` -r ${printA} -r ${printA}`, 'A\nB\n'); expectNoWorker(` --require ${printA} --require ${printA}`, 'A\nB\n'); +expect('--heap-prof', 'B\n'); expect('--no-deprecation', 'B\n'); expect('--no-warnings', 'B\n'); expect('--no_warnings', 'B\n');