Chromium Code Reviews| Index: pkg/compiler/lib/src/deferred_load.dart |
| diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart |
| index 66e73c309adc9454905ccbf67559661f267a9644..3500f9869c15a80708c32410978b80f3c163f279 100644 |
| --- a/pkg/compiler/lib/src/deferred_load.dart |
| +++ b/pkg/compiler/lib/src/deferred_load.dart |
| @@ -661,7 +661,7 @@ class DeferredLoadTask extends CompilerTask { |
| } |
| } |
| - void onResolutionComplete(FunctionElement main) { |
| + void onResolutionComplete(MethodElement main) { |
| if (!isProgramSplit) { |
| allOutputUnits.add(mainOutputUnit); |
| return; |
| @@ -677,8 +677,7 @@ class DeferredLoadTask extends CompilerTask { |
| () => measure(() { |
| // Starting from main, traverse the program and find all |
| // dependencies. |
| - _mapDependencies( |
| - element: compiler.mainFunction, import: _fakeMainImport); |
| + _mapDependencies(element: main, import: _fakeMainImport); |
| // Also add "global" dependencies to the main OutputUnit. These |
| // are things that the backend needs but cannot associate with a |
| @@ -771,6 +770,8 @@ class DeferredLoadTask extends CompilerTask { |
| void beforeResolution(Compiler compiler) { |
| if (compiler.mainApp == null) return; |
| + // TODO(johnniwinther): Support deferred load for kernel based elements. |
| + if (compiler.mainApp is! LibraryElement) return; |
|
Siggi Cherem (dart-lang)
2017/04/26 16:39:18
to make this easier to read, I'd switch this to:
Johnni Winther
2017/04/27 06:50:14
Done.
|
| _allDeferredImports[_fakeMainImport] = compiler.mainApp; |
| var lastDeferred; |
| // When detecting duplicate prefixes of deferred libraries there are 4 |