OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |