mirror of
https://github.com/nodejs/node.git
synced 2026-12-06 10:48:45 -05:00
n-api: remove n-api module loading flag
Remove the command line flag that was needed for N-API module loading. Re: https://github.com/nodejs/vm/issues/9 PR-URL: https://github.com/nodejs/node/pull/14902 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Hitesh Kanwathirtha <digitalinfinity@gmail.com>
This commit is contained in:
1 parent
526e78f5cd
commit
cd3a8e8832
15 files changed
+86
-70
No files matched your search
+1
-19
@@ -841,28 +841,10 @@ void napi_module_register_cb(v8::Local<v8::Object> exports,
|
||||
|
||||
} // end of anonymous namespace
|
||||
|
||||
#ifndef EXTERNAL_NAPI
|
||||
namespace node {
|
||||
// Indicates whether NAPI was enabled/disabled via the node command-line.
|
||||
extern bool load_napi_modules;
|
||||
}
|
||||
#endif // EXTERNAL_NAPI
|
||||
|
||||
// Registers a NAPI module.
|
||||
void napi_module_register(napi_module* mod) {
|
||||
// NAPI modules always work with the current node version.
|
||||
int module_version = NODE_MODULE_VERSION;
|
||||
|
||||
#ifndef EXTERNAL_NAPI
|
||||
if (!node::load_napi_modules) {
|
||||
// NAPI is disabled, so set the module version to -1 to cause the module
|
||||
// to be unloaded.
|
||||
module_version = -1;
|
||||
}
|
||||
#endif // EXTERNAL_NAPI
|
||||
|
||||
node::node_module* nm = new node::node_module {
|
||||
module_version,
|
||||
-1,
|
||||
mod->nm_flags,
|
||||
nullptr,
|
||||
mod->nm_filename,
|
||||
|
||||
Reference in new issue
Block a user