| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 CompilerDiagnostics diagnosticHandler, | 73 CompilerDiagnostics diagnosticHandler, |
| 74 CompilerOutput outputProvider, | 74 CompilerOutput outputProvider, |
| 75 List<String> options: const <String>[], | 75 List<String> options: const <String>[], |
| 76 CompilerImpl cachedCompiler, | 76 CompilerImpl cachedCompiler, |
| 77 bool showDiagnostics: true, | 77 bool showDiagnostics: true, |
| 78 Uri packageRoot, | 78 Uri packageRoot, |
| 79 Uri packageConfig, | 79 Uri packageConfig, |
| 80 PackagesDiscoveryProvider packagesDiscoveryProvider, | 80 PackagesDiscoveryProvider packagesDiscoveryProvider, |
| 81 void beforeRun(CompilerImpl compiler)}) async { | 81 void beforeRun(CompilerImpl compiler)}) async { |
| 82 if (entryPoint == null) { | 82 if (entryPoint == null) { |
| 83 if (options.contains('--read-dill')) { | 83 entryPoint = Uri.parse('memory:main.dart'); |
| 84 entryPoint = Uri.parse('memory:main.dill'); | |
| 85 } else { | |
| 86 entryPoint = Uri.parse('memory:main.dart'); | |
| 87 } | |
| 88 } | 84 } |
| 89 CompilerImpl compiler = compilerFor( | 85 CompilerImpl compiler = compilerFor( |
| 90 entryPoint: entryPoint, | 86 entryPoint: entryPoint, |
| 91 resolutionInputs: resolutionInputs, | 87 resolutionInputs: resolutionInputs, |
| 92 memorySourceFiles: memorySourceFiles, | 88 memorySourceFiles: memorySourceFiles, |
| 93 diagnosticHandler: diagnosticHandler, | 89 diagnosticHandler: diagnosticHandler, |
| 94 outputProvider: outputProvider, | 90 outputProvider: outputProvider, |
| 95 options: options, | 91 options: options, |
| 96 cachedCompiler: cachedCompiler, | 92 cachedCompiler: cachedCompiler, |
| 97 showDiagnostics: showDiagnostics, | 93 showDiagnostics: showDiagnostics, |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 handler = (Uri uri, int begin, int end, String message, Diagnostic kind) { | 243 handler = (Uri uri, int begin, int end, String message, Diagnostic kind) { |
| 248 diagnosticHandler(uri, begin, end, message, kind); | 244 diagnosticHandler(uri, begin, end, message, kind); |
| 249 formattingHandler(uri, begin, end, message, kind); | 245 formattingHandler(uri, begin, end, message, kind); |
| 250 }; | 246 }; |
| 251 } | 247 } |
| 252 } else if (diagnosticHandler == null) { | 248 } else if (diagnosticHandler == null) { |
| 253 handler = (Uri uri, int begin, int end, String message, Diagnostic kind) {}; | 249 handler = (Uri uri, int begin, int end, String message, Diagnostic kind) {}; |
| 254 } | 250 } |
| 255 return handler; | 251 return handler; |
| 256 } | 252 } |
| OLD | NEW |