| 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'; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 "lib/src/tree/nodes.dart": const [ | 21 "lib/src/tree/nodes.dart": const [ |
| 22 "The method 'asLiteralBool' is never called"], | 22 "The method 'asLiteralBool' is never called"], |
| 23 | 23 |
| 24 // Some things in dart_printer are not yet used | 24 // Some things in dart_printer are not yet used |
| 25 "lib/src/dart_backend/backend_ast_nodes.dart": const [" is never "], | 25 "lib/src/dart_backend/backend_ast_nodes.dart": const [" is never "], |
| 26 | 26 |
| 27 // Uncalled error methods in SemanticSendVisitor and subclasses. | 27 // Uncalled error methods in SemanticSendVisitor and subclasses. |
| 28 "lib/src/resolution/semantic_visitor.dart": const [ | 28 "lib/src/resolution/semantic_visitor.dart": const [ |
| 29 "The method 'error"], | 29 "The method 'error"], |
| 30 "lib/src/resolution/semantic_visitor_mixins.dart": const [ | 30 "lib/src/resolution/semantic_visitor_mixins.dart": const [ |
| 31 "The method 'error"] | 31 "The method 'error"], |
| 32 |
| 33 // Uncalled type predicate. Keep while related predicates are used. |
| 34 "lib/src/ssa/nodes.dart": const [ |
| 35 "The method 'isArray' is never called"], |
| 32 }; | 36 }; |
| 33 | 37 |
| 34 void main() { | 38 void main() { |
| 35 var uri = currentDirectory.resolve( | 39 var uri = currentDirectory.resolve( |
| 36 'pkg/compiler/lib/src/use_unused_api.dart'); | 40 'pkg/compiler/lib/src/use_unused_api.dart'); |
| 37 asyncTest(() => analyze([uri], WHITE_LIST, | 41 asyncTest(() => analyze([uri], WHITE_LIST, |
| 38 analyzeAll: false, checkResults: checkResults)); | 42 analyzeAll: false, checkResults: checkResults)); |
| 39 } | 43 } |
| 40 | 44 |
| 41 bool checkResults(Compiler compiler, CollectingDiagnosticHandler handler) { | 45 bool checkResults(Compiler compiler, CollectingDiagnosticHandler handler) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 57 } else if (member.isTypedef) { | 61 } else if (member.isTypedef) { |
| 58 if (member.isResolved) { | 62 if (member.isResolved) { |
| 59 compiler.reportHint(member, MessageKind.GENERIC, | 63 compiler.reportHint(member, MessageKind.GENERIC, |
| 60 {'text': "Helper typedef in production code '$member'."}); | 64 {'text': "Helper typedef in production code '$member'."}); |
| 61 } | 65 } |
| 62 } | 66 } |
| 63 } | 67 } |
| 64 compiler.libraryLoader.lookupLibrary(helperUri).forEachLocalMember(checkLive); | 68 compiler.libraryLoader.lookupLibrary(helperUri).forEachLocalMember(checkLive); |
| 65 return handler.checkResults(); | 69 return handler.checkResults(); |
| 66 } | 70 } |
| OLD | NEW |