diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-05-14 03:01:09 +0300 |
---|---|---|
committer | ZYSzys <zyszys98@gmail.com> | 2019-05-18 06:08:47 +0300 |
commit | abe82110b78a54a504a104c2da97cbcc7e344e9f (patch) | |
tree | a8dea8b9f578981e68ebbdedb9db6c50715243ac /src/node_env_var.cc | |
parent | 2a24aa2bd4b5441218de0087402c83e4a076d560 (diff) |
process: mark process.env as side-effect-free
Read-only access to `process.env` does not have side effects.
Refs: https://github.com/nodejs/node/pull/27523
PR-URL: https://github.com/nodejs/node/pull/27684
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Diffstat (limited to 'src/node_env_var.cc')
-rw-r--r-- | src/node_env_var.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/node_env_var.cc b/src/node_env_var.cc index 4b398ce7cd8..717c675d9a7 100644 --- a/src/node_env_var.cc +++ b/src/node_env_var.cc @@ -28,6 +28,7 @@ using v8::Nothing; using v8::Object; using v8::ObjectTemplate; using v8::PropertyCallbackInfo; +using v8::PropertyHandlerFlags; using v8::String; using v8::Value; @@ -377,7 +378,8 @@ MaybeLocal<Object> CreateEnvVarProxy(Local<Context> context, EscapableHandleScope scope(isolate); Local<ObjectTemplate> env_proxy_template = ObjectTemplate::New(isolate); env_proxy_template->SetHandler(NamedPropertyHandlerConfiguration( - EnvGetter, EnvSetter, EnvQuery, EnvDeleter, EnvEnumerator, data)); + EnvGetter, EnvSetter, EnvQuery, EnvDeleter, EnvEnumerator, data, + PropertyHandlerFlags::kHasNoSideEffect)); return scope.EscapeMaybe(env_proxy_template->NewInstance(context)); } } // namespace node |