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

Unified Diff: pkg/polymer/lib/src/build/script_compactor.dart

Issue 700733002: Track initializers already seen (fixes #21439) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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/polymer/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/build/script_compactor.dart
diff --git a/pkg/polymer/lib/src/build/script_compactor.dart b/pkg/polymer/lib/src/build/script_compactor.dart
index 20d805287fcc472d0d4c662559f97d5fdd5647fc..16bd7c750d2dd916c745086e3e8b6ff14a9d6216 100644
--- a/pkg/polymer/lib/src/build/script_compactor.dart
+++ b/pkg/polymer/lib/src/build/script_compactor.dart
@@ -249,13 +249,19 @@ class _ScriptCompactor extends PolymerTransformer {
// Process all classes and top-level functions to include initializers,
// register custom elements, and include special fields and methods in
// custom element classes.
+ var functionsSeen = new Set<FunctionElement>();
+ var classesSeen = new Set<ClassElement>();
for (var id in entryLibraries) {
var lib = resolver.getLibrary(id);
for (var fun in _visibleTopLevelMethodsOf(lib)) {
+ if (functionsSeen.contains(fun)) continue;
+ functionsSeen.add(fun);
_processFunction(fun, id);
}
for (var cls in _visibleClassesOf(lib)) {
+ if (classesSeen.contains(cls)) continue;
+ classesSeen.add(cls);
_processClass(cls, id, recorder);
}
}
@@ -824,8 +830,7 @@ List<FunctionElement> _visibleTopLevelMethodsOf(LibraryElement lib) {
var result = [];
result.addAll(lib.units.expand((u) => u.functions));
for (var e in lib.exports) {
- var exported = e.exportedLibrary.units
- .expand((u) => u.functions).toList();
+ var exported = e.exportedLibrary.units.expand((u) => u.functions).toList();
_filter(exported, e.combinators);
result.addAll(exported);
}
« no previous file with comments | « no previous file | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698