addons: allow multiple requires of the same addon
Replace the global state tracking a single pending addon that is to be
loaded with a map from addon name to node_module*
. This allows
multiple, independent node::Environment
s to load the same addon.
Add a test to validate this new behavior by clearing the require cache and reloading the addon.
NOTE: This will break any user that is not following the documentation
and requiring an addon via a different name than that passed as the
first argument to NODE_MODULE(...)
.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines