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

Side by Side Diff: pkg/kernel/testcases/closures/syncstar.dart

Issue 3000333002: Fix several bugs in closure conversion. (Closed)
Patch Set: Comments. Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
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.
4 //
5 // This tests that the wrapper function around converted closures in the VM
6 // doesn't break when the context parameter is captured (since async
7 // transformations introduces an additional closure here).
8
9 range(int high) {
10 iter(int low) sync* {
11 while (high-- > low) yield high;
12 }
13
14 return iter;
15 }
16
17 main() {
18 var sum = 0;
19 for (var x in range(10)(2)) sum += x;
20
21 if (sum != 44) {
22 throw new Exception("Incorrect output.");
23 }
24 }
OLDNEW
« no previous file with comments | « pkg/kernel/testcases/closures/loop2.dart.expect ('k') | pkg/kernel/testcases/closures/syncstar.dart.expect » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698