summaryrefslogtreecommitdiff
path: root/src/env.h
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-03-20 07:55:59 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2019-04-04 05:14:52 +0800
commitd005f382cdcec7dff1d61cf5ab3604e55f004471 (patch)
tree1bd90722e3a03aadfe6722d2e486185ead6eef9e /src/env.h
parent10eaf6a09feee78275d5c1f84ce46815d8a8772f (diff)
downloadandroid-node-v8-d005f382cdcec7dff1d61cf5ab3604e55f004471.tar.gz
android-node-v8-d005f382cdcec7dff1d61cf5ab3604e55f004471.tar.bz2
android-node-v8-d005f382cdcec7dff1d61cf5ab3604e55f004471.zip
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>
Diffstat (limited to 'src/env.h')
-rw-r--r--src/env.h20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/env.h b/src/env.h
index f22d57171d..92b45ff563 100644
--- a/src/env.h
+++ b/src/env.h
@@ -761,6 +761,7 @@ class Environment {
const std::vector<std::string>& args,
const std::vector<std::string>& exec_args);
inline const std::vector<std::string>& exec_argv();
+ inline const std::vector<std::string>& argv();
typedef void (*HandleCleanupCb)(Environment* env,
uv_handle_t* handle,
@@ -1057,23 +1058,6 @@ class Environment {
inline std::shared_ptr<EnvironmentOptions> options();
inline std::shared_ptr<HostPort> inspector_host_port();
- enum class ExecutionMode {
- kDefault,
- kInspect, // node inspect
- kDebug, // node debug
- kPrintHelp, // node --help
- kPrintBashCompletion, // node --completion-bash
- kProfProcess, // node --prof-process
- kEvalString, // node --eval without --interactive
- kCheckSyntax, // node --check (incompatible with --eval)
- kRepl,
- kEvalStdin,
- kRunMainModule
- };
-
- inline ExecutionMode execution_mode() { return execution_mode_; }
-
- inline void set_execution_mode(ExecutionMode mode) { execution_mode_ = mode; }
inline AsyncRequest* thread_stopper() { return &thread_stopper_; }
private:
@@ -1085,7 +1069,6 @@ class Environment {
inline void ThrowError(v8::Local<v8::Value> (*fun)(v8::Local<v8::String>),
const char* errmsg);
- ExecutionMode execution_mode_ = ExecutionMode::kDefault;
std::list<binding::DLib> loaded_addons_;
v8::Isolate* const isolate_;
IsolateData* const isolate_data_;
@@ -1117,6 +1100,7 @@ class Environment {
// used.
std::shared_ptr<HostPort> inspector_host_port_;
std::vector<std::string> exec_argv_;
+ std::vector<std::string> argv_;
uint32_t module_id_counter_ = 0;
uint32_t script_id_counter_ = 0;