mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Allow "nativeRequire" to accept "bundleId" and "moduleId" values
Differential Revision: D5850960 fbshipit-source-id: 4d7aa0ed7542181861649a2089d90c3cf98723e9
This commit is contained in:
committed by
Facebook Github Bot
parent
b9be9a01a9
commit
da2ea2601b
@@ -574,16 +574,7 @@ JSValueRef JSCExecutor::getNativeModule(JSObjectRef object, JSStringRef property
|
||||
JSValueRef JSCExecutor::nativeRequire(
|
||||
size_t argumentCount,
|
||||
const JSValueRef arguments[]) {
|
||||
if (argumentCount != 1) {
|
||||
throw std::invalid_argument("Got wrong number of args");
|
||||
}
|
||||
|
||||
double moduleId = Value(m_context, arguments[0]).asNumber();
|
||||
if (moduleId < 0) {
|
||||
throw std::invalid_argument(folly::to<std::string>("Received invalid module ID: ",
|
||||
Value(m_context, arguments[0]).toString().str()));
|
||||
}
|
||||
|
||||
uint32_t moduleId = parseNativeRequireParameters(m_context, arguments, argumentCount).second;
|
||||
ReactMarker::logMarker(ReactMarker::NATIVE_REQUIRE_START);
|
||||
loadModule(moduleId);
|
||||
ReactMarker::logMarker(ReactMarker::NATIVE_REQUIRE_STOP);
|
||||
|
||||
Reference in New Issue
Block a user