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

Unified Diff: runtime/lib/core_patch.dart

Issue 910923002: Make yield* throw an error if not yielding an Iterable (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/core_patch.dart
===================================================================
--- runtime/lib/core_patch.dart (revision 43603)
+++ runtime/lib/core_patch.dart (working copy)
@@ -64,8 +64,10 @@
current = null;
return false;
}
- if (isYieldEach && (current is Iterable)) {
- yieldEachIterator = current.iterator;
+ if (isYieldEach) {
+ // Spec mandates: it is a dynamic error if the class of [the object
+ // returned by yield*] does not implement Iterable.
+ yieldEachIterator = (current as Iterable).iterator;
continue;
}
return true;
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698