[linters] Fix unavailable api check to take the avaiability attribute into account when it's not the first one in the list.

Reviewed By: martinoluca

Differential Revision: D5292444

fbshipit-source-id: 620a855
master
Dulma Churchill 8 years ago committed by Facebook Github Bot
parent 38676e43d7
commit 72802024b3

@ -20,12 +20,12 @@ let get_available_attr_ios_sdk an =
let rec get_available_attr attrs =
match attrs with
| [] -> None
| AvailabilityAttr attr_info :: _ ->
| AvailabilityAttr attr_info :: rest ->
(match attr_info.ai_parameters with
| "ios" :: version :: _ ->
Some (String.Search_pattern.replace_all
(String.Search_pattern.create "_") ~in_:version ~with_:".")
| _ -> None)
| _ -> get_available_attr rest)
| _ :: rest -> get_available_attr rest in
match an with
| Ctl_parser_types.Decl decl ->

@ -5,3 +5,4 @@ codetoanalyze/objc/ioslints/unavailable_api_allowed_cases.m, Unavailable_api_all
codetoanalyze/objc/ioslints/unavailable_api_allowed_cases.m, Unavailable_api_allowed_cases_without_responds_to_selector:, 64, UNAVAILABLE_API_IN_SUPPORTED_IOS_SDK, []
codetoanalyze/objc/ioslints/unavailable_api_in_supported_ios_sdk.m, OpenURLOptionsFromSourceApplication, 26, UNAVAILABLE_API_IN_SUPPORTED_IOS_SDK, []
codetoanalyze/objc/ioslints/unavailable_api_in_supported_ios_sdk.m, Unavailable_api_in_supported_ios_sdk_test:and:, 19, UNAVAILABLE_API_IN_SUPPORTED_IOS_SDK, []
codetoanalyze/objc/ioslints/unavailable_property_ios.m, FNFPlayerLayer_initWithConfigs:, 22, UNAVAILABLE_API_IN_SUPPORTED_IOS_SDK, []

@ -0,0 +1,26 @@
/*
* Copyright (c) 2017 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <AVFoundation/AVFoundation.h>
@interface FNFPlayerLayer : CAEAGLLayer
- (instancetype)initWithConfigs:(FNFPlayerLayer*)configs;
@end
@implementation FNFPlayerLayer {
BOOL my_field;
}
- (instancetype)initWithConfigs:(FNFPlayerLayer*)configs {
my_field = configs.presentsWithTransaction;
return self;
}
@end
Loading…
Cancel
Save