| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library analyze_api; | 5 library analyze_api; |
| 6 | 6 |
| 7 import '../../../sdk/lib/_internal/libraries.dart'; | 7 import '../../../sdk/lib/_internal/libraries.dart'; |
| 8 import 'analyze_helper.dart'; | 8 import 'analyze_helper.dart'; |
| 9 import "package:async_helper/async_helper.dart"; | 9 import "package:async_helper/async_helper.dart"; |
| 10 | 10 |
| 11 /** | 11 /** |
| 12 * Map of white-listed warnings and errors. | 12 * Map of white-listed warnings and errors. |
| 13 * | 13 * |
| 14 * Only add a white-listing together with a bug report to dartbug.com and add | 14 * Only add a white-listing together with a bug report to dartbug.com and add |
| 15 * the bug issue number as a comment on the white-listing. | 15 * the bug issue number as a comment on the white-listing. |
| 16 * | 16 * |
| 17 * Use an identifiable suffix of the file uri as key. Use a fixed substring of | 17 * Use an identifiable suffix of the file uri as key. Use a fixed substring of |
| 18 * the error/warning message in the list of white-listings for each file. | 18 * the error/warning message in the list of white-listings for each file. |
| 19 */ | 19 */ |
| 20 // TODO(johnniwinther): Support canonical URIs as keys and message kinds as | 20 // TODO(johnniwinther): Support canonical URIs as keys and message kinds as |
| 21 // values. | 21 // values. |
| 22 const Map<String, List<String>> WHITE_LIST = const { | 22 const Map<String, List<String>> WHITE_LIST = const { |
| 23 // The following notices go away when bugs 15417 and 15418 are fixed. | 23 // The following notices go away when bugs 15417 is fixed. |
| 24 "sdk/lib/_collection_dev/iterable.dart": const [ | |
| 25 "Info: This is the method declaration."], | |
| 26 | |
| 27 "sdk/lib/_internal/lib/interceptors.dart": const [ | |
| 28 "Info: This is the method declaration."], | |
| 29 | |
| 30 "sdk/lib/core/iterable.dart": const [ | |
| 31 "Info: This is the method declaration."], | |
| 32 | |
| 33 "sdk/lib/core/list.dart": const [ | |
| 34 "Info: This is the method declaration."], | |
| 35 | |
| 36 "sdk/lib/core/map.dart": const [ | 24 "sdk/lib/core/map.dart": const [ |
| 37 "Info: This is the method declaration."], | 25 "Info: This is the method declaration."], |
| 38 | 26 |
| 39 // Bug 15417. | 27 // Bug 15417. |
| 40 "sdk/lib/html/dart2js/html_dart2js.dart": const [""" | 28 "sdk/lib/html/dart2js/html_dart2js.dart": const [""" |
| 41 Warning: '_DataAttributeMap' doesn't implement 'addAll'. | 29 Warning: '_DataAttributeMap' doesn't implement 'addAll'. |
| 42 Try adding an implementation of 'addAll'.""", """ | 30 Try adding an implementation of 'addAll'.""", """ |
| 43 Warning: '_NamespacedAttributeMap' doesn't implement 'addAll'. | 31 Warning: '_NamespacedAttributeMap' doesn't implement 'addAll'. |
| 44 Try adding an implementation of 'addAll'.""", """ | 32 Try adding an implementation of 'addAll'.""", """ |
| 45 Warning: '_ElementAttributeMap' doesn't implement 'addAll'. | 33 Warning: '_ElementAttributeMap' doesn't implement 'addAll'. |
| 46 Try adding an implementation of 'addAll'.""", """ | 34 Try adding an implementation of 'addAll'.""", """ |
| 47 Warning: 'Window' doesn't implement 'clearInterval'. | 35 Warning: 'Window' doesn't implement 'clearInterval'. |
| 48 Try adding an implementation of 'clearInterval'.""", """ | 36 Try adding an implementation of 'clearInterval'.""", """ |
| 49 Warning: 'Window' doesn't implement 'clearTimeout'. | 37 Warning: 'Window' doesn't implement 'clearTimeout'. |
| 50 Try adding an implementation of 'clearTimeout'.""", """ | 38 Try adding an implementation of 'clearTimeout'.""", """ |
| 51 Warning: 'Window' doesn't implement 'setInterval'. | 39 Warning: 'Window' doesn't implement 'setInterval'. |
| 52 Try adding an implementation of 'setInterval'.""", """ | 40 Try adding an implementation of 'setInterval'.""", """ |
| 53 Warning: 'Window' doesn't implement 'setTimeout'. | 41 Warning: 'Window' doesn't implement 'setTimeout'. |
| 54 Try adding an implementation of 'setTimeout'.""", """ | 42 Try adding an implementation of 'setTimeout'.""", """ |
| 55 Warning: 'Storage' doesn't implement 'addAll'. | 43 Warning: 'Storage' doesn't implement 'addAll'. |
| 56 Try adding an implementation of 'addAll'.""", | 44 Try adding an implementation of 'addAll'.""", |
| 57 "Info: This is the method declaration."], | 45 "Info: This is the method declaration."], |
| 58 | |
| 59 // Bug 15418. | |
| 60 "sdk/lib/typed_data/dart2js/typed_data_dart2js.dart": const [""" | |
| 61 Warning: 'Uint64List' doesn't implement '[]'. | |
| 62 Try adding an implementation of '[]'.""", """ | |
| 63 Warning: 'Uint64List' doesn't implement '[]='. | |
| 64 Try adding an implementation of '[]='.""", """ | |
| 65 Warning: 'Uint64List' doesn't implement 'length'. | |
| 66 Try adding an implementation of 'length'.""", """ | |
| 67 Warning: 'Uint64List' doesn't implement 'length'. | |
| 68 Try adding an implementation of 'length'.""", """ | |
| 69 Warning: 'Uint64List' doesn't implement 'add'. | |
| 70 Try adding an implementation of 'add'.""", """ | |
| 71 Warning: 'Uint64List' doesn't implement 'addAll'. | |
| 72 Try adding an implementation of 'addAll'.""", """ | |
| 73 Warning: 'Uint64List' doesn't implement 'reversed'. | |
| 74 Try adding an implementation of 'reversed'.""", """ | |
| 75 Warning: 'Uint64List' doesn't implement 'sort'. | |
| 76 Try adding an implementation of 'sort'.""", """ | |
| 77 Warning: 'Uint64List' doesn't implement 'shuffle'. | |
| 78 Try adding an implementation of 'shuffle'.""", """ | |
| 79 Warning: 'Uint64List' doesn't implement 'indexOf'. | |
| 80 Try adding an implementation of 'indexOf'.""", """ | |
| 81 Warning: 'Uint64List' doesn't implement 'lastIndexOf'. | |
| 82 Try adding an implementation of 'lastIndexOf'.""", """ | |
| 83 Warning: 'Uint64List' doesn't implement 'clear'. | |
| 84 Try adding an implementation of 'clear'.""", """ | |
| 85 Warning: 'Uint64List' doesn't implement 'insert'. | |
| 86 Try adding an implementation of 'insert'.""", """ | |
| 87 Warning: 'Uint64List' doesn't implement 'insertAll'. | |
| 88 Try adding an implementation of 'insertAll'.""", """ | |
| 89 Warning: 'Uint64List' doesn't implement 'setAll'. | |
| 90 Try adding an implementation of 'setAll'.""", """ | |
| 91 Warning: 'Uint64List' doesn't implement 'remove'. | |
| 92 Try adding an implementation of 'remove'.""", """ | |
| 93 Warning: 'Uint64List' doesn't implement 'removeAt'. | |
| 94 Try adding an implementation of 'removeAt'.""", """ | |
| 95 Warning: 'Uint64List' doesn't implement 'removeLast'. | |
| 96 Try adding an implementation of 'removeLast'.""", """ | |
| 97 Warning: 'Uint64List' doesn't implement 'removeWhere'. | |
| 98 Try adding an implementation of 'removeWhere'.""", """ | |
| 99 Warning: 'Uint64List' doesn't implement 'retainWhere'. | |
| 100 Try adding an implementation of 'retainWhere'.""", """ | |
| 101 Warning: 'Uint64List' doesn't implement 'sublist'. | |
| 102 Try adding an implementation of 'sublist'.""", """ | |
| 103 Warning: 'Uint64List' doesn't implement 'getRange'. | |
| 104 Try adding an implementation of 'getRange'.""", """ | |
| 105 Warning: 'Uint64List' doesn't implement 'setRange'. | |
| 106 Try adding an implementation of 'setRange'.""", """ | |
| 107 Warning: 'Uint64List' doesn't implement 'removeRange'. | |
| 108 Try adding an implementation of 'removeRange'.""", """ | |
| 109 Warning: 'Uint64List' doesn't implement 'fillRange'. | |
| 110 Try adding an implementation of 'fillRange'.""", """ | |
| 111 Warning: 'Uint64List' doesn't implement 'replaceRange'. | |
| 112 Try adding an implementation of 'replaceRange'.""", """ | |
| 113 Warning: 'Uint64List' doesn't implement 'asMap'. | |
| 114 Try adding an implementation of 'asMap'.""", """ | |
| 115 Warning: 'Uint64List' doesn't implement 'length'. | |
| 116 Try adding an implementation of 'length'.""", """ | |
| 117 Warning: 'Uint64List' doesn't implement 'iterator'. | |
| 118 Try adding an implementation of 'iterator'.""", """ | |
| 119 Warning: 'Uint64List' doesn't implement 'map'. | |
| 120 Try adding an implementation of 'map'.""", """ | |
| 121 Warning: 'Uint64List' doesn't implement 'where'. | |
| 122 Try adding an implementation of 'where'.""", """ | |
| 123 Warning: 'Uint64List' doesn't implement 'expand'. | |
| 124 Try adding an implementation of 'expand'.""", """ | |
| 125 Warning: 'Uint64List' doesn't implement 'contains'. | |
| 126 Try adding an implementation of 'contains'.""", """ | |
| 127 Warning: 'Uint64List' doesn't implement 'forEach'. | |
| 128 Try adding an implementation of 'forEach'.""", """ | |
| 129 Warning: 'Uint64List' doesn't implement 'reduce'. | |
| 130 Try adding an implementation of 'reduce'.""", """ | |
| 131 Warning: 'Uint64List' doesn't implement 'fold'. | |
| 132 Try adding an implementation of 'fold'.""", """ | |
| 133 Warning: 'Uint64List' doesn't implement 'every'. | |
| 134 Try adding an implementation of 'every'.""", """ | |
| 135 Warning: 'Uint64List' doesn't implement 'any'. | |
| 136 Try adding an implementation of 'any'.""", """ | |
| 137 Warning: 'Uint64List' doesn't implement 'toList'. | |
| 138 Try adding an implementation of 'toList'.""", """ | |
| 139 Warning: 'Uint64List' doesn't implement 'toSet'. | |
| 140 Try adding an implementation of 'toSet'.""", """ | |
| 141 Warning: 'Uint64List' doesn't implement 'length'. | |
| 142 Try adding an implementation of 'length'.""", """ | |
| 143 Warning: 'Uint64List' doesn't implement 'isEmpty'. | |
| 144 Try adding an implementation of 'isEmpty'.""", """ | |
| 145 Warning: 'Uint64List' doesn't implement 'isNotEmpty'. | |
| 146 Try adding an implementation of 'isNotEmpty'.""", """ | |
| 147 Warning: 'Uint64List' doesn't implement 'take'. | |
| 148 Try adding an implementation of 'take'.""", """ | |
| 149 Warning: 'Uint64List' doesn't implement 'takeWhile'. | |
| 150 Try adding an implementation of 'takeWhile'.""", """ | |
| 151 Warning: 'Uint64List' doesn't implement 'skip'. | |
| 152 Try adding an implementation of 'skip'.""", """ | |
| 153 Warning: 'Uint64List' doesn't implement 'skipWhile'. | |
| 154 Try adding an implementation of 'skipWhile'.""", """ | |
| 155 Warning: 'Uint64List' doesn't implement 'first'. | |
| 156 Try adding an implementation of 'first'.""", """ | |
| 157 Warning: 'Uint64List' doesn't implement 'last'. | |
| 158 Try adding an implementation of 'last'.""", """ | |
| 159 Warning: 'Uint64List' doesn't implement 'single'. | |
| 160 Try adding an implementation of 'single'.""", """ | |
| 161 Warning: 'Uint64List' doesn't implement 'firstWhere'. | |
| 162 Try adding an implementation of 'firstWhere'.""", """ | |
| 163 Warning: 'Uint64List' doesn't implement 'lastWhere'. | |
| 164 Try adding an implementation of 'lastWhere'.""", """ | |
| 165 Warning: 'Uint64List' doesn't implement 'singleWhere'. | |
| 166 Try adding an implementation of 'singleWhere'.""", """ | |
| 167 Warning: 'Uint64List' doesn't implement 'elementAt'. | |
| 168 Try adding an implementation of 'elementAt'.""", """ | |
| 169 Warning: 'Uint64List' doesn't implement '[]='. | |
| 170 Try adding an implementation of '[]='.""", """ | |
| 171 Warning: 'Uint64List' doesn't implement 'length'. | |
| 172 Try adding an implementation of 'length'.""", """ | |
| 173 Warning: 'Uint64List' doesn't implement '[]'. | |
| 174 Try adding an implementation of '[]'.""", """ | |
| 175 Warning: 'Int64List' doesn't implement '[]'. | |
| 176 Try adding an implementation of '[]'.""", """ | |
| 177 Warning: 'Int64List' doesn't implement '[]='. | |
| 178 Try adding an implementation of '[]='.""", """ | |
| 179 Warning: 'Int64List' doesn't implement 'length'. | |
| 180 Try adding an implementation of 'length'.""", """ | |
| 181 Warning: 'Int64List' doesn't implement 'length'. | |
| 182 Try adding an implementation of 'length'.""", """ | |
| 183 Warning: 'Int64List' doesn't implement 'add'. | |
| 184 Try adding an implementation of 'add'.""", """ | |
| 185 Warning: 'Int64List' doesn't implement 'addAll'. | |
| 186 Try adding an implementation of 'addAll'.""", """ | |
| 187 Warning: 'Int64List' doesn't implement 'reversed'. | |
| 188 Try adding an implementation of 'reversed'.""", """ | |
| 189 Warning: 'Int64List' doesn't implement 'sort'. | |
| 190 Try adding an implementation of 'sort'.""", """ | |
| 191 Warning: 'Int64List' doesn't implement 'shuffle'. | |
| 192 Try adding an implementation of 'shuffle'.""", """ | |
| 193 Warning: 'Int64List' doesn't implement 'indexOf'. | |
| 194 Try adding an implementation of 'indexOf'.""", """ | |
| 195 Warning: 'Int64List' doesn't implement 'lastIndexOf'. | |
| 196 Try adding an implementation of 'lastIndexOf'.""", """ | |
| 197 Warning: 'Int64List' doesn't implement 'clear'. | |
| 198 Try adding an implementation of 'clear'.""", """ | |
| 199 Warning: 'Int64List' doesn't implement 'insert'. | |
| 200 Try adding an implementation of 'insert'.""", """ | |
| 201 Warning: 'Int64List' doesn't implement 'insertAll'. | |
| 202 Try adding an implementation of 'insertAll'.""", """ | |
| 203 Warning: 'Int64List' doesn't implement 'setAll'. | |
| 204 Try adding an implementation of 'setAll'.""", """ | |
| 205 Warning: 'Int64List' doesn't implement 'remove'. | |
| 206 Try adding an implementation of 'remove'.""", """ | |
| 207 Warning: 'Int64List' doesn't implement 'removeAt'. | |
| 208 Try adding an implementation of 'removeAt'.""", """ | |
| 209 Warning: 'Int64List' doesn't implement 'removeLast'. | |
| 210 Try adding an implementation of 'removeLast'.""", """ | |
| 211 Warning: 'Int64List' doesn't implement 'removeWhere'. | |
| 212 Try adding an implementation of 'removeWhere'.""", """ | |
| 213 Warning: 'Int64List' doesn't implement 'retainWhere'. | |
| 214 Try adding an implementation of 'retainWhere'.""", """ | |
| 215 Warning: 'Int64List' doesn't implement 'sublist'. | |
| 216 Try adding an implementation of 'sublist'.""", """ | |
| 217 Warning: 'Int64List' doesn't implement 'getRange'. | |
| 218 Try adding an implementation of 'getRange'.""", """ | |
| 219 Warning: 'Int64List' doesn't implement 'setRange'. | |
| 220 Try adding an implementation of 'setRange'.""", """ | |
| 221 Warning: 'Int64List' doesn't implement 'removeRange'. | |
| 222 Try adding an implementation of 'removeRange'.""", """ | |
| 223 Warning: 'Int64List' doesn't implement 'fillRange'. | |
| 224 Try adding an implementation of 'fillRange'.""", """ | |
| 225 Warning: 'Int64List' doesn't implement 'replaceRange'. | |
| 226 Try adding an implementation of 'replaceRange'.""", """ | |
| 227 Warning: 'Int64List' doesn't implement 'asMap'. | |
| 228 Try adding an implementation of 'asMap'.""", """ | |
| 229 Warning: 'Int64List' doesn't implement 'length'. | |
| 230 Try adding an implementation of 'length'.""", """ | |
| 231 Warning: 'Int64List' doesn't implement 'iterator'. | |
| 232 Try adding an implementation of 'iterator'.""", """ | |
| 233 Warning: 'Int64List' doesn't implement 'map'. | |
| 234 Try adding an implementation of 'map'.""", """ | |
| 235 Warning: 'Int64List' doesn't implement 'where'. | |
| 236 Try adding an implementation of 'where'.""", """ | |
| 237 Warning: 'Int64List' doesn't implement 'expand'. | |
| 238 Try adding an implementation of 'expand'.""", """ | |
| 239 Warning: 'Int64List' doesn't implement 'contains'. | |
| 240 Try adding an implementation of 'contains'.""", """ | |
| 241 Warning: 'Int64List' doesn't implement 'forEach'. | |
| 242 Try adding an implementation of 'forEach'.""", """ | |
| 243 Warning: 'Int64List' doesn't implement 'reduce'. | |
| 244 Try adding an implementation of 'reduce'.""", """ | |
| 245 Warning: 'Int64List' doesn't implement 'fold'. | |
| 246 Try adding an implementation of 'fold'.""", """ | |
| 247 Warning: 'Int64List' doesn't implement 'every'. | |
| 248 Try adding an implementation of 'every'.""", """ | |
| 249 Warning: 'Int64List' doesn't implement 'any'. | |
| 250 Try adding an implementation of 'any'.""", """ | |
| 251 Warning: 'Int64List' doesn't implement 'toList'. | |
| 252 Try adding an implementation of 'toList'.""", """ | |
| 253 Warning: 'Int64List' doesn't implement 'toSet'. | |
| 254 Try adding an implementation of 'toSet'.""", """ | |
| 255 Warning: 'Int64List' doesn't implement 'length'. | |
| 256 Try adding an implementation of 'length'.""", """ | |
| 257 Warning: 'Int64List' doesn't implement 'isEmpty'. | |
| 258 Try adding an implementation of 'isEmpty'.""", """ | |
| 259 Warning: 'Int64List' doesn't implement 'isNotEmpty'. | |
| 260 Try adding an implementation of 'isNotEmpty'.""", """ | |
| 261 Warning: 'Int64List' doesn't implement 'take'. | |
| 262 Try adding an implementation of 'take'.""", """ | |
| 263 Warning: 'Int64List' doesn't implement 'takeWhile'. | |
| 264 Try adding an implementation of 'takeWhile'.""", """ | |
| 265 Warning: 'Int64List' doesn't implement 'skip'. | |
| 266 Try adding an implementation of 'skip'.""", """ | |
| 267 Warning: 'Int64List' doesn't implement 'skipWhile'. | |
| 268 Try adding an implementation of 'skipWhile'.""", """ | |
| 269 Warning: 'Int64List' doesn't implement 'first'. | |
| 270 Try adding an implementation of 'first'.""", """ | |
| 271 Warning: 'Int64List' doesn't implement 'last'. | |
| 272 Try adding an implementation of 'last'.""", """ | |
| 273 Warning: 'Int64List' doesn't implement 'single'. | |
| 274 Try adding an implementation of 'single'.""", """ | |
| 275 Warning: 'Int64List' doesn't implement 'firstWhere'. | |
| 276 Try adding an implementation of 'firstWhere'.""", """ | |
| 277 Warning: 'Int64List' doesn't implement 'lastWhere'. | |
| 278 Try adding an implementation of 'lastWhere'.""", """ | |
| 279 Warning: 'Int64List' doesn't implement 'singleWhere'. | |
| 280 Try adding an implementation of 'singleWhere'.""", """ | |
| 281 Warning: 'Int64List' doesn't implement 'elementAt'. | |
| 282 Try adding an implementation of 'elementAt'.""", """ | |
| 283 Warning: 'Int64List' doesn't implement '[]='. | |
| 284 Try adding an implementation of '[]='.""", """ | |
| 285 Warning: 'Int64List' doesn't implement 'length'. | |
| 286 Try adding an implementation of 'length'.""", """ | |
| 287 Warning: 'Int64List' doesn't implement '[]'. | |
| 288 Try adding an implementation of '[]'."""], | |
| 289 }; | 46 }; |
| 290 | 47 |
| 291 void main() { | 48 void main() { |
| 292 var uriList = new List<Uri>(); | 49 var uriList = new List<Uri>(); |
| 293 LIBRARIES.forEach((String name, LibraryInfo info) { | 50 LIBRARIES.forEach((String name, LibraryInfo info) { |
| 294 if (info.documented) { | 51 if (info.documented) { |
| 295 uriList.add(new Uri(scheme: 'dart', path: name)); | 52 uriList.add(new Uri(scheme: 'dart', path: name)); |
| 296 } | 53 } |
| 297 }); | 54 }); |
| 298 asyncTest(() => analyze(uriList, WHITE_LIST)); | 55 asyncTest(() => analyze(uriList, WHITE_LIST)); |
| 299 } | 56 } |
| OLD | NEW |