diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2020-04-19 22:51:05 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2020-05-06 07:44:04 +0300 |
commit | 86fdaa745572a3bec4370ac7bd05d18e6bf64c01 (patch) | |
tree | 45890dbc713ad29edd830fd2aa17f592909ccbb7 /src/node.cc | |
parent | f446b2058dcfaf9d4e2f6bdfe555bc4437f41acf (diff) |
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.cc')
-rw-r--r-- | src/node.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/node.cc b/src/node.cc index 649ac43fbe7..240f1f2e3b0 100644 --- a/src/node.cc +++ b/src/node.cc @@ -331,8 +331,7 @@ MaybeLocal<Value> Environment::BootstrapNode() { Local<String> env_string = FIXED_ONE_BYTE_STRING(isolate_, "env"); Local<Object> env_var_proxy; - if (!CreateEnvVarProxy(context(), isolate_, current_callback_data()) - .ToLocal(&env_var_proxy) || + if (!CreateEnvVarProxy(context(), isolate_).ToLocal(&env_var_proxy) || process_object()->Set(context(), env_string, env_var_proxy).IsNothing()) { return MaybeLocal<Value>(); } |