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

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

Issue 24096016: PolymerExpressions: fix for null iterators in comprehensions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | « no previous file | pkg/polymer_expressions/test/eval_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer_expressions/lib/eval.dart
diff --git a/pkg/polymer_expressions/lib/eval.dart b/pkg/polymer_expressions/lib/eval.dart
index 7341e05515025a269384602368444c5b494b5ca5..b76b3b878c935b2da386a673d299e1c3509e58da 100644
--- a/pkg/polymer_expressions/lib/eval.dart
+++ b/pkg/polymer_expressions/lib/eval.dart
@@ -595,12 +595,16 @@ call(dynamic receiver, List args) {
}
/**
- * A comprehension declaration ("a in b").
+ * 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, this.iterable);
+
+ Comprehension(this.identifier, Iterable iterable)
+ : iterable = (iterable != null) ? iterable : const [];
}
/**
« no previous file with comments | « no previous file | pkg/polymer_expressions/test/eval_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698