mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fabric: Fixes TurboModule method parameter Int32 type not work (#49710)
Summary: Fixes https://github.com/facebook/react-native/issues/49688 . ## Changelog: [IOS] [FIXED] - Fabric: Fixes TurboModule method parameter Int32 type not work Pull Request resolved: https://github.com/facebook/react-native/pull/49710 Test Plan: Repro please see https://github.com/facebook/react-native/issues/49688. Reviewed By: cortinico Differential Revision: D70314804 Pulled By: cipolleschi fbshipit-source-id: 4f305b14bb735bd343ef7477b969df237418615d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
63dea206ff
commit
fa6d5ca572
+4
-1
@@ -592,12 +592,15 @@ void ObjCTurboModule::setInvocationArg(
|
||||
double v = arg.getNumber();
|
||||
|
||||
/**
|
||||
* JS type checking ensures the Objective C argument here is either a double or NSNumber*.
|
||||
* JS type checking ensures the Objective C argument here is either a double or NSNumber* or NSInteger.
|
||||
*/
|
||||
if (objCArgType == @encode(id)) {
|
||||
id objCArg = [NSNumber numberWithDouble:v];
|
||||
[inv setArgument:(void *)&objCArg atIndex:i + 2];
|
||||
[retainedObjectsForInvocation addObject:objCArg];
|
||||
} else if (objCArgType == @encode(NSInteger)) {
|
||||
NSInteger integer = v;
|
||||
[inv setArgument:&integer atIndex:i + 2];
|
||||
} else {
|
||||
[inv setArgument:(void *)&v atIndex:i + 2];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user