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

Side by Side Diff: pkg/polymer/lib/src/build/script_compactor.dart

Issue 307793002: update polymer, nodebind, and templatebinding (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: roll Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Transfomer that combines multiple dart script tags into a single one. 5 /// Transfomer that combines multiple dart script tags into a single one.
6 library polymer.src.build.script_compactor; 6 library polymer.src.build.script_compactor;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:convert'; 9 import 'dart:convert';
10 10
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 for (var e in lib.exports) { 694 for (var e in lib.exports) {
695 var exported = e.exportedLibrary.units.expand((u) => u.types).toList(); 695 var exported = e.exportedLibrary.units.expand((u) => u.types).toList();
696 _filter(exported, e.combinators); 696 _filter(exported, e.combinators);
697 result.addAll(exported); 697 result.addAll(exported);
698 } 698 }
699 return result; 699 return result;
700 } 700 }
701 701
702 /// Retrieves all top-level methods that are visible if you were to import 702 /// Retrieves all top-level methods that are visible if you were to import
703 /// [lib]. This includes exported methods from other libraries too. 703 /// [lib]. This includes exported methods from other libraries too.
704 List<ClassElement> _visibleTopLevelMethodsOf(LibraryElement lib) { 704 List<FunctionElement> _visibleTopLevelMethodsOf(LibraryElement lib) {
Siggi Cherem (dart-lang) 2014/06/03 02:23:44 good catch. thanks
Jennifer Messerly 2014/06/04 04:42:16 :) yeah, thanks to the Editor!
705 var result = []; 705 var result = [];
706 result.addAll(lib.units.expand((u) => u.functions)); 706 result.addAll(lib.units.expand((u) => u.functions));
707 for (var e in lib.exports) { 707 for (var e in lib.exports) {
708 var exported = e.exportedLibrary.units 708 var exported = e.exportedLibrary.units
709 .expand((u) => u.functions).toList(); 709 .expand((u) => u.functions).toList();
710 _filter(exported, e.combinators); 710 _filter(exported, e.combinators);
711 result.addAll(exported); 711 result.addAll(exported);
712 } 712 }
713 return result; 713 return result;
714 } 714 }
715 715
716 /// Filters [elements] that come from an export, according to its show/hide 716 /// Filters [elements] that come from an export, according to its show/hide
717 /// combinators. This modifies [elements] in place. 717 /// combinators. This modifies [elements] in place.
718 void _filter(List<analyzer.Element> elements, 718 void _filter(List<analyzer.Element> elements,
719 List<NamespaceCombinator> combinators) { 719 List<NamespaceCombinator> combinators) {
720 for (var c in combinators) { 720 for (var c in combinators) {
721 if (c is ShowElementCombinator) { 721 if (c is ShowElementCombinator) {
722 var show = c.shownNames.toSet(); 722 var show = c.shownNames.toSet();
723 elements.retainWhere((e) => show.contains(e.displayName)); 723 elements.retainWhere((e) => show.contains(e.displayName));
724 } else if (c is HideElementCombinator) { 724 } else if (c is HideElementCombinator) {
725 var hide = c.hiddenNames.toSet(); 725 var hide = c.hiddenNames.toSet();
726 elements.removeWhere((e) => hide.contains(e.displayName)); 726 elements.removeWhere((e) => hide.contains(e.displayName));
727 } 727 }
728 } 728 }
729 } 729 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698