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

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

Issue 303003003: Fix 19029: handle special case when on-handler is empty in polymer, add better (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « pkg/polymer/lib/src/build/linter.dart ('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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 } 507 }
508 for (var exp in bindings.expressions) { 508 for (var exp in bindings.expressions) {
509 _addExpression(exp, isEvent, isTwoWay); 509 _addExpression(exp, isEvent, isTwoWay);
510 } 510 }
511 }); 511 });
512 } 512 }
513 513
514 void _addExpression(String stringExpression, bool inEvent, bool isTwoWay) { 514 void _addExpression(String stringExpression, bool inEvent, bool isTwoWay) {
515 if (inEvent) { 515 if (inEvent) {
516 if (!stringExpression.startsWith("@")) { 516 if (!stringExpression.startsWith("@")) {
517 if (stringExpression == '') return;
517 generator.addGetter(stringExpression); 518 generator.addGetter(stringExpression);
518 generator.addSymbol(stringExpression); 519 generator.addSymbol(stringExpression);
519 return; 520 return;
520 } 521 }
521 stringExpression = stringExpression.substring(1); 522 stringExpression = stringExpression.substring(1);
522 } 523 }
523 visitor.run(pe.parse(stringExpression), isTwoWay); 524 visitor.run(pe.parse(stringExpression), isTwoWay);
524 } 525 }
525 } 526 }
526 527
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 for (var c in combinators) { 720 for (var c in combinators) {
720 if (c is ShowElementCombinator) { 721 if (c is ShowElementCombinator) {
721 var show = c.shownNames.toSet(); 722 var show = c.shownNames.toSet();
722 elements.retainWhere((e) => show.contains(e.displayName)); 723 elements.retainWhere((e) => show.contains(e.displayName));
723 } else if (c is HideElementCombinator) { 724 } else if (c is HideElementCombinator) {
724 var hide = c.hiddenNames.toSet(); 725 var hide = c.hiddenNames.toSet();
725 elements.removeWhere((e) => hide.contains(e.displayName)); 726 elements.removeWhere((e) => hide.contains(e.displayName));
726 } 727 }
727 } 728 }
728 } 729 }
OLDNEW
« no previous file with comments | « pkg/polymer/lib/src/build/linter.dart ('k') | pkg/polymer/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698