Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1200)

Side by Side Diff: tests/compiler/dart2js/memory_compiler.dart

Issue 356573002: Revert "Move Compiler.libraries to LibraryLoder." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 'memory_source_file_helper.dart'; 7 import 'memory_source_file_helper.dart';
8 8
9 import 'package:compiler/implementation/dart2jslib.dart' 9 import 'package:compiler/implementation/dart2jslib.dart'
10 show NullSink; 10 show NullSink;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 158
159 Compiler compiler = new Compiler(readStringFromUri, 159 Compiler compiler = new Compiler(readStringFromUri,
160 outputProvider, 160 outputProvider,
161 handler, 161 handler,
162 libraryRoot, 162 libraryRoot,
163 packageRoot, 163 packageRoot,
164 options, 164 options,
165 {}); 165 {});
166 if (cachedCompiler != null) { 166 if (cachedCompiler != null) {
167 compiler.coreLibrary = 167 compiler.coreLibrary = cachedCompiler.libraries['dart:core'];
168 cachedCompiler.libraryLoader.lookupLibrary(Uri.parse('dart:core'));
169 compiler.types = cachedCompiler.types.copy(compiler); 168 compiler.types = cachedCompiler.types.copy(compiler);
170 Map copiedLibraries = {}; 169 Map copiedLibraries = {};
171 cachedCompiler.libraryLoader.libraries.forEach((library) { 170 cachedCompiler.libraries.forEach((String uri, library) {
172 if (library.isPlatformLibrary) { 171 if (library.isPlatformLibrary) {
173 compiler.libraryLoader.mapLibrary(library);
174 compiler.onLibraryCreated(library); 172 compiler.onLibraryCreated(library);
173 compiler.libraries[uri] = library;
174 // TODO(johnniwinther): Assert that no libraries are created lazily from
175 // this call.
175 compiler.onLibraryScanned(library, null); 176 compiler.onLibraryScanned(library, null);
176 if (library.isPatched) { 177 if (library.isPatched) {
177 var patchLibrary = library.patch; 178 var patchLibrary = library.patch;
178 compiler.onLibraryCreated(patchLibrary); 179 compiler.onLibraryCreated(patchLibrary);
180 // TODO(johnniwinther): Assert that no libraries are created lazily
181 // from this call.
179 compiler.onLibraryScanned(patchLibrary, null); 182 compiler.onLibraryScanned(patchLibrary, null);
180 } 183 }
181 copiedLibraries[library.canonicalUri] = library; 184 copiedLibraries[library.canonicalUri] = library;
182 } 185 }
183 }); 186 });
184 // TODO(johnniwinther): Assert that no libraries are loaded lazily from 187 // TODO(johnniwinther): Assert that no libraries are loaded lazily from
185 // this call. 188 // this call.
186 compiler.onLibrariesLoaded(copiedLibraries); 189 compiler.onLibrariesLoaded(copiedLibraries);
187 190
188 compiler.symbolConstructor = cachedCompiler.symbolConstructor; 191 compiler.symbolConstructor = cachedCompiler.symbolConstructor;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics); 248 createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics);
246 249
247 List<Uri> libraries = <Uri>[]; 250 List<Uri> libraries = <Uri>[];
248 memorySourceFiles.forEach((String path, _) { 251 memorySourceFiles.forEach((String path, _) {
249 libraries.add(new Uri(scheme: 'memory', path: path)); 252 libraries.add(new Uri(scheme: 'memory', path: path));
250 }); 253 });
251 254
252 return analyze(libraries, libraryRoot, packageRoot, 255 return analyze(libraries, libraryRoot, packageRoot,
253 provider, handler, options); 256 provider, handler, options);
254 } 257 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/in_user_code_test.dart ('k') | tests/compiler/dart2js/metadata_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698