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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« runtime/vm/scopes.cc ('K') | « runtime/vm/symbols.h ('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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // 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.
6
5 import 'dart:async'; 7 import 'dart:async';
6 import 'async_helper_lib.dart' as async;
7 8
8 class A { 9 bar(p) => new Future(() => p);
9 async.async get async => null; 10
11 foo() async {
12 var b;
13 for(int i = 0; i < 10; i++) {
14 b += (await bar(1)) + (await bar(2));
15 }
16 return b;
10 } 17 }
11 18
12 async.async topLevel() => null;
13
14 main() { 19 main() {
15 var a = new A(); 20 foo().then((result) {
16 var b = a.async; 21 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.
17 var c = topLevel(); 22 });
18 } 23 }
OLDNEW
« 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