| 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 dart2js.test.memory_compiler; | 5 library dart2js.test.memory_compiler; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:compiler/compiler.dart' show | 9 import 'package:compiler/compiler.dart' show |
| 10 DiagnosticHandler; | 10 DiagnosticHandler; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } | 74 } |
| 75 | 75 |
| 76 Iterable<DiagnosticMessage> get infos { | 76 Iterable<DiagnosticMessage> get infos { |
| 77 return filterMessagesByKinds([Diagnostic.INFO]); | 77 return filterMessagesByKinds([Diagnostic.INFO]); |
| 78 } | 78 } |
| 79 | 79 |
| 80 /// `true` if non-verbose messages has been collected. | 80 /// `true` if non-verbose messages has been collected. |
| 81 bool get hasRegularMessages { | 81 bool get hasRegularMessages { |
| 82 return messages.any((m) => m.kind != Diagnostic.VERBOSE_INFO); | 82 return messages.any((m) => m.kind != Diagnostic.VERBOSE_INFO); |
| 83 } | 83 } |
| 84 |
| 85 void clear() { |
| 86 messages.clear(); |
| 87 } |
| 84 } | 88 } |
| 85 | 89 |
| 86 class MultiDiagnostics implements CompilerDiagnostics { | 90 class MultiDiagnostics implements CompilerDiagnostics { |
| 87 final List<CompilerDiagnostics> diagnosticsList; | 91 final List<CompilerDiagnostics> diagnosticsList; |
| 88 | 92 |
| 89 const MultiDiagnostics([this.diagnosticsList = const []]); | 93 const MultiDiagnostics([this.diagnosticsList = const []]); |
| 90 | 94 |
| 91 @override | 95 @override |
| 92 void report(Message message, Uri uri, int begin, int end, | 96 void report(Message message, Uri uri, int begin, int end, |
| 93 String text, Diagnostic kind) { | 97 String text, Diagnostic kind) { |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics); | 331 createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics); |
| 328 | 332 |
| 329 List<Uri> libraries = <Uri>[]; | 333 List<Uri> libraries = <Uri>[]; |
| 330 memorySourceFiles.forEach((String path, _) { | 334 memorySourceFiles.forEach((String path, _) { |
| 331 libraries.add(new Uri(scheme: 'memory', path: path)); | 335 libraries.add(new Uri(scheme: 'memory', path: path)); |
| 332 }); | 336 }); |
| 333 | 337 |
| 334 return analyze(libraries, libraryRoot, packageRoot, | 338 return analyze(libraries, libraryRoot, packageRoot, |
| 335 provider, handler, options); | 339 provider, handler, options); |
| 336 } | 340 } |
| OLD | NEW |