Skip to content

Commit

Permalink
fixup! process: split execution into main scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
joyeecheung committed Jan 29, 2019
1 parent 857d84f commit 455c923
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ MaybeLocal<Value> StartMainThreadExecution(Environment* env) {
return StartExecution(env, "internal/main/print_bash_completion");
}

if (per_process::cli_options->prof_process) {
if (env->options()->prof_process) {
env->set_execution_mode(Environment::ExecutionMode::kPrintBashCompletion);
return StartExecution(env, "internal/main/prof_process");
}
Expand Down
10 changes: 5 additions & 5 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
AddOption("--preserve-symlinks-main",
"preserve symbolic links when resolving the main module",
&EnvironmentOptions::preserve_symlinks_main);
AddOption("--prof-process",
"process V8 profiler output generated using --prof",
&EnvironmentOptions::prof_process);
// Options after --prof-process are passed through to the prof processor.
AddAlias("--prof-process", { "--prof-process", "--" });
AddOption("--redirect-warnings",
"write warnings to file instead of stderr",
&EnvironmentOptions::redirect_warnings,
Expand Down Expand Up @@ -382,11 +387,6 @@ PerProcessOptionsParser::PerProcessOptionsParser() {
AddOption("--v8-options",
"print V8 command line options",
&PerProcessOptions::print_v8_help);
AddOption("--prof-process",
"process V8 profiler output generated using --prof",
&PerProcessOptions::prof_process);
// Options after --prof-process are passed through to the prof processor.
AddAlias("--prof-process", {"--prof-process", "--"});

#ifdef NODE_HAVE_I18N_SUPPORT
AddOption("--icu-data-dir",
Expand Down
2 changes: 1 addition & 1 deletion src/node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class EnvironmentOptions : public Options {
bool pending_deprecation = false;
bool preserve_symlinks = false;
bool preserve_symlinks_main = false;
bool prof_process = false;
std::string redirect_warnings;
bool throw_deprecation = false;
bool trace_deprecation = false;
Expand Down Expand Up @@ -174,7 +175,6 @@ class PerProcessOptions : public Options {
bool print_help = false;
bool print_v8_help = false;
bool print_version = false;
bool prof_process = false;

#ifdef NODE_HAVE_I18N_SUPPORT
std::string icu_data_dir;
Expand Down
2 changes: 1 addition & 1 deletion src/node_process_object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ MaybeLocal<Object> CreateProcessObject(

// --prof-process
// TODO(addaleax): Remove this.
if (per_process::cli_options->prof_process) {
if (env->options()->prof_process) {
READONLY_PROPERTY(process, "profProcess", True(env->isolate()));
}

Expand Down

0 comments on commit 455c923

Please sign in to comment.