mirror of
https://github.com/nodejs/node.git
synced 2026-11-15 10:36:53 -05:00
module: return correct exports from linked binding
Method `LinkedBinding` must return the same "exports" property of the module as cached, because property can be overridden by an initialization function. PR-URL: https://github.com/nodejs/node/pull/5337 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
1 parent
91f6bc0bd6
commit
5c14efbbe9
1 file changed
+3
-2
+3
-2
@@ -2450,9 +2450,10 @@ static void LinkedBinding(const FunctionCallbackInfo<Value>& args) {
|
||||
return env->ThrowError("Linked module has no declared entry point.");
|
||||
}
|
||||
|
||||
cache->Set(module_name, module->Get(exports_prop));
|
||||
auto effective_exports = module->Get(exports_prop);
|
||||
cache->Set(module_name, effective_exports);
|
||||
|
||||
args.GetReturnValue().Set(exports);
|
||||
args.GetReturnValue().Set(effective_exports);
|
||||
}
|
||||
|
||||
static void ProcessTitleGetter(Local<String> property,
|
||||
|
||||
Reference in new issue
Block a user