process: store argv in Environment

This gets rid of Environment::ExecutionMode as well now that
we use the original arguments to determine execution mode.

PR-URL: https://github.com/nodejs/node/pull/26945
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
Joyee Cheung committed 2019-04-04 05:14:52 +08:00
1 parent 10eaf6a09f
commit d005f382cd
6 files changed
+19 -41

No files matched your search

+2 -2
View File
@@ -96,6 +96,7 @@ Worker::Worker(Environment* env,
env->inspector_agent()->GetParentHandle(thread_id_, url);
#endif
argv_ = std::vector<std::string>{env->argv()[0]};
// Mark this Worker object as weak until we actually start the thread.
MakeWeak();
@@ -260,8 +261,7 @@ void Worker::Run() {
env_->set_worker_context(this);
env_->InitializeLibuv(profiler_idle_notifier_started_);
env_->ProcessCliArgs(std::vector<std::string>{},
std::move(exec_argv_));
env_->ProcessCliArgs(std::move(argv_), std::move(exec_argv_));
}
{
Mutex::ScopedLock lock(mutex_);