| 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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 tag == 'select' && (name == 'selectedindex' || name == 'value') || | 547 tag == 'select' && (name == 'selectedindex' || name == 'value') || |
| 548 tag == 'textarea' && name == 'value'); | 548 tag == 'textarea' && name == 'value'); |
| 549 } | 549 } |
| 550 for (var exp in bindings.expressions) { | 550 for (var exp in bindings.expressions) { |
| 551 _addExpression(exp, isEvent, isTwoWay, node.sourceSpan); | 551 _addExpression(exp, isEvent, isTwoWay, node.sourceSpan); |
| 552 } | 552 } |
| 553 }); | 553 }); |
| 554 } | 554 } |
| 555 | 555 |
| 556 void _addExpression(String stringExpression, bool inEvent, bool isTwoWay, | 556 void _addExpression(String stringExpression, bool inEvent, bool isTwoWay, |
| 557 SourceSpan span) { | 557 span) { |
| 558 | 558 |
| 559 if (inEvent) { | 559 if (inEvent) { |
| 560 if (stringExpression.startsWith('@')) { | 560 if (stringExpression.startsWith('@')) { |
| 561 logger.warning('event bindings with @ are no longer supported', | 561 logger.warning('event bindings with @ are no longer supported', |
| 562 span: span); | 562 span: span); |
| 563 return; | 563 return; |
| 564 } | 564 } |
| 565 | 565 |
| 566 if (stringExpression == '') return; | 566 if (stringExpression == '') return; |
| 567 generator.addGetter(stringExpression); | 567 generator.addGetter(stringExpression); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 for (var c in combinators) { | 766 for (var c in combinators) { |
| 767 if (c is ShowElementCombinator) { | 767 if (c is ShowElementCombinator) { |
| 768 var show = c.shownNames.toSet(); | 768 var show = c.shownNames.toSet(); |
| 769 elements.retainWhere((e) => show.contains(e.displayName)); | 769 elements.retainWhere((e) => show.contains(e.displayName)); |
| 770 } else if (c is HideElementCombinator) { | 770 } else if (c is HideElementCombinator) { |
| 771 var hide = c.hiddenNames.toSet(); | 771 var hide = c.hiddenNames.toSet(); |
| 772 elements.removeWhere((e) => hide.contains(e.displayName)); | 772 elements.removeWhere((e) => hide.contains(e.displayName)); |
| 773 } | 773 } |
| 774 } | 774 } |
| 775 } | 775 } |
| OLD | NEW |