Skip to content

Commit

Permalink
Make __turboModuleProxy accept > 1 args
Browse files Browse the repository at this point in the history
Summary: For the JS TurboModule Codegen, we'll have to have `__turboModuleProxy` accept an additional argument: information containing what methods are supported on the TurboModule object. This diff makes calling `__turboModuleProxy` with two arguments valid.

Reviewed By: shergin

Differential Revision: D22743294

fbshipit-source-id: fd0050fc0373b43dc7089695c8e341137cad21f1
  • Loading branch information
RSNara authored and facebook-github-bot committed Jul 25, 2020
1 parent 7204a58 commit 650c0f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ReactCommon/turbomodule/core/TurboModuleBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ jsi::Value TurboModuleBinding::jsProxy(
const jsi::Value &thisVal,
const jsi::Value *args,
size_t count) {
if (count != 1) {
if (count < 1) {
throw std::invalid_argument(
"TurboModuleBinding::jsProxy arg count must be 1");
"__turboModuleProxy must be called with at least 1 argument");
}
std::string moduleName = args[0].getString(runtime).utf8(runtime);
std::shared_ptr<TurboModule> module = getModule(moduleName);
Expand Down

0 comments on commit 650c0f6

Please sign in to comment.