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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 packageRoot: packageRoot, | 166 packageRoot: packageRoot, |
167 options: options, | 167 options: options, |
168 environment: {}, | 168 environment: {}, |
169 packageConfig: packageConfig, | 169 packageConfig: packageConfig, |
170 packagesDiscoveryProvider: packagesDiscoveryProvider)); | 170 packagesDiscoveryProvider: packagesDiscoveryProvider)); |
171 | 171 |
172 if (cachedCompiler != null) { | 172 if (cachedCompiler != null) { |
173 Types types = cachedCompiler.types; | 173 Types types = cachedCompiler.types; |
174 compiler.types = types.copy(compiler.resolution); | 174 compiler.types = types.copy(compiler.resolution); |
175 Map copiedLibraries = {}; | 175 Map copiedLibraries = {}; |
176 cachedCompiler.libraryLoader.libraries.forEach((library) { | 176 cachedCompiler.libraryLoader.libraries.forEach((dynamic library) { |
177 if (library.isPlatformLibrary) { | 177 if (library.isPlatformLibrary) { |
178 var libraryLoader = compiler.libraryLoader; | 178 dynamic libraryLoader = compiler.libraryLoader; |
179 libraryLoader.mapLibrary(library); | 179 libraryLoader.mapLibrary(library); |
180 copiedLibraries[library.canonicalUri] = library; | 180 copiedLibraries[library.canonicalUri] = library; |
181 } | 181 } |
182 }); | 182 }); |
183 compiler.processLoadedLibraries(new MemoryLoadedLibraries(copiedLibraries)); | 183 compiler.processLoadedLibraries(new MemoryLoadedLibraries(copiedLibraries)); |
184 ResolutionEnqueuer resolutionEnqueuer = compiler.startResolution(); | 184 ResolutionEnqueuer resolutionEnqueuer = compiler.startResolution(); |
185 | 185 |
186 compiler.backend.constantCompilerTask | 186 compiler.backend.constantCompilerTask |
187 .copyConstantValues(cachedCompiler.backend.constantCompilerTask); | 187 .copyConstantValues(cachedCompiler.backend.constantCompilerTask); |
188 | 188 |
(...skipping 61 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 |