mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-02 09:21:44 +08:00
Pass expanded folly::dynamic as argument to sync nativeHook
Reviewed By: mhorowitz Differential Revision: D4409865 fbshipit-source-id: f99e02e36bf691fa5b4a5affce1fa4fd4cf321a6
This commit is contained in:
committed by
Facebook Github Bot
parent
2a638c2ee7
commit
919e49a8b8
@@ -163,20 +163,7 @@ MethodCallResult CxxNativeModule::callSerializableNativeHook(
|
||||
" is asynchronous but invoked synchronously"));
|
||||
}
|
||||
|
||||
if (!args.isString()) {
|
||||
throw std::invalid_argument(
|
||||
folly::to<std::string>("method parameters should be string, but are ", args.typeName()));
|
||||
}
|
||||
|
||||
folly::dynamic params = folly::parseJson(args.stringPiece());
|
||||
|
||||
if (!params.isArray()) {
|
||||
throw std::invalid_argument(
|
||||
folly::to<std::string>("parsed method parameters should be array, but are ",
|
||||
args.typeName()));
|
||||
}
|
||||
|
||||
return { method.syncFunc(std::move(params)), false };
|
||||
return { method.syncFunc(std::move(args)), false };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user