mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-10 17:33:36 +08:00
Move RCTConvertSelectorForType to their respective using modules
Reviewed By: javache Differential Revision: D6137419 fbshipit-source-id: a30193469e7a061331d3d6798324475890c75625
This commit is contained in:
committed by
Facebook Github Bot
parent
c0fea385d8
commit
bbc90b4dc2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user