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

Unified Diff: tests/compiler/dart2js/memory_compiler.dart

Issue 2760923004: Eliminate multi-callback structure for LibraryLoader. (Closed)
Patch Set: . Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/memory_compiler.dart
diff --git a/tests/compiler/dart2js/memory_compiler.dart b/tests/compiler/dart2js/memory_compiler.dart
index 9137c9085b9566928876aea818f9830c6999d4c2..94ba2931cb8062f3543b1ebcd33d076476adb00d 100644
--- a/tests/compiler/dart2js/memory_compiler.dart
+++ b/tests/compiler/dart2js/memory_compiler.dart
@@ -15,6 +15,7 @@ import 'package:compiler/compiler_new.dart'
Diagnostic,
PackagesDiscoveryProvider;
import 'package:compiler/src/diagnostics/messages.dart' show Message;
+import 'package:compiler/src/elements/elements.dart' show LibraryElement;
import 'package:compiler/src/enqueue.dart' show ResolutionEnqueuer;
import 'package:compiler/src/null_compiler_output.dart' show NullCompilerOutput;
import 'package:compiler/src/library_loader.dart' show LoadedLibraries;
@@ -166,19 +167,10 @@ CompilerImpl compilerFor(
if (library.isPlatformLibrary) {
var libraryLoader = compiler.libraryLoader;
libraryLoader.mapLibrary(library);
- compiler.onLibraryCreated(library);
- compiler.onLibraryScanned(library, null);
- if (library.isPatched) {
- var patchLibrary = library.patch;
- compiler.onLibraryCreated(patchLibrary);
- compiler.onLibraryScanned(patchLibrary, null);
- }
copiedLibraries[library.canonicalUri] = library;
}
});
- // TODO(johnniwinther): Assert that no libraries are loaded lazily from
- // this call.
- compiler.onLibrariesLoaded(new MemoryLoadedLibraries(copiedLibraries));
+ compiler.processLoadedLibraries(new MemoryLoadedLibraries(copiedLibraries));
ResolutionEnqueuer resolutionEnqueuer = compiler.startResolution();
compiler.backend.constantCompilerTask
@@ -216,6 +208,7 @@ CompilerImpl compilerFor(
class MemoryLoadedLibraries implements LoadedLibraries {
final Map copiedLibraries;
+ final loader = null;
Siggi Cherem (dart-lang) 2017/03/24 17:40:28 delete?
MemoryLoadedLibraries(this.copiedLibraries);
@@ -223,16 +216,18 @@ class MemoryLoadedLibraries implements LoadedLibraries {
bool containsLibrary(Uri uri) => copiedLibraries.containsKey(uri);
@override
- void forEachImportChain(f, {callback}) {}
+ void forEachImportChain(f, {callback}) {
+ throw new UnimplementedError();
+ }
@override
- void forEachLibrary(f) {}
+ void forEachLibrary(f) => copiedLibraries.values.forEach(f);
@override
getLibrary(Uri uri) => copiedLibraries[uri];
@override
- Uri get rootUri => null;
+ LibraryElement get rootLibrary => copiedLibraries.values.first;
}
DiagnosticHandler createDiagnosticHandler(DiagnosticHandler diagnosticHandler,

Powered by Google App Engine
This is Rietveld 408576698