Move RCTConvertSelectorForType to their respective using modules

Reviewed By: javache

Differential Revision: D6137419

fbshipit-source-id: a30193469e7a061331d3d6798324475890c75625
This commit is contained in:
Aditya Kumar
2017-10-26 16:51:03 -07:00
committed by Facebook Github Bot
parent c0fea385d8
commit bbc90b4dc2
4 changed files with 22 additions and 13 deletions

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