| 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 import 'dart:mirrors'; | 9 import 'dart:mirrors'; |
| 10 | 10 |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 _updateSelf(scope); | 252 _updateSelf(scope); |
| 253 | 253 |
| 254 if (!identical(_value, _oldValue)) { | 254 if (!identical(_value, _oldValue)) { |
| 255 _controller.add(_value); | 255 _controller.add(_value); |
| 256 } | 256 } |
| 257 } | 257 } |
| 258 | 258 |
| 259 String toString() => _expr.toString(); | 259 String toString() => _expr.toString(); |
| 260 } | 260 } |
| 261 | 261 |
| 262 class Updater extends RecursiveVisitor<ExpressionObserver> { | 262 class Updater extends RecursiveVisitor { |
| 263 final Scope scope; | 263 final Scope scope; |
| 264 | 264 |
| 265 Updater(this.scope); | 265 Updater(this.scope); |
| 266 | 266 |
| 267 visitExpression(ExpressionObserver e) { | 267 visitExpression(ExpressionObserver e) { |
| 268 e._observe(scope); | 268 e._observe(scope); |
| 269 } | 269 } |
| 270 | 270 |
| 271 visitInExpression(InObserver c) { | 271 visitInExpression(InObserver c) { |
| 272 visit(c.right); | 272 visit(c.right); |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 Method(this.mirror, this.symbol); | 610 Method(this.mirror, this.symbol); |
| 611 | 611 |
| 612 dynamic call(List args) => mirror.invoke(symbol, args, null).reflectee; | 612 dynamic call(List args) => mirror.invoke(symbol, args, null).reflectee; |
| 613 } | 613 } |
| 614 | 614 |
| 615 class EvalException implements Exception { | 615 class EvalException implements Exception { |
| 616 final String message; | 616 final String message; |
| 617 EvalException(this.message); | 617 EvalException(this.message); |
| 618 String toString() => "EvalException: $message"; | 618 String toString() => "EvalException: $message"; |
| 619 } | 619 } |
| OLD | NEW |