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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 "accept", "FunctionExpression", "CreateFunction" | 43 "accept", "FunctionExpression", "CreateFunction" |
44 ], | 44 ], |
45 | 45 |
46 "lib/src/cps_ir/": const [ | 46 "lib/src/cps_ir/": const [ |
47 "accept", "CreateFunction", | 47 "accept", "CreateFunction", |
48 ], | 48 ], |
49 | 49 |
50 "/lib/src/dart_backend/backend_ast_to_frontend_ast.dart": const [ | 50 "/lib/src/dart_backend/backend_ast_to_frontend_ast.dart": const [ |
51 " is never " | 51 " is never " |
52 ], | 52 ], |
53 | |
54 "/lib/src/cps_ir/type_propagation.dart": const ["UnitTypeSystem"], | |
55 }; | 53 }; |
56 | 54 |
57 void main() { | 55 void main() { |
58 var uri = currentDirectory.resolve( | 56 var uri = currentDirectory.resolve( |
59 'pkg/compiler/lib/src/use_unused_api.dart'); | 57 'pkg/compiler/lib/src/use_unused_api.dart'); |
60 asyncTest(() => analyze([uri], WHITE_LIST, | 58 asyncTest(() => analyze([uri], WHITE_LIST, |
61 analyzeAll: false, checkResults: checkResults)); | 59 analyzeAll: false, checkResults: checkResults)); |
62 } | 60 } |
63 | 61 |
64 bool checkResults(Compiler compiler, CollectingDiagnosticHandler handler) { | 62 bool checkResults(Compiler compiler, CollectingDiagnosticHandler handler) { |
(...skipping 15 matching lines...) Expand all Loading... |
80 } else if (member.isTypedef) { | 78 } else if (member.isTypedef) { |
81 if (member.isResolved) { | 79 if (member.isResolved) { |
82 compiler.reportHint(member, MessageKind.GENERIC, | 80 compiler.reportHint(member, MessageKind.GENERIC, |
83 {'text': "Helper typedef in production code '$member'."}); | 81 {'text': "Helper typedef in production code '$member'."}); |
84 } | 82 } |
85 } | 83 } |
86 } | 84 } |
87 compiler.libraryLoader.lookupLibrary(helperUri).forEachLocalMember(checkLive); | 85 compiler.libraryLoader.lookupLibrary(helperUri).forEachLocalMember(checkLive); |
88 return handler.checkResults(); | 86 return handler.checkResults(); |
89 } | 87 } |
OLD | NEW |