mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
JSIExecutor Bundle Splitting Support
Reviewed By: mhorowitz Differential Revision: D6847638 fbshipit-source-id: d9ae3d182d6f07bcac81cfd06dcc19f8139bb1e4
This commit is contained in:
committed by
Facebook Github Bot
parent
854c2330eb
commit
1a1a956831
@@ -689,11 +689,14 @@ namespace facebook {
|
||||
return JSC_JSValueMakeUndefined(m_context);
|
||||
}
|
||||
|
||||
JSValueRef JSCExecutor::nativeRequire(
|
||||
size_t argumentCount,
|
||||
const JSValueRef arguments[]) {
|
||||
uint32_t bundleId, moduleId;
|
||||
std::tie(bundleId, moduleId) = parseNativeRequireParameters(m_context, arguments, argumentCount);
|
||||
JSValueRef JSCExecutor::nativeRequire(size_t count, const JSValueRef arguments[]) {
|
||||
if (count > 2 || count == 0) {
|
||||
throw std::invalid_argument("Got wrong number of args");
|
||||
}
|
||||
|
||||
uint32_t moduleId = folly::to<uint32_t>(Value(m_context, arguments[0]).getNumberOrThrow());
|
||||
uint32_t bundleId = count == 2 ? folly::to<uint32_t>(Value(m_context, arguments[1]).getNumberOrThrow()) : 0;
|
||||
|
||||
ReactMarker::logMarker(ReactMarker::NATIVE_REQUIRE_START);
|
||||
loadModule(bundleId, moduleId);
|
||||
ReactMarker::logMarker(ReactMarker::NATIVE_REQUIRE_STOP);
|
||||
|
||||
Reference in New Issue
Block a user