mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
NSNumber arguments must now be nonnull
Summary: The bridge implementation on React Android does not currently support boxed numeric/boolean types (the equivalent of NSNumber arguments on iOS), nor does Java support Objective-C's nil messaging system that transparently casts nil to zero, false, etc for primitive types. To avoid platform incompatibilities, we now treat all primitive arguments as non-nullable rather than silently converting NSNull -> nil -> 0/false. We also now enforce that NSNumber * objects must be explicitly marked as `nonnull` (this restriction may be lifted in future if/when Android supports boxed numbers). Other object types are still assumed to be nullable unless specifically annotated with `nonnull`.
This commit is contained in:
@@ -26,6 +26,7 @@ typedef NS_ENUM(NSUInteger, RCTNullability) {
|
||||
|
||||
@property (nonatomic, copy, readonly) NSString *type;
|
||||
@property (nonatomic, readonly) RCTNullability nullability;
|
||||
@property (nonatomic, readonly) BOOL unused;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user