diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2020-04-20 03:51:05 +0800 |
---|---|---|
committer | Shelley Vohr <shelley.vohr@gmail.com> | 2020-05-07 08:24:55 -0700 |
commit | a292630baf0dc21fde11c9fd6a5eaf018e2b7eb5 (patch) | |
tree | 650d6a185133db583e73b972d28976332df5f6a2 /src/node_env_var.cc | |
parent | 07372e9d5b785793706728299f9a92e330e084e3 (diff) | |
download | node-new-a292630baf0dc21fde11c9fd6a5eaf018e2b7eb5.tar.gz |
src: retrieve binding data from the context
Instead of passing them through the data bound to function
templates, store references to them in a list embedded inside
the context.
This makes the function templates more context-independent,
and makes it possible to embed binding data in non-main contexts.
Co-authored-by: Anna Henningsen <anna@addaleax.net>
PR-URL: https://github.com/nodejs/node/pull/33139
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src/node_env_var.cc')
-rw-r--r-- | src/node_env_var.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/node_env_var.cc b/src/node_env_var.cc index 8eaf79538a..23eaad4858 100644 --- a/src/node_env_var.cc +++ b/src/node_env_var.cc @@ -377,13 +377,11 @@ static void EnvEnumerator(const PropertyCallbackInfo<Array>& info) { env->env_vars()->Enumerate(env->isolate())); } -MaybeLocal<Object> CreateEnvVarProxy(Local<Context> context, - Isolate* isolate, - Local<Object> data) { +MaybeLocal<Object> CreateEnvVarProxy(Local<Context> context, Isolate* isolate) { 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, Local<Value>(), PropertyHandlerFlags::kHasNoSideEffect)); return scope.EscapeMaybe(env_proxy_template->NewInstance(context)); } |