Chromium Code Reviews| 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); |