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_unused_dart2js; | 5 library analyze_unused_dart2js; |
6 | 6 |
7 import 'package:async_helper/async_helper.dart'; | 7 import 'package:async_helper/async_helper.dart'; |
8 | 8 |
9 import 'package:compiler/src/dart2jslib.dart'; | 9 import 'package:compiler/src/dart2jslib.dart'; |
10 import 'package:compiler/src/filenames.dart'; | 10 import 'package:compiler/src/filenames.dart'; |
| 11 import 'package:compiler/src/messages.dart'; |
11 | 12 |
12 import 'analyze_helper.dart'; | 13 import 'analyze_helper.dart'; |
13 | 14 |
14 // Do not remove WHITE_LIST even if it's empty. The error message for | 15 // Do not remove WHITE_LIST even if it's empty. The error message for |
15 // unused members refers to WHITE_LIST by name. | 16 // unused members refers to WHITE_LIST by name. |
16 const Map<String, List<String>> WHITE_LIST = const { | 17 const Map<String, List<String>> WHITE_LIST = const { |
17 // Helper methods for debugging should never be called from production code: | 18 // Helper methods for debugging should never be called from production code: |
18 "lib/src/helpers/": const [" is never "], | 19 "lib/src/helpers/": const [" is never "], |
19 | 20 |
20 // Node.asLiteralBool is never used. | 21 // Node.asLiteralBool is never used. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } else if (member.isTypedef) { | 83 } else if (member.isTypedef) { |
83 if (member.isResolved) { | 84 if (member.isResolved) { |
84 compiler.reportHint(member, MessageKind.GENERIC, | 85 compiler.reportHint(member, MessageKind.GENERIC, |
85 {'text': "Helper typedef in production code '$member'."}); | 86 {'text': "Helper typedef in production code '$member'."}); |
86 } | 87 } |
87 } | 88 } |
88 } | 89 } |
89 compiler.libraryLoader.lookupLibrary(helperUri).forEachLocalMember(checkLive); | 90 compiler.libraryLoader.lookupLibrary(helperUri).forEachLocalMember(checkLive); |
90 return handler.checkResults(); | 91 return handler.checkResults(); |
91 } | 92 } |
OLD | NEW |