| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 DiagnosticHandler; | 9 import 'package:compiler/compiler.dart' show DiagnosticHandler; |
| 10 import 'package:compiler/compiler_new.dart' | 10 import 'package:compiler/compiler_new.dart' |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 export 'output_collector.dart'; | 28 export 'output_collector.dart'; |
| 29 export 'package:compiler/compiler_new.dart' show CompilationResult; | 29 export 'package:compiler/compiler_new.dart' show CompilationResult; |
| 30 export 'diagnostic_helper.dart'; | 30 export 'diagnostic_helper.dart'; |
| 31 | 31 |
| 32 class MultiDiagnostics implements CompilerDiagnostics { | 32 class MultiDiagnostics implements CompilerDiagnostics { |
| 33 final List<CompilerDiagnostics> diagnosticsList; | 33 final List<CompilerDiagnostics> diagnosticsList; |
| 34 | 34 |
| 35 const MultiDiagnostics([this.diagnosticsList = const []]); | 35 const MultiDiagnostics([this.diagnosticsList = const []]); |
| 36 | 36 |
| 37 @override | 37 @override |
| 38 void report(Message message, Uri uri, int begin, int end, String text, | 38 void report(covariant Message message, Uri uri, int begin, int end, |
| 39 Diagnostic kind) { | 39 String text, Diagnostic kind) { |
| 40 for (CompilerDiagnostics diagnostics in diagnosticsList) { | 40 for (CompilerDiagnostics diagnostics in diagnosticsList) { |
| 41 diagnostics.report(message, uri, begin, end, text, kind); | 41 diagnostics.report(message, uri, begin, end, text, kind); |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| 46 CompilerDiagnostics createCompilerDiagnostics( | 46 CompilerDiagnostics createCompilerDiagnostics( |
| 47 CompilerDiagnostics diagnostics, SourceFileProvider provider, | 47 CompilerDiagnostics diagnostics, SourceFileProvider provider, |
| 48 {bool showDiagnostics: true, bool verbose: false}) { | 48 {bool showDiagnostics: true, bool verbose: false}) { |
| 49 CompilerDiagnostics handler = diagnostics; | 49 CompilerDiagnostics handler = diagnostics; |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 handler = (Uri uri, int begin, int end, String message, Diagnostic kind) { | 250 handler = (Uri uri, int begin, int end, String message, Diagnostic kind) { |
| 251 diagnosticHandler(uri, begin, end, message, kind); | 251 diagnosticHandler(uri, begin, end, message, kind); |
| 252 formattingHandler(uri, begin, end, message, kind); | 252 formattingHandler(uri, begin, end, message, kind); |
| 253 }; | 253 }; |
| 254 } | 254 } |
| 255 } else if (diagnosticHandler == null) { | 255 } else if (diagnosticHandler == null) { |
| 256 handler = (Uri uri, int begin, int end, String message, Diagnostic kind) {}; | 256 handler = (Uri uri, int begin, int end, String message, Diagnostic kind) {}; |
| 257 } | 257 } |
| 258 return handler; | 258 return handler; |
| 259 } | 259 } |
| OLD | NEW |