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

Unified Diff: pkg/compiler/lib/src/kernel/task.dart

Issue 2691753002: Add deferred loading to Kernel. (Closed)
Patch Set: sra's comments Created 3 years, 10 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: pkg/compiler/lib/src/kernel/task.dart
diff --git a/pkg/compiler/lib/src/kernel/task.dart b/pkg/compiler/lib/src/kernel/task.dart
index 42f439b6761b321c085c66e91974a8f0c51699f4..6b0cfdbdbe747eeffc34d6b7e9c097931102084a 100644
--- a/pkg/compiler/lib/src/kernel/task.dart
+++ b/pkg/compiler/lib/src/kernel/task.dart
@@ -37,8 +37,11 @@ class KernelTask extends CompilerTask {
///
/// May enqueue more elements to the resolution queue.
ir.Program buildProgram(LibraryElement library) {
+ var main = library.findExported(Identifiers.main);
+ if (main == null) {
+ main = _compiler.backend.helperForMissingMain();
+ }
return new ir.Program(kernel.libraryDependencies(library.canonicalUri))
- ..mainMethod =
- kernel.functionToIr(library.findExported(Identifiers.main));
+ ..mainMethod = kernel.functionToIr(main);
}
}

Powered by Google App Engine
This is Rietveld 408576698