You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
791 B
37 lines
791 B
9 years ago
|
/*
|
||
6 years ago
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
9 years ago
|
*
|
||
7 years ago
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
9 years ago
|
*/
|
||
|
|
||
|
#import <Foundation/Foundation.h>
|
||
|
|
||
8 years ago
|
@interface ConditionalA : NSObject {
|
||
9 years ago
|
int x;
|
||
|
}
|
||
|
|
||
|
- (NSString*)name;
|
||
|
|
||
|
@end
|
||
|
|
||
8 years ago
|
@implementation ConditionalA
|
||
9 years ago
|
|
||
|
- (NSString*)name {
|
||
|
return @"1";
|
||
|
}
|
||
|
|
||
8 years ago
|
void binaryConditionalNoNPE(ConditionalA* transfer) {
|
||
9 years ago
|
NSString* val = transfer.name ?: @"0";
|
||
|
NSMutableDictionary* extraBlock =
|
||
7 years ago
|
[[NSMutableDictionary alloc] initWithDictionary:@{@"key" : val}];
|
||
9 years ago
|
}
|
||
|
|
||
8 years ago
|
void conditionalNPE(ConditionalA* transfer) {
|
||
9 years ago
|
NSString* val = transfer.name ? transfer.name : @"0";
|
||
|
NSMutableDictionary* extraBlock =
|
||
7 years ago
|
[[NSMutableDictionary alloc] initWithDictionary:@{@"key" : val}];
|
||
9 years ago
|
}
|
||
|
|
||
|
@end
|