cxxreact/RAMBundleRegistry: prepend segment ID
Reviewed By: fromcelticpark Differential Revision: D7594348 fbshipit-source-id: 0b433de8722f8a952fd056139a350dc481f0af38
This commit is contained in:
parent
e4f88c66e3
commit
c9094e952b
|
@ -3,6 +3,7 @@
|
|||
#include "RAMBundleRegistry.h"
|
||||
|
||||
#include <folly/Memory.h>
|
||||
#include <folly/String.h>
|
||||
|
||||
#include <libgen.h>
|
||||
|
||||
|
@ -42,7 +43,14 @@ JSModulesUnbundle::Module RAMBundleRegistry::getModule(uint32_t bundleId, uint32
|
|||
m_bundles.emplace(bundleId, m_factory(bundlePath->second));
|
||||
}
|
||||
|
||||
return getBundle(bundleId)->getModule(moduleId);
|
||||
auto module = getBundle(bundleId)->getModule(moduleId);
|
||||
if (bundleId == MAIN_BUNDLE_ID) {
|
||||
return module;
|
||||
}
|
||||
return {
|
||||
folly::to<std::string>("seg-", bundleId, '_', std::move(module.name)),
|
||||
std::move(module.code),
|
||||
};
|
||||
}
|
||||
|
||||
JSModulesUnbundle *RAMBundleRegistry::getBundle(uint32_t bundleId) const {
|
||||
|
|
Loading…
Reference in New Issue