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 "sdk/lib/_collection_dev/iterable.dart": const [ | |
Johnni Winther
2013/12/04 12:09:14
Where do these infos come from?
ahe
2013/12/04 16:13:44
After saying which method isn't implemented, dart2
| |
24 "Info: This is the method declaration."], | |
25 | |
26 "sdk/lib/_internal/lib/interceptors.dart": const [ | |
27 "Info: This is the method declaration."], | |
28 | |
29 "sdk/lib/core/iterable.dart": const [ | |
30 "Info: This is the method declaration."], | |
31 | |
32 "sdk/lib/core/list.dart": const [ | |
33 "Info: This is the method declaration."], | |
34 | |
35 "sdk/lib/core/map.dart": const [ | |
36 "Info: This is the method declaration."], | |
37 | |
38 // Bug 15417. | |
39 "sdk/lib/html/dart2js/html_dart2js.dart": const [""" | |
40 Warning: '_DataAttributeMap' doesn't implement 'addAll'. | |
41 Try adding an implementation of 'addAll'.""", """ | |
42 Warning: '_NamespacedAttributeMap' doesn't implement 'addAll'. | |
43 Try adding an implementation of 'addAll'.""", """ | |
44 Warning: '_ElementAttributeMap' doesn't implement 'addAll'. | |
45 Try adding an implementation of 'addAll'.""", """ | |
46 Warning: 'Window' doesn't implement 'clearInterval'. | |
47 Try adding an implementation of 'clearInterval'.""", """ | |
48 Warning: 'Window' doesn't implement 'clearTimeout'. | |
49 Try adding an implementation of 'clearTimeout'.""", """ | |
50 Warning: 'Window' doesn't implement 'setInterval'. | |
51 Try adding an implementation of 'setInterval'.""", """ | |
52 Warning: 'Window' doesn't implement 'setTimeout'. | |
53 Try adding an implementation of 'setTimeout'.""", """ | |
54 Warning: 'Storage' doesn't implement 'addAll'. | |
55 Try adding an implementation of 'addAll'.""", | |
56 "Info: This is the method declaration."], | |
57 | |
58 // Bug 15418. | |
59 "sdk/lib/typed_data/dart2js/typed_data_dart2js.dart": const [""" | |
60 Warning: 'Uint64List' doesn't implement '[]'. | |
61 Try adding an implementation of '[]'.""", """ | |
62 Warning: 'Uint64List' doesn't implement '[]='. | |
63 Try adding an implementation of '[]='.""", """ | |
64 Warning: 'Uint64List' doesn't implement 'length'. | |
65 Try adding an implementation of 'length'.""", """ | |
66 Warning: 'Uint64List' doesn't implement 'length'. | |
67 Try adding an implementation of 'length'.""", """ | |
68 Warning: 'Uint64List' doesn't implement 'add'. | |
69 Try adding an implementation of 'add'.""", """ | |
70 Warning: 'Uint64List' doesn't implement 'addAll'. | |
71 Try adding an implementation of 'addAll'.""", """ | |
72 Warning: 'Uint64List' doesn't implement 'reversed'. | |
73 Try adding an implementation of 'reversed'.""", """ | |
74 Warning: 'Uint64List' doesn't implement 'sort'. | |
75 Try adding an implementation of 'sort'.""", """ | |
76 Warning: 'Uint64List' doesn't implement 'shuffle'. | |
77 Try adding an implementation of 'shuffle'.""", """ | |
78 Warning: 'Uint64List' doesn't implement 'indexOf'. | |
79 Try adding an implementation of 'indexOf'.""", """ | |
80 Warning: 'Uint64List' doesn't implement 'lastIndexOf'. | |
81 Try adding an implementation of 'lastIndexOf'.""", """ | |
82 Warning: 'Uint64List' doesn't implement 'clear'. | |
83 Try adding an implementation of 'clear'.""", """ | |
84 Warning: 'Uint64List' doesn't implement 'insert'. | |
85 Try adding an implementation of 'insert'.""", """ | |
86 Warning: 'Uint64List' doesn't implement 'insertAll'. | |
87 Try adding an implementation of 'insertAll'.""", """ | |
88 Warning: 'Uint64List' doesn't implement 'setAll'. | |
89 Try adding an implementation of 'setAll'.""", """ | |
90 Warning: 'Uint64List' doesn't implement 'remove'. | |
91 Try adding an implementation of 'remove'.""", """ | |
92 Warning: 'Uint64List' doesn't implement 'removeAt'. | |
93 Try adding an implementation of 'removeAt'.""", """ | |
94 Warning: 'Uint64List' doesn't implement 'removeLast'. | |
95 Try adding an implementation of 'removeLast'.""", """ | |
96 Warning: 'Uint64List' doesn't implement 'removeWhere'. | |
97 Try adding an implementation of 'removeWhere'.""", """ | |
98 Warning: 'Uint64List' doesn't implement 'retainWhere'. | |
99 Try adding an implementation of 'retainWhere'.""", """ | |
100 Warning: 'Uint64List' doesn't implement 'sublist'. | |
101 Try adding an implementation of 'sublist'.""", """ | |
102 Warning: 'Uint64List' doesn't implement 'getRange'. | |
103 Try adding an implementation of 'getRange'.""", """ | |
104 Warning: 'Uint64List' doesn't implement 'setRange'. | |
105 Try adding an implementation of 'setRange'.""", """ | |
106 Warning: 'Uint64List' doesn't implement 'removeRange'. | |
107 Try adding an implementation of 'removeRange'.""", """ | |
108 Warning: 'Uint64List' doesn't implement 'fillRange'. | |
109 Try adding an implementation of 'fillRange'.""", """ | |
110 Warning: 'Uint64List' doesn't implement 'replaceRange'. | |
111 Try adding an implementation of 'replaceRange'.""", """ | |
112 Warning: 'Uint64List' doesn't implement 'asMap'. | |
113 Try adding an implementation of 'asMap'.""", """ | |
114 Warning: 'Uint64List' doesn't implement 'length'. | |
115 Try adding an implementation of 'length'.""", """ | |
116 Warning: 'Uint64List' doesn't implement 'iterator'. | |
117 Try adding an implementation of 'iterator'.""", """ | |
118 Warning: 'Uint64List' doesn't implement 'map'. | |
119 Try adding an implementation of 'map'.""", """ | |
120 Warning: 'Uint64List' doesn't implement 'where'. | |
121 Try adding an implementation of 'where'.""", """ | |
122 Warning: 'Uint64List' doesn't implement 'expand'. | |
123 Try adding an implementation of 'expand'.""", """ | |
124 Warning: 'Uint64List' doesn't implement 'contains'. | |
125 Try adding an implementation of 'contains'.""", """ | |
126 Warning: 'Uint64List' doesn't implement 'forEach'. | |
127 Try adding an implementation of 'forEach'.""", """ | |
128 Warning: 'Uint64List' doesn't implement 'reduce'. | |
129 Try adding an implementation of 'reduce'.""", """ | |
130 Warning: 'Uint64List' doesn't implement 'fold'. | |
131 Try adding an implementation of 'fold'.""", """ | |
132 Warning: 'Uint64List' doesn't implement 'every'. | |
133 Try adding an implementation of 'every'.""", """ | |
134 Warning: 'Uint64List' doesn't implement 'any'. | |
135 Try adding an implementation of 'any'.""", """ | |
136 Warning: 'Uint64List' doesn't implement 'toList'. | |
137 Try adding an implementation of 'toList'.""", """ | |
138 Warning: 'Uint64List' doesn't implement 'toSet'. | |
139 Try adding an implementation of 'toSet'.""", """ | |
140 Warning: 'Uint64List' doesn't implement 'length'. | |
141 Try adding an implementation of 'length'.""", """ | |
142 Warning: 'Uint64List' doesn't implement 'isEmpty'. | |
143 Try adding an implementation of 'isEmpty'.""", """ | |
144 Warning: 'Uint64List' doesn't implement 'isNotEmpty'. | |
145 Try adding an implementation of 'isNotEmpty'.""", """ | |
146 Warning: 'Uint64List' doesn't implement 'take'. | |
147 Try adding an implementation of 'take'.""", """ | |
148 Warning: 'Uint64List' doesn't implement 'takeWhile'. | |
149 Try adding an implementation of 'takeWhile'.""", """ | |
150 Warning: 'Uint64List' doesn't implement 'skip'. | |
151 Try adding an implementation of 'skip'.""", """ | |
152 Warning: 'Uint64List' doesn't implement 'skipWhile'. | |
153 Try adding an implementation of 'skipWhile'.""", """ | |
154 Warning: 'Uint64List' doesn't implement 'first'. | |
155 Try adding an implementation of 'first'.""", """ | |
156 Warning: 'Uint64List' doesn't implement 'last'. | |
157 Try adding an implementation of 'last'.""", """ | |
158 Warning: 'Uint64List' doesn't implement 'single'. | |
159 Try adding an implementation of 'single'.""", """ | |
160 Warning: 'Uint64List' doesn't implement 'firstWhere'. | |
161 Try adding an implementation of 'firstWhere'.""", """ | |
162 Warning: 'Uint64List' doesn't implement 'lastWhere'. | |
163 Try adding an implementation of 'lastWhere'.""", """ | |
164 Warning: 'Uint64List' doesn't implement 'singleWhere'. | |
165 Try adding an implementation of 'singleWhere'.""", """ | |
166 Warning: 'Uint64List' doesn't implement 'elementAt'. | |
167 Try adding an implementation of 'elementAt'.""", """ | |
168 Warning: 'Uint64List' doesn't implement '[]='. | |
169 Try adding an implementation of '[]='.""", """ | |
170 Warning: 'Uint64List' doesn't implement 'length'. | |
171 Try adding an implementation of 'length'.""", """ | |
172 Warning: 'Uint64List' doesn't implement '[]'. | |
173 Try adding an implementation of '[]'.""", """ | |
174 Warning: 'Int64List' doesn't implement '[]'. | |
175 Try adding an implementation of '[]'.""", """ | |
176 Warning: 'Int64List' doesn't implement '[]='. | |
177 Try adding an implementation of '[]='.""", """ | |
178 Warning: 'Int64List' doesn't implement 'length'. | |
179 Try adding an implementation of 'length'.""", """ | |
180 Warning: 'Int64List' doesn't implement 'length'. | |
181 Try adding an implementation of 'length'.""", """ | |
182 Warning: 'Int64List' doesn't implement 'add'. | |
183 Try adding an implementation of 'add'.""", """ | |
184 Warning: 'Int64List' doesn't implement 'addAll'. | |
185 Try adding an implementation of 'addAll'.""", """ | |
186 Warning: 'Int64List' doesn't implement 'reversed'. | |
187 Try adding an implementation of 'reversed'.""", """ | |
188 Warning: 'Int64List' doesn't implement 'sort'. | |
189 Try adding an implementation of 'sort'.""", """ | |
190 Warning: 'Int64List' doesn't implement 'shuffle'. | |
191 Try adding an implementation of 'shuffle'.""", """ | |
192 Warning: 'Int64List' doesn't implement 'indexOf'. | |
193 Try adding an implementation of 'indexOf'.""", """ | |
194 Warning: 'Int64List' doesn't implement 'lastIndexOf'. | |
195 Try adding an implementation of 'lastIndexOf'.""", """ | |
196 Warning: 'Int64List' doesn't implement 'clear'. | |
197 Try adding an implementation of 'clear'.""", """ | |
198 Warning: 'Int64List' doesn't implement 'insert'. | |
199 Try adding an implementation of 'insert'.""", """ | |
200 Warning: 'Int64List' doesn't implement 'insertAll'. | |
201 Try adding an implementation of 'insertAll'.""", """ | |
202 Warning: 'Int64List' doesn't implement 'setAll'. | |
203 Try adding an implementation of 'setAll'.""", """ | |
204 Warning: 'Int64List' doesn't implement 'remove'. | |
205 Try adding an implementation of 'remove'.""", """ | |
206 Warning: 'Int64List' doesn't implement 'removeAt'. | |
207 Try adding an implementation of 'removeAt'.""", """ | |
208 Warning: 'Int64List' doesn't implement 'removeLast'. | |
209 Try adding an implementation of 'removeLast'.""", """ | |
210 Warning: 'Int64List' doesn't implement 'removeWhere'. | |
211 Try adding an implementation of 'removeWhere'.""", """ | |
212 Warning: 'Int64List' doesn't implement 'retainWhere'. | |
213 Try adding an implementation of 'retainWhere'.""", """ | |
214 Warning: 'Int64List' doesn't implement 'sublist'. | |
215 Try adding an implementation of 'sublist'.""", """ | |
216 Warning: 'Int64List' doesn't implement 'getRange'. | |
217 Try adding an implementation of 'getRange'.""", """ | |
218 Warning: 'Int64List' doesn't implement 'setRange'. | |
219 Try adding an implementation of 'setRange'.""", """ | |
220 Warning: 'Int64List' doesn't implement 'removeRange'. | |
221 Try adding an implementation of 'removeRange'.""", """ | |
222 Warning: 'Int64List' doesn't implement 'fillRange'. | |
223 Try adding an implementation of 'fillRange'.""", """ | |
224 Warning: 'Int64List' doesn't implement 'replaceRange'. | |
225 Try adding an implementation of 'replaceRange'.""", """ | |
226 Warning: 'Int64List' doesn't implement 'asMap'. | |
227 Try adding an implementation of 'asMap'.""", """ | |
228 Warning: 'Int64List' doesn't implement 'length'. | |
229 Try adding an implementation of 'length'.""", """ | |
230 Warning: 'Int64List' doesn't implement 'iterator'. | |
231 Try adding an implementation of 'iterator'.""", """ | |
232 Warning: 'Int64List' doesn't implement 'map'. | |
233 Try adding an implementation of 'map'.""", """ | |
234 Warning: 'Int64List' doesn't implement 'where'. | |
235 Try adding an implementation of 'where'.""", """ | |
236 Warning: 'Int64List' doesn't implement 'expand'. | |
237 Try adding an implementation of 'expand'.""", """ | |
238 Warning: 'Int64List' doesn't implement 'contains'. | |
239 Try adding an implementation of 'contains'.""", """ | |
240 Warning: 'Int64List' doesn't implement 'forEach'. | |
241 Try adding an implementation of 'forEach'.""", """ | |
242 Warning: 'Int64List' doesn't implement 'reduce'. | |
243 Try adding an implementation of 'reduce'.""", """ | |
244 Warning: 'Int64List' doesn't implement 'fold'. | |
245 Try adding an implementation of 'fold'.""", """ | |
246 Warning: 'Int64List' doesn't implement 'every'. | |
247 Try adding an implementation of 'every'.""", """ | |
248 Warning: 'Int64List' doesn't implement 'any'. | |
249 Try adding an implementation of 'any'.""", """ | |
250 Warning: 'Int64List' doesn't implement 'toList'. | |
251 Try adding an implementation of 'toList'.""", """ | |
252 Warning: 'Int64List' doesn't implement 'toSet'. | |
253 Try adding an implementation of 'toSet'.""", """ | |
254 Warning: 'Int64List' doesn't implement 'length'. | |
255 Try adding an implementation of 'length'.""", """ | |
256 Warning: 'Int64List' doesn't implement 'isEmpty'. | |
257 Try adding an implementation of 'isEmpty'.""", """ | |
258 Warning: 'Int64List' doesn't implement 'isNotEmpty'. | |
259 Try adding an implementation of 'isNotEmpty'.""", """ | |
260 Warning: 'Int64List' doesn't implement 'take'. | |
261 Try adding an implementation of 'take'.""", """ | |
262 Warning: 'Int64List' doesn't implement 'takeWhile'. | |
263 Try adding an implementation of 'takeWhile'.""", """ | |
264 Warning: 'Int64List' doesn't implement 'skip'. | |
265 Try adding an implementation of 'skip'.""", """ | |
266 Warning: 'Int64List' doesn't implement 'skipWhile'. | |
267 Try adding an implementation of 'skipWhile'.""", """ | |
268 Warning: 'Int64List' doesn't implement 'first'. | |
269 Try adding an implementation of 'first'.""", """ | |
270 Warning: 'Int64List' doesn't implement 'last'. | |
271 Try adding an implementation of 'last'.""", """ | |
272 Warning: 'Int64List' doesn't implement 'single'. | |
273 Try adding an implementation of 'single'.""", """ | |
274 Warning: 'Int64List' doesn't implement 'firstWhere'. | |
275 Try adding an implementation of 'firstWhere'.""", """ | |
276 Warning: 'Int64List' doesn't implement 'lastWhere'. | |
277 Try adding an implementation of 'lastWhere'.""", """ | |
278 Warning: 'Int64List' doesn't implement 'singleWhere'. | |
279 Try adding an implementation of 'singleWhere'.""", """ | |
280 Warning: 'Int64List' doesn't implement 'elementAt'. | |
281 Try adding an implementation of 'elementAt'.""", """ | |
282 Warning: 'Int64List' doesn't implement '[]='. | |
283 Try adding an implementation of '[]='.""", """ | |
284 Warning: 'Int64List' doesn't implement 'length'. | |
285 Try adding an implementation of 'length'.""", """ | |
286 Warning: 'Int64List' doesn't implement '[]'. | |
287 Try adding an implementation of '[]'."""], | |
23 }; | 288 }; |
24 | 289 |
25 void main() { | 290 void main() { |
26 var uriList = new List<Uri>(); | 291 var uriList = new List<Uri>(); |
27 LIBRARIES.forEach((String name, LibraryInfo info) { | 292 LIBRARIES.forEach((String name, LibraryInfo info) { |
28 if (info.documented) { | 293 if (info.documented) { |
29 uriList.add(new Uri(scheme: 'dart', path: name)); | 294 uriList.add(new Uri(scheme: 'dart', path: name)); |
30 } | 295 } |
31 }); | 296 }); |
32 asyncTest(() => analyze(uriList, WHITE_LIST)); | 297 asyncTest(() => analyze(uriList, WHITE_LIST)); |
33 } | 298 } |
OLD | NEW |