Chromium Code Reviews| Index: pkg/polymer_expressions/lib/eval.dart |
| diff --git a/pkg/polymer_expressions/lib/eval.dart b/pkg/polymer_expressions/lib/eval.dart |
| index a33abeb126709838ae4ed21109cce2528924f15c..ba336edb03c96f62c6720b342eb4ad9d1ed4c399 100644 |
| --- a/pkg/polymer_expressions/lib/eval.dart |
| +++ b/pkg/polymer_expressions/lib/eval.dart |
| @@ -208,6 +208,8 @@ class _ModelScope extends Scope { |
| } |
| Object _isModelProperty(String name) => name != 'this'; |
| + |
| + String toString() => "[model: $model]"; |
| } |
| /** |
| @@ -239,6 +241,8 @@ class _LocalVariableScope extends Scope { |
| if (varName == name) return false; |
| return parent == null ? false : parent._isModelProperty(name); |
| } |
| + |
| + String toString() => "$parent > [local: $varName]"; |
| } |
| /** A scope that holds a reference to a global variables. */ |
| @@ -264,6 +268,8 @@ class _GlobalsScope extends Scope { |
| if (variables.containsKey(name)) return false; |
| return parent == null ? false : parent._isModelProperty(name); |
| } |
| + |
| + String toString() => "$parent > [global: ${variables.keys}]"; |
| } |
| Object _convert(v) => v is Stream ? new StreamBinding(v) : v; |
| @@ -730,8 +736,9 @@ class InObserver extends ExpressionObserver<InExpression> |
| _subscription = iterable.listChanges.listen((_) => _invalidate(scope)); |
| } |
| - // TODO: make Comprehension observable and update it |
|
Jennifer Messerly
2014/05/30 22:55:10
does this TODO need to stick around?
Siggi Cherem (dart-lang)
2014/05/31 00:56:17
Yes, but there was already an equivalent TODO in _
|
| - _value = new Comprehension(identifier.value, iterable); |
| + var name = identifier.value; |
| + _value = iterable == null ? const [] : |
| + iterable.map((i) => scope.childScope(name, i)).toList(growable: false); |
| } |
| accept(Visitor v) => v.visitInExpression(this); |
| @@ -739,19 +746,6 @@ class InObserver extends ExpressionObserver<InExpression> |
| _toBool(v) => (v == null) ? false : v; |
| -/** |
| - * A comprehension declaration ("a in b"). [identifier] is the loop variable |
| - * that's added to the scope during iteration. [iterable] is the set of |
| - * objects to iterate over. |
| - */ |
| -class Comprehension { |
| - final String identifier; |
| - final Iterable iterable; |
| - |
| - Comprehension(this.identifier, Iterable iterable) |
| - : iterable = (iterable != null) ? iterable : const []; |
| -} |
| - |
| class EvalException implements Exception { |
| final String message; |
| EvalException(this.message); |