mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-01 22:41:28 +08:00
Add some more helper methods to Value
Reviewed By: mhorowitz Differential Revision: D4197278 fbshipit-source-id: 9a538ff2747d32a54d42627a9f78e4a348dce639
This commit is contained in:
committed by
Facebook Github Bot
parent
1604f10889
commit
674d86cdcb
@@ -20,7 +20,7 @@ JSValueRef JSCNativeModules::getModule(JSContextRef context, JSStringRef jsName)
|
||||
|
||||
auto module = createModule(moduleName, context);
|
||||
if (!module.hasValue()) {
|
||||
return JSValueMakeUndefined(context);
|
||||
return Value::makeUndefined(context);
|
||||
}
|
||||
|
||||
// Protect since we'll be holding on to this value, even though JS may not
|
||||
@@ -53,7 +53,7 @@ folly::Optional<Object> JSCNativeModules::createModule(const std::string& name,
|
||||
|
||||
Value moduleInfo = m_genNativeModuleJS->callAsFunction({
|
||||
Value::fromDynamic(context, result->config),
|
||||
JSValueMakeNumber(context, result->index)
|
||||
Value::makeNumber(context, result->index)
|
||||
});
|
||||
CHECK(!moduleInfo.isNull()) << "Module returned from genNativeModule is null";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user