Allow Cxx references to be used in native module's method signature
Reviewed By: javache Differential Revision: D5772182 fbshipit-source-id: 21e2f7b8d14ffdcfc0ba969c9a35315863a19b71
This commit is contained in:
parent
1f2ca244d7
commit
bd723745c1
|
@ -90,11 +90,12 @@ extern SEL RCTParseMethodSignature(const char *methodSignature, NSArray **argTyp
|
|||
- (void)testNamespacedCxxStruct
|
||||
{
|
||||
NSArray *arguments;
|
||||
const char *methodSignature = "foo:(foo::type &)foo";
|
||||
const char *methodSignature = "foo:(foo::type &)foo bar:(bar::type &)bar";
|
||||
SEL selector = RCTParseMethodSignature(methodSignature, &arguments);
|
||||
XCTAssertEqualObjects(NSStringFromSelector(selector), @"foo:");
|
||||
XCTAssertEqual(arguments.count, (NSUInteger)1);
|
||||
XCTAssertEqualObjects(NSStringFromSelector(selector), @"foo:bar:");
|
||||
XCTAssertEqual(arguments.count, (NSUInteger)2);
|
||||
XCTAssertEqualObjects(((RCTMethodArgument *)arguments[0]).type, @"foo::type");
|
||||
XCTAssertEqualObjects(((RCTMethodArgument *)arguments[1]).type, @"bar::type");
|
||||
}
|
||||
|
||||
- (void)testAttributes
|
||||
|
|
|
@ -136,7 +136,9 @@ NSString *RCTParseType(const char **input)
|
|||
RCTReadChar(input, '>');
|
||||
}
|
||||
RCTSkipWhitespace(input);
|
||||
RCTReadChar(input, '*');
|
||||
if (!RCTReadChar(input, '*')) {
|
||||
RCTReadChar(input, '&');
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue