Move RCTConvertSelectorForType to their respective using modules

Reviewed By: javache

Differential Revision: D6137419

fbshipit-source-id: a30193469e7a061331d3d6798324475890c75625
This commit is contained in:
Aditya Kumar authored and Facebook Github Bot committed 2017-10-26 17:03:41 -07:00
1 parent c0fea385d8
commit bbc90b4dc2
4 files changed
+22 -13

No files matched your search

+10 -1
View File
@@ -24,6 +24,15 @@
typedef BOOL (^RCTArgumentBlock)(RCTBridge *, NSUInteger, id);
/**
* Get the converter function for the specified type
*/
static SEL selectorForType(NSString *type)
{
const char *input = type.UTF8String;
return NSSelectorFromString([RCTParseType(&input) stringByAppendingString:@":"]);
}
@implementation RCTMethodArgument
- (instancetype)initWithType:(NSString *)type
@@ -257,7 +266,7 @@ RCT_EXTERN_C_END
BOOL isNullableType = NO;
RCTMethodArgument *argument = arguments[i - 2];
NSString *typeName = argument.type;
SEL selector = RCTConvertSelectorForType(typeName);
SEL selector = selectorForType(typeName);
if ([RCTConvert respondsToSelector:selector]) {
switch (objcType[0]) {
// Primitives