OLD | NEW |
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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 withAnnotations: [types.publishedElement, types.observableElement])); | 262 withAnnotations: [types.publishedElement, types.observableElement])); |
263 | 263 |
264 for (var tagName in tagNames) { | 264 for (var tagName in tagNames) { |
265 // Include an initializer that will call Polymer.register | 265 // Include an initializer that will call Polymer.register |
266 initializers.add(new _CustomTagInitializer(id, tagName, cls.displayName)); | 266 initializers.add(new _CustomTagInitializer(id, tagName, cls.displayName)); |
267 | 267 |
268 // Include also properties published via the `attributes` attribute. | 268 // Include also properties published via the `attributes` attribute. |
269 var attrs = publishedAttributes[tagName]; | 269 var attrs = publishedAttributes[tagName]; |
270 if (attrs == null) continue; | 270 if (attrs == null) continue; |
271 for (var attr in attrs) { | 271 for (var attr in attrs) { |
272 recorder.lookupMember(cls, attr, recursive: true); | 272 recorder.lookupMember(cls, attr, recursive: true, |
| 273 includeUpTo: types.htmlElementElement); |
273 } | 274 } |
274 } | 275 } |
275 } | 276 } |
276 | 277 |
277 /// Determines if [cls] or a supertype has a mixin of the Polymer class. | 278 /// Determines if [cls] or a supertype has a mixin of the Polymer class. |
278 bool _hasPolymerMixin(ClassElement cls) { | 279 bool _hasPolymerMixin(ClassElement cls) { |
279 while (cls != types.htmlElementElement) { | 280 while (cls != types.htmlElementElement) { |
280 for (var m in cls.mixins) { | 281 for (var m in cls.mixins) { |
281 if (m.element == types.polymerClassElement) return true; | 282 if (m.element == types.polymerClassElement) return true; |
282 } | 283 } |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 for (var c in combinators) { | 707 for (var c in combinators) { |
707 if (c is ShowElementCombinator) { | 708 if (c is ShowElementCombinator) { |
708 var show = c.shownNames.toSet(); | 709 var show = c.shownNames.toSet(); |
709 elements.retainWhere((e) => show.contains(e.displayName)); | 710 elements.retainWhere((e) => show.contains(e.displayName)); |
710 } else if (c is HideElementCombinator) { | 711 } else if (c is HideElementCombinator) { |
711 var hide = c.hiddenNames.toSet(); | 712 var hide = c.hiddenNames.toSet(); |
712 elements.removeWhere((e) => hide.contains(e.displayName)); | 713 elements.removeWhere((e) => hide.contains(e.displayName)); |
713 } | 714 } |
714 } | 715 } |
715 } | 716 } |
OLD | NEW |