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

Unified Diff: pkg/polymer_expressions/lib/eval.dart

Issue 308563002: Fix polymer_expression binding bug with observable list (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/polymer_expressions/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer_expressions/lib/eval.dart
diff --git a/pkg/polymer_expressions/lib/eval.dart b/pkg/polymer_expressions/lib/eval.dart
index c33a262ad510831dbd9f5b56dc0c55a8bc8f18a4..c5c68baf9a5f23fb2da93fdb9a53bb6c415d4166 100644
--- a/pkg/polymer_expressions/lib/eval.dart
+++ b/pkg/polymer_expressions/lib/eval.dart
@@ -650,7 +650,14 @@ class IndexObserver extends ExpressionObserver<Index> implements Index {
var key = argument._value;
_value = receiverValue[key];
- if (receiverValue is Observable) {
+ if (receiverValue is ObservableList) {
+ _subscription = (receiverValue as ObservableList).listChanges
+ .listen((changes) {
+ if (changes.any((c) => c is ListChangeRecord && c.indexChanged(key))) {
Jennifer Messerly 2014/05/29 02:38:11 type test isn't needed here... listChanges are onl
Siggi Cherem (dart-lang) 2014/05/29 03:11:33 nice :). done
+ _invalidate(scope);
+ }
+ });
+ } else if (receiverValue is Observable) {
_subscription = (receiverValue as Observable).changes.listen((changes) {
if (changes.any((c) => c is MapChangeRecord && c.key == key)) {
_invalidate(scope);
« no previous file with comments | « no previous file | pkg/polymer_expressions/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698