mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
63e58a375e
Summary: **Context** For method calls from JS to Objective C, we have to convert JS values to ObjC objects/primitives. Before we can call our ObjC methods, we need to run both the ObjC primitives and objects through `RCTConvert`. This is necessary, because we sometimes convert `NSDictionary`s to special Objective C objects. Apparently, in `RCTTiming`, we also do the same with `double` (i.e: we convert a `double` arg to another `double` type with different meaning). **Problem** `RCTTiming` used `RCTConvert` to convert `double`s into `NSTimeInterval` (also a double). The conversion is defined like this: ``` // i.e: division by 1000 RCT_CUSTOM_CONVERTER(NSTimeInterval, NSTimeInterval, [self double:json] / 1000.0) ``` This diff implements the support necessary to make this work. For completeness, I also implemented the same functionality for `BOOL`s. Changelog: [iOS][Fixed] Improve method argument RCTConvert logic Reviewed By: mdvacca Differential Revision: D17887915 fbshipit-source-id: 3246fdbf4db7e96911f16460d92448b1f1e99444