From bda7da34c6f8edabf45623acb21a410c76a33bff Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 20 May 2019 13:06:55 +0200 Subject: src: inline ProcessCliArgs in the Environment constructor Inline `ProcessCliArgs()` in the `Environment` constructor, and emit the `Environment` creation trace events with the arguments earlier. Remove the unused arguments passed to `CreateProcessObject()` since these are now attached to process in `PatchProcessObject()` during pre-execution instead. PR-URL: https://github.com/nodejs/node/pull/27539 Reviewed-By: Anna Henningsen --- src/node_worker.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/node_worker.cc') diff --git a/src/node_worker.cc b/src/node_worker.cc index e84b36f132..b4fd0028af 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -256,6 +256,8 @@ void Worker::Run() { // public API. env_.reset(new Environment(data.isolate_data_.get(), context, + std::move(argv_), + std::move(exec_argv_), Environment::kNoFlags, thread_id_)); CHECK_NOT_NULL(env_); @@ -264,7 +266,6 @@ void Worker::Run() { env_->set_worker_context(this); env_->InitializeLibuv(profiler_idle_notifier_started_); - env_->ProcessCliArgs(std::move(argv_), std::move(exec_argv_)); } { Mutex::ScopedLock lock(mutex_); -- cgit v1.2.3