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

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

Issue 336013003: Version 1.5.0-dev.4.14 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 6 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 | « dart/pkg/polymer_expressions/lib/parser.dart ('k') | dart/pkg/polymer_expressions/lib/tokenizer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/polymer_expressions/lib/polymer_expressions.dart
===================================================================
--- dart/pkg/polymer_expressions/lib/polymer_expressions.dart (revision 37358)
+++ dart/pkg/polymer_expressions/lib/polymer_expressions.dart (working copy)
@@ -143,8 +143,6 @@
};
}
- // We have an ident, so it's a bind/as or repeat/in expression
- assert(templateBind(template).templateInstance == null);
return (model) {
var existingScope = _scopes[template];
if (existingScope != null) {
@@ -257,15 +255,13 @@
typedef Object _Converter(Object);
class _Binding extends Bindable {
- static int __seq = 1;
-
- final int _seq = __seq++;
-
final Scope _scope;
final _Converter _converter;
final Expression _expr;
+
Function _callback;
StreamSubscription _sub;
+ ExpressionObserver _observer;
var _value;
_Binding(this._expr, this._scope, [converter])
@@ -311,19 +307,19 @@
if (_callback != null) throw new StateError('already open');
_callback = callback;
- final expr = observe(_expr, _scope);
-// _expr = expr;
- _sub = expr.onUpdate.listen(_check)..onError((e, s) {
+ _observer = observe(_expr, _scope);
+ _sub = _observer.onUpdate.listen(_check)..onError((e, s) {
new Completer().completeError(
- "Error evaluating expression '$expr': $e", s);
+ "Error evaluating expression '$_observer': $e", s);
});
+
try {
// this causes a call to _updateValue with the new value
- update(expr, _scope);
- _check(expr.currentValue, skipChanges: true);
+ update(_observer, _scope);
+ _check(_observer.currentValue, skipChanges: true);
} catch (e, s) {
new Completer().completeError(
- "Error evaluating expression '$expr': $e", s);
+ "Error evaluating expression '$_observer': $e", s);
}
return _value;
}
@@ -334,6 +330,9 @@
_sub.cancel();
_sub = null;
_callback = null;
+
+ new Closer().visit(_observer);
+ _observer = null;
}
}
« no previous file with comments | « dart/pkg/polymer_expressions/lib/parser.dart ('k') | dart/pkg/polymer_expressions/lib/tokenizer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698