Allow ModuleRegistry initialization to complete lazily

Reviewed By: mhorowitz

Differential Revision: D4794794

fbshipit-source-id: f3b7a5d02587b4cd4e214aa6b0368a0d214fb63f
This commit is contained in:
Pieter De Baets authored and Facebook Github Bot committed 2017-04-07 09:30:33 -07:00
1 parent 568fb403bf
commit b2647ea335
6 files changed
+28 -14

No files matched your search

@@ -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);