mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove callFunctionSync experimental APIs
Reviewed By: michalgr Differential Revision: D6124038 fbshipit-source-id: 219afe30783da92cf10f800dc35e64823b61cf4b
This commit is contained in:
committed by
Facebook Github Bot
parent
860fcd458a
commit
19a4a7d3cb
@@ -581,30 +581,6 @@ namespace facebook {
|
||||
callNativeModules(std::move(result));
|
||||
}
|
||||
|
||||
Value JSCExecutor::callFunctionSyncWithValue(
|
||||
const std::string& module, const std::string& method, Value args) {
|
||||
SystraceSection s("JSCExecutor::callFunction");
|
||||
Object result = [&] {
|
||||
JSContextLock lock(m_context);
|
||||
if (!m_callFunctionReturnResultAndFlushedQueueJS) {
|
||||
bindBridge();
|
||||
}
|
||||
return m_callFunctionReturnResultAndFlushedQueueJS->callAsFunction({
|
||||
Value(m_context, String::createExpectingAscii(m_context, module)),
|
||||
Value(m_context, String::createExpectingAscii(m_context, method)),
|
||||
std::move(args),
|
||||
}).asObject();
|
||||
}();
|
||||
|
||||
Value length = result.getProperty("length");
|
||||
|
||||
if (!length.isNumber() || length.asInteger() != 2) {
|
||||
std::runtime_error("Return value of a callFunction must be an array of size 2");
|
||||
}
|
||||
callNativeModules(result.getPropertyAtIndex(1));
|
||||
return result.getPropertyAtIndex(0);
|
||||
}
|
||||
|
||||
void JSCExecutor::setGlobalVariable(std::string propName, std::unique_ptr<const JSBigString> jsonValue) {
|
||||
try {
|
||||
SystraceSection s("JSCExecutor::setGlobalVariable", "propName", propName);
|
||||
|
||||
Reference in New Issue
Block a user