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

Side by Side Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/generators.dart

Issue 2621543004: Cleanup references to the old DDC repo (Closed)
Patch Set: Linkify issues Created 3 years, 11 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
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 /// This library adapts ES6 generators to implement Dart's async/await. 5 /// This library adapts ES6 generators to implement Dart's async/await.
6 /// It's designed to interact with Dart's Future/Stream and follow Dart 6 /// It's designed to interact with Dart's Future/Stream and follow Dart
7 /// async/await semantics. 7 /// async/await semantics.
8 /// See https://github.com/dart-lang/dev_compiler/issues/245 for ideas on 8 /// See https://github.com/dart-lang/sdk/issues/27315 for ideas on
9 /// reconciling Dart's Future and ES6 Promise. 9 /// reconciling Dart's Future and ES6 Promise.
10 /// Inspired by `co`: https://github.com/tj/co/blob/master/index.js, which is a 10 /// Inspired by `co`: https://github.com/tj/co/blob/master/index.js, which is a
11 /// stepping stone for proposed ES7 async/await, and uses ES6 Promises. 11 /// stepping stone for proposed ES7 async/await, and uses ES6 Promises.
12 part of dart._runtime; 12 part of dart._runtime;
13 13
14 final _jsIterator = JS('', 'Symbol("_jsIterator")'); 14 final _jsIterator = JS('', 'Symbol("_jsIterator")');
15 final _current = JS('', 'Symbol("_current")'); 15 final _current = JS('', 'Symbol("_current")');
16 16
17 syncStar(gen, E, @rest args) => JS('', '''(() => { 17 syncStar(gen, E, @rest args) => JS('', '''(() => {
18 const SyncIterable_E = ${getGenericClass(SyncIterable)}($E); 18 const SyncIterable_E = ${getGenericClass(SyncIterable)}($E);
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 this.controller.addError(error, stackTrace); 215 this.controller.addError(error, stackTrace);
216 } 216 }
217 } 217 }
218 '''); 218 ''');
219 219
220 /// Returns a Stream of T implemented by an async* function. */ 220 /// Returns a Stream of T implemented by an async* function. */
221 /// 221 ///
222 asyncStar(gen, T, @rest args) => JS('', '''(() => { 222 asyncStar(gen, T, @rest args) => JS('', '''(() => {
223 return new $_AsyncStarStreamController($gen, $T, $args).controller.stream; 223 return new $_AsyncStarStreamController($gen, $T, $args).controller.stream;
224 })()'''); 224 })()''');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698