@@ -34,21 +34,16 @@ jsi::Value NativeNitroModules::get(jsi::Runtime& runtime, const jsi::PropNameID&
34
34
}
35
35
if (name == " createHybridObject" ) {
36
36
return jsi::Function::createFromHostFunction (
37
- runtime, jsi::PropNameID::forUtf8 (runtime, " createHybridObject" ), 2 ,
37
+ runtime, jsi::PropNameID::forUtf8 (runtime, " createHybridObject" ), 1 ,
38
38
[this ](jsi::Runtime& runtime, const jsi::Value& thisArg, const jsi::Value* args, size_t count) -> jsi::Value {
39
39
#ifdef NITRO_DEBUG
40
- if (count != 1 && count != 2 ) [[unlikely]] {
41
- throw jsi::JSError (runtime, " NitroModules.createHybridObject(..) expects 1 or 2 arguments , but " + std::to_string (count) +
40
+ if (count != 1 ) [[unlikely]] {
41
+ throw jsi::JSError (runtime, " NitroModules.createHybridObject(..) expects 1 argument , but " + std::to_string (count) +
42
42
" were supplied!" );
43
43
}
44
44
#endif
45
45
jsi::String objectName = args[0 ].asString (runtime);
46
- std::optional<jsi::Object> optionalArgs = std::nullopt;
47
- if (count > 1 ) {
48
- optionalArgs = args[1 ].asObject (runtime);
49
- }
50
-
51
- return createHybridObject (runtime, objectName, optionalArgs);
46
+ return createHybridObject (runtime, objectName);
52
47
});
53
48
}
54
49
if (name == " hasHybridObject" ) {
@@ -129,11 +124,9 @@ void NativeNitroModules::install(jsi::Runtime& runtime) {
129
124
Dispatcher::installRuntimeGlobalDispatcher (runtime, dispatcher);
130
125
}
131
126
132
- jsi::Value NativeNitroModules::createHybridObject (jsi::Runtime& runtime, const jsi::String& hybridObjectName,
133
- const std::optional<jsi::Object>&) {
127
+ jsi::Value NativeNitroModules::createHybridObject (jsi::Runtime& runtime, const jsi::String& hybridObjectName) {
134
128
auto name = hybridObjectName.utf8 (runtime);
135
- // TODO: Pass args? Do we need that?
136
- auto hybridObject = HybridObjectRegistry::createHybridObject (name.c_str ());
129
+ auto hybridObject = HybridObjectRegistry::createHybridObject (name);
137
130
return hybridObject->toObject (runtime);
138
131
}
139
132
0 commit comments