OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 dart2js.analyze_helpers.test; | 5 library dart2js.analyze_helpers.test; |
6 | 6 |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
10 import 'package:compiler/compiler_new.dart' show | 10 import 'package:compiler/compiler_new.dart' show |
11 Diagnostic; | 11 Diagnostic; |
12 import 'package:compiler/src/apiimpl.dart' show | 12 import 'package:compiler/src/apiimpl.dart' show |
13 Compiler; | 13 Compiler; |
| 14 import 'package:compiler/src/commandline_options.dart'; |
14 import 'package:compiler/src/constants/expressions.dart' show | 15 import 'package:compiler/src/constants/expressions.dart' show |
15 ConstructedConstantExpression; | 16 ConstructedConstantExpression; |
16 import 'package:compiler/src/dart_types.dart' show | 17 import 'package:compiler/src/dart_types.dart' show |
17 InterfaceType; | 18 InterfaceType; |
18 import 'package:compiler/src/diagnostics/source_span.dart' show | 19 import 'package:compiler/src/diagnostics/source_span.dart' show |
19 SourceSpan; | 20 SourceSpan; |
20 import 'package:compiler/src/elements/elements.dart'; | 21 import 'package:compiler/src/elements/elements.dart'; |
21 import 'package:compiler/src/filenames.dart' show | 22 import 'package:compiler/src/filenames.dart' show |
22 nativeToUriPath; | 23 nativeToUriPath; |
23 import 'package:compiler/src/resolution/semantic_visitor.dart'; | 24 import 'package:compiler/src/resolution/semantic_visitor.dart'; |
24 import 'package:compiler/src/resolution/tree_elements.dart' show | 25 import 'package:compiler/src/resolution/tree_elements.dart' show |
25 TreeElements; | 26 TreeElements; |
26 import 'package:compiler/src/source_file_provider.dart' show | 27 import 'package:compiler/src/source_file_provider.dart' show |
27 FormattingDiagnosticHandler; | 28 FormattingDiagnosticHandler; |
28 import 'package:compiler/src/tree/tree.dart'; | 29 import 'package:compiler/src/tree/tree.dart'; |
29 import 'package:compiler/src/universe/universe.dart' show | 30 import 'package:compiler/src/universe/universe.dart' show |
30 CallStructure; | 31 CallStructure; |
31 import 'package:expect/expect.dart'; | 32 import 'package:expect/expect.dart'; |
32 | 33 |
33 import 'memory_compiler.dart'; | 34 import 'memory_compiler.dart'; |
34 | 35 |
35 main(List<String> arguments) { | 36 main(List<String> arguments) { |
36 bool verbose = arguments.contains('-v'); | 37 bool verbose = arguments.contains('-v'); |
37 | 38 |
38 List<String> options = <String>[ | 39 List<String> options = <String>[ |
39 '--analyze-only', | 40 Flags.analyzeOnly, |
40 '--analyze-main', | 41 Flags.analyzeMain, |
41 '--categories=Client,Server']; | 42 '--categories=Client,Server']; |
42 if (verbose) { | 43 if (verbose) { |
43 options.add('--verbose'); | 44 options.add(Flags.verbose); |
44 } | 45 } |
45 asyncTest(() async { | 46 asyncTest(() async { |
46 Compiler compiler = compilerFor( | 47 Compiler compiler = compilerFor( |
47 options: options, showDiagnostics: verbose); | 48 options: options, showDiagnostics: verbose); |
48 FormattingDiagnosticHandler diagnostics = | 49 FormattingDiagnosticHandler diagnostics = |
49 new FormattingDiagnosticHandler(compiler.provider); | 50 new FormattingDiagnosticHandler(compiler.provider); |
50 HelperAnalyzer analyzer = new HelperAnalyzer(diagnostics); | 51 HelperAnalyzer analyzer = new HelperAnalyzer(diagnostics); |
51 Directory dir = | 52 Directory dir = |
52 new Directory.fromUri(Uri.base.resolve('pkg/compiler/lib/')); | 53 new Directory.fromUri(Uri.base.resolve('pkg/compiler/lib/')); |
53 for (FileSystemEntity entity in dir.listSync(recursive: true)) { | 54 for (FileSystemEntity entity in dir.listSync(recursive: true)) { |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 227 } |
227 | 228 |
228 @override | 229 @override |
229 void visitConstConstructorInvoke( | 230 void visitConstConstructorInvoke( |
230 NewExpression node, | 231 NewExpression node, |
231 ConstructedConstantExpression constant, | 232 ConstructedConstantExpression constant, |
232 _) { | 233 _) { |
233 checkAccess(node, constant.target); | 234 checkAccess(node, constant.target); |
234 } | 235 } |
235 } | 236 } |
OLD | NEW |