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

Side by Side Diff: pkg/polymer_expressions/lib/eval.dart

Issue 132403010: big update to observe, template_binding, polymer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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
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 library polymer_expressions.eval; 5 library polymer_expressions.eval;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 @MirrorsUsed(metaTargets: const [Reflectable, ObservableProperty], 10 @MirrorsUsed(metaTargets: const [Reflectable, ObservableProperty],
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 ExpressionObserver _parent; 242 ExpressionObserver _parent;
243 243
244 StreamSubscription _subscription; 244 StreamSubscription _subscription;
245 Object _value; 245 Object _value;
246 246
247 StreamController _controller = new StreamController.broadcast(); 247 StreamController _controller = new StreamController.broadcast();
248 Stream get onUpdate => _controller.stream; 248 Stream get onUpdate => _controller.stream;
249 249
250 ExpressionObserver(this._expr); 250 ExpressionObserver(this._expr);
251 251
252 Expression get expression => _expr;
253
252 Object get currentValue => _value; 254 Object get currentValue => _value;
253 255
254 update(Scope scope) => _updateSelf(scope); 256 update(Scope scope) => _updateSelf(scope);
255 257
256 _updateSelf(Scope scope) {} 258 _updateSelf(Scope scope) {}
257 259
258 _invalidate(Scope scope) { 260 _invalidate(Scope scope) {
259 _observe(scope); 261 _observe(scope);
260 if (_parent != null) { 262 if (_parent != null) {
261 _parent._invalidate(scope); 263 _parent._invalidate(scope);
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 * This does not work for calls that need to pass more than one argument. 745 * This does not work for calls that need to pass more than one argument.
744 */ 746 */
745 call(arg0) => mirror.invoke(symbol, [arg0], null).reflectee; 747 call(arg0) => mirror.invoke(symbol, [arg0], null).reflectee;
746 } 748 }
747 749
748 class EvalException implements Exception { 750 class EvalException implements Exception {
749 final String message; 751 final String message;
750 EvalException(this.message); 752 EvalException(this.message);
751 String toString() => "EvalException: $message"; 753 String toString() => "EvalException: $message";
752 } 754 }
OLDNEW
« no previous file with comments | « pkg/polymer_expressions/example/streams/collect_key_press.html ('k') | pkg/polymer_expressions/lib/polymer_expressions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698