JSIExecutor Bundle Splitting Support

Reviewed By: mhorowitz

Differential Revision: D6847638

fbshipit-source-id: d9ae3d182d6f07bcac81cfd06dcc19f8139bb1e4
This commit is contained in:
Alex Dvornikov
2018-02-09 03:45:37 -08:00
committed by Facebook Github Bot
parent 854c2330eb
commit 1a1a956831
3 changed files with 8 additions and 33 deletions
+8 -5
View File
@@ -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);