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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import "dart:math"; 5 import "dart:math";
6 import "dart:typed_data"; 6 import "dart:typed_data";
7 7
8 // We need to pass the exception and stack trace objects as second and third 8 // We need to pass the exception and stack trace objects as second and third
9 // parameter to the continuation. See vm/ast_transformer.cc for usage. 9 // parameter to the continuation. See vm/ast_transformer.cc for usage.
10 void _asyncCatchHelper(catchFunction, continuation) { 10 void _asyncCatchHelper(catchFunction, continuation) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 return true; 57 return true;
58 } 58 }
59 yieldEachIterator = null; 59 yieldEachIterator = null;
60 } 60 }
61 isYieldEach = false; 61 isYieldEach = false;
62 if (!moveNextFn(this)) { 62 if (!moveNextFn(this)) {
63 moveNextFn = null; 63 moveNextFn = null;
64 current = null; 64 current = null;
65 return false; 65 return false;
66 } 66 }
67 if (isYieldEach && (current is Iterable)) { 67 if (isYieldEach) {
68 yieldEachIterator = current.iterator; 68 // Spec mandates: it is a dynamic error if the class of [the object
69 // returned by yield*] does not implement Iterable.
70 yieldEachIterator = (current as Iterable).iterator;
69 continue; 71 continue;
70 } 72 }
71 return true; 73 return true;
72 } 74 }
73 } 75 }
74 } 76 }
OLDNEW
« 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