diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2019-04-10 05:08:48 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2019-04-13 17:24:51 +0800 |
commit | dfd7e994258a36f3941c74295a8c037cb4850418 (patch) | |
tree | 03eaa022a99159912c97773a1b41952f3ee404b1 /src/api/environment.cc | |
parent | 9b6b567bc4dd8f40bad12528eebf12dac8a8027f (diff) | |
download | android-node-v8-dfd7e994258a36f3941c74295a8c037cb4850418.tar.gz android-node-v8-dfd7e994258a36f3941c74295a8c037cb4850418.tar.bz2 android-node-v8-dfd7e994258a36f3941c74295a8c037cb4850418.zip |
src: make a Environment-independent proxy class for NativeModuleLoader
This patch splits `NativeModuleLoader` into two parts - a singleton
that only relies on v8 and `node::Mutex` and a proxy class for
the singleton (`NativeModuleEnv`) that provides limited access to
the singleton as well as C++ bindings for the Node.js binary.
`NativeModuleLoader` is then no longer aware of `Environment`.
PR-URL: https://github.com/nodejs/node/pull/27160
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Diffstat (limited to 'src/api/environment.cc')
-rw-r--r-- | src/api/environment.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/environment.cc b/src/api/environment.cc index 62eca337e1..fb7d7003bb 100644 --- a/src/api/environment.cc +++ b/src/api/environment.cc @@ -3,7 +3,7 @@ #include "node_context_data.h" #include "node_errors.h" #include "node_internals.h" -#include "node_native_module.h" +#include "node_native_module_env.h" #include "node_platform.h" #include "node_process.h" #include "node_v8_platform-inl.h" @@ -351,7 +351,7 @@ Local<Context> NewContext(Isolate* isolate, }; Local<Value> arguments[] = {context->Global(), exports}; MaybeLocal<Function> maybe_fn = - per_process::native_module_loader.LookupAndCompile( + native_module::NativeModuleEnv::LookupAndCompile( context, *module, ¶meters, nullptr); if (maybe_fn.IsEmpty()) { return Local<Context>(); |