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

Unified Diff: tests/language/await_future_test.dart

Issue 484933003: Await it! (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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
« runtime/vm/scopes.cc ('K') | « runtime/vm/symbols.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/await_future_test.dart
diff --git a/tests/language/async_backwards_compatibility_1_test.dart b/tests/language/await_future_test.dart
similarity index 53%
copy from tests/language/async_backwards_compatibility_1_test.dart
copy to tests/language/await_future_test.dart
index 93908797af9400f0cdc751626158e1f4e39f6af5..496d84858728d3ba72cd7663ef803b4efa4119aa 100644
--- a/tests/language/async_backwards_compatibility_1_test.dart
+++ b/tests/language/await_future_test.dart
@@ -2,17 +2,22 @@
// 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.
+// VMOptions=--enable_async
srdjan 2014/08/20 17:50:06 "--optimization-counter-threshold=5" as well?
Michael Lippautz (Google) 2014/08/20 20:56:07 Done.
+
import 'dart:async';
-import 'async_helper_lib.dart' as async;
-class A {
- async.async get async => null;
-}
+bar(p) => new Future(() => p);
-async.async topLevel() => null;
+foo() async {
+ var b;
+ for(int i = 0; i < 10; i++) {
+ b += (await bar(1)) + (await bar(2));
+ }
+ return b;
+}
main() {
- var a = new A();
- var b = a.async;
- var c = topLevel();
+ foo().then((result) {
+ print(result);
hausner 2014/08/20 19:47:49 Use Expect.equals to verify that the result is cor
Michael Lippautz (Google) 2014/08/20 20:56:07 Done.
+ });
}
« runtime/vm/scopes.cc ('K') | « runtime/vm/symbols.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698