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

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
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..ed25f472967bb746255917d4f7d544475a8a374c 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 : [];
Jennifer Messerly 2013/09/16 19:43:47 const [] ?
justinfagnani 2013/09/16 20:02:57 Done.
}
/**
« no previous file with comments | « no previous file | pkg/polymer_expressions/test/eval_test.dart » ('j') | pkg/polymer_expressions/test/syntax_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698