blob: de2180610dc81a17c5bd93f700df1d1d2728564e [file] [log] [blame]
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// 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.
import 'dart:async';
/*element: main:[null]*/
main() {
awaitOfFuture();
awaitOfInt();
awaitForOfStream();
}
////////////////////////////////////////////////////////////////////////////////
// Await of Future.value.
////////////////////////////////////////////////////////////////////////////////
/*element: _method1:[null]*/
_method1(/*[null|subclass=JSInt]*/ o) {}
/*element: awaitOfFuture:[exact=_Future]*/
awaitOfFuture() async {
var future = new Future.value(0);
var local = await future;
_method1(local);
}
////////////////////////////////////////////////////////////////////////////////
// Await of int.
////////////////////////////////////////////////////////////////////////////////
/*element: _method2:[null]*/
_method2(/*[null|subclass=JSInt]*/ o) {}
/*element: awaitOfInt:[exact=_Future]*/
awaitOfInt() async {
var local = await 0;
_method2(local);
}
////////////////////////////////////////////////////////////////////////////////
// Await for of Stream.fromIterable.
////////////////////////////////////////////////////////////////////////////////
/*element: _method3:[null]*/
_method3(
/*Container([exact=JSExtendableArray], element: [exact=JSUInt31], length: 1)*/
o) {}
/*element: _method4:[null]*/
_method4(/*[null|subclass=JSInt]*/ o) {}
/*element: awaitForOfStream:[exact=_Future]*/
awaitForOfStream() async {
var list = [0];
_method3(list);
var stream = new Stream.fromIterable(list);
/*current: [exact=_StreamIterator]*/
/*moveNext: [exact=_StreamIterator]*/
await for (var local in stream) {
_method4(local);
}
}