mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
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>
This commit is contained in:
12 files changed
+433
-331
No files matched your search
@@ -30,9 +30,9 @@ if (child.status !== 0) {
|
||||
}
|
||||
|
||||
// Verifies that:
|
||||
// - node::LoadCodeCache()
|
||||
// - NativeModuleEnv::InitializeCodeCache()
|
||||
// are defined in the generated code.
|
||||
// See src/node_native_module.h for explanations.
|
||||
// See src/node_native_module_env.h for explanations.
|
||||
|
||||
const rl = readline.createInterface({
|
||||
input: fs.createReadStream(dest),
|
||||
@@ -42,7 +42,7 @@ const rl = readline.createInterface({
|
||||
let hasCacheDef = false;
|
||||
|
||||
rl.on('line', common.mustCallAtLeast((line) => {
|
||||
if (line.includes('LoadCodeCache(')) {
|
||||
if (line.includes('InitializeCodeCache(')) {
|
||||
hasCacheDef = true;
|
||||
}
|
||||
}, 2));
|
||||
|
||||
Reference in new issue
Block a user