mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
Fixed whitespace bug with RCTModuleMethod parsing
Summary: public White space between the end of the first part of the method selector and the first colon was being included in the JS method name. (See: https://github.com/facebook/react-native/issues/3804) Reviewed By: javache Differential Revision: D2605713 fb-gh-sync-id: b4402c9ede5eb31dd38021c902f046a4e0557814
This commit is contained in:
committed by
facebook-github-bot-6
parent
cb3a07306e
commit
6539b26810
@@ -130,6 +130,7 @@ void RCTParseObjCMethodName(NSString **objCMethodName, NSArray **arguments)
|
||||
if (colonRange.location != NSNotFound) {
|
||||
methodName = [methodName substringToIndex:colonRange.location];
|
||||
}
|
||||
methodName = [methodName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
|
||||
RCTAssert(methodName.length, @"%@ is not a valid JS function name, please"
|
||||
" supply an alternative using RCT_REMAP_METHOD()", objCMethodName);
|
||||
methodName;
|
||||
|
||||
Reference in New Issue
Block a user