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

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

Issue 27618002: package:observe fix various api issues (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « pkg/polymer_expressions/example/person.dart ('k') | pkg/polymer_expressions/lib/polymer_expressions.dart » ('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 5c0c6e445ef720a847f28524686808b62be4124c..4f624b1d6b421f7b896c9408188a28e58fb1d3e5 100644
--- a/pkg/polymer_expressions/lib/eval.dart
+++ b/pkg/polymer_expressions/lib/eval.dart
@@ -420,20 +420,20 @@ class IdentifierObserver extends ExpressionObserver<Identifier>
IdentifierObserver(Identifier value) : super(value);
- dynamic get value => _expr.value;
+ String get value => (_expr as Identifier).value;
_updateSelf(Scope scope) {
- _value = scope[_expr.value];
+ _value = scope[value];
- var owner = scope.ownerOf(_expr.value);
+ var owner = scope.ownerOf(value);
if (owner is Observable) {
- _subscription = (owner as Observable).changes.listen(
- (List<ChangeRecord> changes) {
- var symbol = new Symbol(_expr.value);
- if (changes.any((c) => c.changes(symbol))) {
- _invalidate(scope);
- }
- });
+ var symbol = new Symbol(value);
+ _subscription = (owner as Observable).changes.listen((changes) {
+ if (changes.any(
+ (c) => c is PropertyChangeRecord && c.name == symbol)) {
+ _invalidate(scope);
+ }
+ });
}
}
@@ -545,7 +545,7 @@ class InvokeObserver extends ExpressionObserver<Invoke> implements Invoke {
_subscription = (receiverValue as Observable).changes.listen(
(List<ChangeRecord> changes) {
if (changes.any((c) =>
- c is MapChangeRecord && c.changes(key))) {
+ c is MapChangeRecord && c.key == key)) {
_invalidate(scope);
}
});
@@ -560,7 +560,8 @@ class InvokeObserver extends ExpressionObserver<Invoke> implements Invoke {
if (receiverValue is Observable) {
_subscription = (receiverValue as Observable).changes.listen(
(List<ChangeRecord> changes) {
- if (changes.any((c) => c.changes(symbol))) {
+ if (changes.any(
+ (c) => c is PropertyChangeRecord && c.name == symbol)) {
_invalidate(scope);
}
});
« no previous file with comments | « pkg/polymer_expressions/example/person.dart ('k') | pkg/polymer_expressions/lib/polymer_expressions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698