Allow ModuleRegistry initialization to complete lazily

Reviewed By: mhorowitz

Differential Revision: D4794794

fbshipit-source-id: f3b7a5d02587b4cd4e214aa6b0368a0d214fb63f
This commit is contained in:
Pieter De Baets
2017-04-07 09:27:05 -07:00
committed by Facebook Github Bot
parent 568fb403bf
commit b2647ea335
6 changed files with 28 additions and 14 deletions

View File

@@ -45,10 +45,6 @@ folly::Optional<Object> JSCNativeModules::createModule(const std::string& name,
auto global = Object::getGlobalObject(context);
m_genNativeModuleJS = global.getProperty("__fbGenNativeModule").asObject();
m_genNativeModuleJS->makeProtected();
// Initialize the module name list, otherwise getModuleConfig won't work
// TODO (pieterdb): fix this in ModuleRegistry
m_moduleRegistry->moduleNames();
}
auto result = m_moduleRegistry->getConfig(name);