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

Unified Diff: pkg/compiler/lib/src/js_emitter/program_builder.dart

Issue 851683004: dart2js: register output units explicitly in the program builder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 11 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 | « no previous file | pkg/compiler/lib/src/js_emitter/registry.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/program_builder.dart
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder.dart
index ead4a315a6e4625d0a5a1a457d65e54b3a4dc398..55786fc4a0d19743028c47b938c44d9ffdab6001 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder.dart
@@ -58,6 +58,11 @@ class ProgramBuilder {
final Map<ConstantValue, Constant> _constants = <ConstantValue, Constant>{};
Program buildProgram() {
+ // Note: In rare cases (mostly tests) output units can be empty. This
+ // happens when the deferred code is dead-code eliminated but we still need
+ // to check that the library has been loaded.
+ _compiler.deferredLoadTask.allOutputUnits.forEach(
+ _registry.registerOutputUnit);
_task.outputClassLists.forEach(_registry.registerElements);
_task.outputStaticLists.forEach(_registry.registerElements);
_task.outputConstantLists.forEach(_registerConstants);
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/registry.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698