| 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |