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

Side by Side Diff: tests/language/async_regression_23058_test.dart

Issue 1060293002: Fix bug in dart2js async rewrite (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | « pkg/compiler/lib/src/js/rewrite_async.dart ('k') | no next file » | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 // Regression test for issue 23058.
6
5 import "package:expect/expect.dart"; 7 import "package:expect/expect.dart";
6 import "package:async_helper/async_helper.dart"; 8 import "package:async_helper/async_helper.dart";
7 9
8 range(start, end) async* { 10 class A {
9 for (int i = start; i < end; i++) { 11 var x = new B();
10 yield i; 12
13 foo() async {
14 return x.foo == 2 ? 42 : x.foo;
11 } 15 }
12 } 16 }
13 17
14 concat(a, b) async* { 18 class B {
15 yield* a; 19 var x = 0;
16 yield* b;
17 }
18 20
19 test() async { 21 get foo {
20 Expect.listEquals([1, 2, 3, 11, 12, 13], 22 if (x == -1) {
21 await concat(range(1, 4), range(11, 14)).toList()); 23 return 0;
24 } else {
25 return x++;
26 }
27 }
22 } 28 }
23 29
24 main() { 30 main() {
25 asyncStart(); 31 asyncStart();
26 test().then((_) { 32 new A().foo().then((result) {
33 Expect.equals(1, result);
27 asyncEnd(); 34 asyncEnd();
28 }); 35 });
29 } 36 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js/rewrite_async.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698