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

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

Issue 240633004: Fix bug in how we handle invoke expressions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 | « no previous file | pkg/polymer/test/build/script_compactor_test.dart » ('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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/polymer/test/build/script_compactor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698