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

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: 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 #27315 for ideas on 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 9 /// 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. 10 /// stepping stone for proposed ES7 async/await, and uses ES6 Promises.
12 part of dart._runtime; 11 part of dart._runtime;
13 12
14 final _jsIterator = JS('', 'Symbol("_jsIterator")'); 13 final _jsIterator = JS('', 'Symbol("_jsIterator")');
15 final _current = JS('', 'Symbol("_current")'); 14 final _current = JS('', 'Symbol("_current")');
16 15
17 syncStar(gen, E, @rest args) => JS('', '''(() => { 16 syncStar(gen, E, @rest args) => JS('', '''(() => {
18 const SyncIterable_E = ${getGenericClass(SyncIterable)}($E); 17 const SyncIterable_E = ${getGenericClass(SyncIterable)}($E);
19 return new SyncIterable_E($gen, $args); 18 return new SyncIterable_E($gen, $args);
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 this.controller.addError(error, stackTrace); 214 this.controller.addError(error, stackTrace);
216 } 215 }
217 } 216 }
218 '''); 217 ''');
219 218
220 /// Returns a Stream of T implemented by an async* function. */ 219 /// Returns a Stream of T implemented by an async* function. */
221 /// 220 ///
222 asyncStar(gen, T, @rest args) => JS('', '''(() => { 221 asyncStar(gen, T, @rest args) => JS('', '''(() => {
223 return new $_AsyncStarStreamController($gen, $T, $args).controller.stream; 222 return new $_AsyncStarStreamController($gen, $T, $args).controller.stream;
224 })()'''); 223 })()''');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698