src: rename private fields to follow naming convention · nodejs/node@86150f3
@@ -17,21 +17,21 @@ ProcessRunner::ProcessRunner(std::shared_ptr<InitializationResultImpl> result,
1717 std::string_view command,
1818 std::string_view path_env_var,
1919const PositionalArgs& positional_args)
20- : init_result(std::move(result)),
20+ : init_result_(std::move(result)),
2121package_json_path_(package_json_path),
2222 script_name_(script_name),
2323 path_env_var_(path_env_var) {
2424memset(&options_, 0, sizeof(uv_process_options_t));
25252626// Inherit stdin, stdout, and stderr from the parent process.
2727 options_.stdio_count = 3;
28-child_stdio[0].flags = UV_INHERIT_FD;
29-child_stdio[0].data.fd = 0;
30-child_stdio[1].flags = UV_INHERIT_FD;
31-child_stdio[1].data.fd = 1;
32-child_stdio[2].flags = UV_INHERIT_FD;
33-child_stdio[2].data.fd = 2;
34- options_.stdio = child_stdio;
28+child_stdio_[0].flags = UV_INHERIT_FD;
29+child_stdio_[0].data.fd = 0;
30+child_stdio_[1].flags = UV_INHERIT_FD;
31+child_stdio_[1].data.fd = 1;
32+child_stdio_[2].flags = UV_INHERIT_FD;
33+child_stdio_[2].data.fd = 2;
34+ options_.stdio = child_stdio_;
3535 options_.exit_cb = ExitCallback;
36363737#ifdef _WIN32
@@ -80,8 +80,8 @@ ProcessRunner::ProcessRunner(std::shared_ptr<InitializationResultImpl> result,
80808181auto argc = command_args_.size();
8282CHECK_GE(argc, 1);
83-arg = std::unique_ptr<char*[]>(new char*[argc + 1]);
84- options_.args = arg.get();
83+arg_ = std::unique_ptr<char*[]>(new char*[argc + 1]);
84+ options_.args = arg_.get();
8585for (size_t i = 0; i < argc; ++i) {
8686 options_.args[i] = const_cast<char*>(command_args_[i].c_str());
8787 }
@@ -125,8 +125,8 @@ void ProcessRunner::SetEnvironmentVariables() {
125125 env_vars_.push_back("NODE_RUN_PACKAGE_JSON_PATH=" +
126126 package_json_path_.string());
127127128-env = std::unique_ptr<char*[]>(new char*[env_vars_.size() + 1]);
129- options_.env = env.get();
128+env_ = std::unique_ptr<char*[]>(new char*[env_vars_.size() + 1]);
129+ options_.env = env_.get();
130130for (size_t i = 0; i < env_vars_.size(); i++) {
131131 options_.env[i] = const_cast<char*>(env_vars_[i].c_str());
132132 }
@@ -198,16 +198,16 @@ void ProcessRunner::ExitCallback(uv_process_t* handle,
198198199199void ProcessRunner::OnExit(int64_t exit_status, int term_signal) {
200200if (exit_status > 0) {
201-init_result->exit_code_ = ExitCode::kGenericUserError;
201+init_result_->exit_code_ = ExitCode::kGenericUserError;
202202 } else {
203-init_result->exit_code_ = ExitCode::kNoFailure;
203+init_result_->exit_code_ = ExitCode::kNoFailure;
204204 }
205205}
206206207207void ProcessRunner::Run() {
208208// keeps the string alive until destructor
209-cwd = package_json_path_.parent_path().string();
210- options_.cwd = cwd.c_str();
209+cwd_ = package_json_path_.parent_path().string();
210+ options_.cwd = cwd_.c_str();
211211if (int r = uv_spawn(loop_, &process_, &options_)) {
212212fprintf(stderr, "Error: %s\n", uv_strerror(r));
213213 }