src: remove superfluous env_string string

It's only used once at startup in a single place so create the string
in place instead of caching it for the lifetime of the isolate.

PR-URL: https://github.com/nodejs/node/pull/9213
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Ben Noordhuis authored and Evan Lucas committed 2016-11-03 04:49:14 -05:00
1 parent c342bda49e
commit 08e12c7809
2 files changed
+1 -2

No files matched your search

-1
View File
@@ -93,7 +93,6 @@ namespace node {
V(encoding_string, "encoding") \
V(enter_string, "enter") \
V(env_pairs_string, "envPairs") \
V(env_string, "env") \
V(errno_string, "errno") \
V(error_string, "error") \
V(events_string, "_events") \
+1 -1
View File
@@ -3157,7 +3157,7 @@ void SetupProcessObject(Environment* env,
env->as_external());
Local<Object> process_env =
process_env_template->NewInstance(env->context()).ToLocalChecked();
process->Set(env->env_string(), process_env);
process->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "env"), process_env);
READONLY_PROPERTY(process, "pid", Integer::New(env->isolate(), getpid()));
READONLY_PROPERTY(process, "features", GetFeatures(env));