fix(dart/transform): Write correct ng_deps without deferred imports

Previously, the presence of a `deferred` import would cause us to output
incomplete `.ng_deps.dart` code.

Closes #4587
This commit is contained in:
Tim Blasi
2015-10-07 10:53:06 -07:00
parent 5600a95e97
commit c94f239536
3 changed files with 59 additions and 8 deletions

View File

@ -140,15 +140,13 @@ abstract class NgDepsWriterMixin
..prefix = REFLECTOR_PREFIX);
// We do not support `partUris`, so skip outputting them.
for (var importModel in model.imports) {
// Ignore deferred imports here so as to not load the deferred libraries
// code in the current library causing much of the code to not be
// deferred. Instead `DeferredRewriter` will rewrite the code as to load
// `ng_deps` in a deferred way.
if (importModel.isDeferred) return;
writeImportModel(importModel);
}
// Ignore deferred imports here so as to not load the deferred libraries
// code in the current library causing much of the code to not be
// deferred. Instead `DeferredRewriter` will rewrite the code as to load
// `ng_deps` in a deferred way.
model.imports.where((i) => !i.isDeferred).forEach(writeImportModel);
writeExportModel(new ExportModel()..uri = model.sourceFile);
model.exports.forEach(writeExportModel);