| 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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 super.visitIdentifier(e); | 533 super.visitIdentifier(e); |
| 534 } | 534 } |
| 535 | 535 |
| 536 visitGetter(pe.Getter e) { | 536 visitGetter(pe.Getter e) { |
| 537 _add(e.name); | 537 _add(e.name); |
| 538 super.visitGetter(e); | 538 super.visitGetter(e); |
| 539 } | 539 } |
| 540 | 540 |
| 541 visitInvoke(pe.Invoke e) { | 541 visitInvoke(pe.Invoke e) { |
| 542 _includeSetter = false; // Invoke is only valid as an r-value. | 542 _includeSetter = false; // Invoke is only valid as an r-value. |
| 543 _add(e.method); | 543 if (e.method != null) _add(e.method); |
| 544 super.visitInvoke(e); | 544 super.visitInvoke(e); |
| 545 } | 545 } |
| 546 } | 546 } |
| 547 | 547 |
| 548 /// Parses and collects information about bindings found in polymer templates. | 548 /// Parses and collects information about bindings found in polymer templates. |
| 549 class _Mustaches { | 549 class _Mustaches { |
| 550 /// Each expression that appears within `{{...}}` and `[[...]]`. | 550 /// Each expression that appears within `{{...}}` and `[[...]]`. |
| 551 final List<String> expressions; | 551 final List<String> expressions; |
| 552 | 552 |
| 553 /// Whether the whole text returned by [parse] was a single expression. | 553 /// Whether the whole text returned by [parse] was a single expression. |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 for (var c in combinators) { | 689 for (var c in combinators) { |
| 690 if (c is ShowElementCombinator) { | 690 if (c is ShowElementCombinator) { |
| 691 var show = c.shownNames.toSet(); | 691 var show = c.shownNames.toSet(); |
| 692 elements.retainWhere((e) => show.contains(e.displayName)); | 692 elements.retainWhere((e) => show.contains(e.displayName)); |
| 693 } else if (c is HideElementCombinator) { | 693 } else if (c is HideElementCombinator) { |
| 694 var hide = c.hiddenNames.toSet(); | 694 var hide = c.hiddenNames.toSet(); |
| 695 elements.removeWhere((e) => hide.contains(e.displayName)); | 695 elements.removeWhere((e) => hide.contains(e.displayName)); |
| 696 } | 696 } |
| 697 } | 697 } |
| 698 } | 698 } |
| OLD | NEW |