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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/js/rewrite_async.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/async_regression_23058_test.dart
diff --git a/tests/language/asyncstar_concat_test.dart b/tests/language/async_regression_23058_test.dart
similarity index 55%
copy from tests/language/asyncstar_concat_test.dart
copy to tests/language/async_regression_23058_test.dart
index aeb1361cd85fdcc35bf1fd466b161c2462befc4e..ebec58efedf54b43e86d75280ad8beae914338e4 100644
--- a/tests/language/asyncstar_concat_test.dart
+++ b/tests/language/async_regression_23058_test.dart
@@ -2,28 +2,35 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// Regression test for issue 23058.
+
import "package:expect/expect.dart";
import "package:async_helper/async_helper.dart";
-range(start, end) async* {
- for (int i = start; i < end; i++) {
- yield i;
+class A {
+ var x = new B();
+
+ foo() async {
+ return x.foo == 2 ? 42 : x.foo;
}
}
-concat(a, b) async* {
- yield* a;
- yield* b;
-}
+class B {
+ var x = 0;
-test() async {
- Expect.listEquals([1, 2, 3, 11, 12, 13],
- await concat(range(1, 4), range(11, 14)).toList());
+ get foo {
+ if (x == -1) {
+ return 0;
+ } else {
+ return x++;
+ }
+ }
}
main() {
asyncStart();
- test().then((_) {
+ new A().foo().then((result) {
+ Expect.equals(1, result);
asyncEnd();
});
}
« 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