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

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

Issue 278413002: Fix code generation in polymer: we avoided generating types above HtmlElement in (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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
« no previous file with comments | « pkg/pkg.status ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « pkg/pkg.status ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698