Skip to content

Commit a038179

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Add return value to JavaScript calls in UIManagerBinding
Summary: Changelog: [internal] Add support for a return value when calling JavaScript functions in UIManagerBinding. Reviewed By: mdvacca Differential Revision: D27470817 fbshipit-source-id: 38de92dd913af61d879f1cc5962d417f51da73b0
1 parent b50b7e3 commit a038179

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ReactCommon/react/renderer/uimanager/UIManagerBinding.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void UIManagerBinding::attach(std::shared_ptr<UIManager> const &uiManager) {
117117
}
118118
}
119119

120-
static void callMethodOfModule(
120+
static jsi::Value callMethodOfModule(
121121
jsi::Runtime &runtime,
122122
std::string const &moduleName,
123123
std::string const &methodName,
@@ -129,13 +129,15 @@ static void callMethodOfModule(
129129
react_native_assert(object.hasProperty(runtime, methodName.c_str()));
130130
if (object.hasProperty(runtime, methodName.c_str())) {
131131
auto method = object.getPropertyAsFunction(runtime, methodName.c_str());
132-
method.callWithThis(runtime, object, args);
132+
return method.callWithThis(runtime, object, args);
133133
} else {
134134
LOG(ERROR) << "getPropertyAsFunction: property '" << methodName
135135
<< "' is undefined, expected a Function";
136136
}
137137
}
138138
}
139+
140+
return jsi::Value::undefined();
139141
}
140142

141143
void UIManagerBinding::startSurface(

0 commit comments

Comments
 (0)