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

Unified Diff: pkg/front_end/lib/src/incremental_kernel_generator_impl.dart

Issue 2926933002: Skip directly to the last library to set the entry point and check importUri (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
diff --git a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
index 39930073fdf8a50070e64340bbb26d9eb9c59f9c..477c07b61dae337d7f3c4272924039f7f07ab828 100644
--- a/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
+++ b/pkg/front_end/lib/src/incremental_kernel_generator_impl.dart
@@ -136,13 +136,12 @@ class IncrementalKernelGeneratorImpl implements IncrementalKernelGenerator {
// that imports a changed one, is affected.
// Set the main method.
- for (var library in program.libraries) {
- if (library.fileUri == _entryPoint.toString()) {
- program.mainMethod = library.procedures.firstWhere(
- (procedure) => procedure.name.name == 'main',
- orElse: () => null);
- break;
- }
+ if (program.libraries.isNotEmpty) {
+ var entryLibrary = program.libraries.last;
scheglov 2017/06/07 21:31:16 I thought about doing this, but decided that this
Siggi Cherem (dart-lang) 2017/06/07 21:36:10 Good point, what do you think of either of these t
scheglov 2017/06/07 21:38:42 Yeah, we know for sure that it is in the last resu
+ assert(entryLibrary.importUri == _entryPoint);
+ program.mainMethod = entryLibrary.procedures.firstWhere(
+ (procedure) => procedure.name.name == 'main',
+ orElse: () => null);
}
return new DeltaProgram(program);
« no previous file with comments | « pkg/front_end/example/incremental_reload/compiler_with_invalidation.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698