Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -732,13 +732,19 @@ TraceSection s(
}

NSMethodSignature *methodSignature = [module methodSignatureForSelector:selector];
if (count > methodSignature.numberOfArguments - 2) {
throw jsi::JSError(
runtime,
name_ + "." + methodName + " called with too many arguments, expected up to " +
std::to_string(methodSignature.numberOfArguments - 2) + ", got " + std::to_string(count));
}

NSInvocation *inv = [NSInvocation invocationWithMethodSignature:methodSignature];
[inv setSelector:selector];

for (size_t i = 0; i < count; i++) {
const jsi::Value &arg = args[i];
const std::string objCArgType = [methodSignature getArgumentTypeAtIndex:i + 2];

setInvocationArg(runtime, methodName, objCArgType, arg, i, inv, retainedObjectsForInvocation);
}

Expand Down