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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/dart2js.dart

Issue 16125005: Make new StreamController be async by default. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments Created 7 years, 6 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library dart2js.cmdline; 5 library dart2js.cmdline;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection' show Queue, LinkedHashMap; 8 import 'dart:collection' show Queue, LinkedHashMap;
9 import 'dart:io'; 9 import 'dart:io';
10 import 'dart:utf'; 10 import 'dart:utf';
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 String sourceMapTag = '//@ sourceMappingURL=$sourceMapFileName\n'; 351 String sourceMapTag = '//@ sourceMappingURL=$sourceMapFileName\n';
352 sink.count += sourceMapTag.length; 352 sink.count += sourceMapTag.length;
353 output.write(sourceMapTag); 353 output.write(sourceMapTag);
354 } 354 }
355 output.close(); 355 output.close();
356 if (isPrimaryOutput) { 356 if (isPrimaryOutput) {
357 charactersWritten += sink.count; 357 charactersWritten += sink.count;
358 } 358 }
359 } 359 }
360 360
361 var controller = new StreamController<String>(); 361 var controller = new StreamController<String>(sync: true);
362 controller.stream.listen(output.write, onDone: onDone); 362 controller.stream.listen(output.write, onDone: onDone);
363 sink = new CountingSink(controller); 363 sink = new CountingSink(controller);
364 return sink; 364 return sink;
365 } 365 }
366 366
367 api.compile(uri, libraryRoot, packageRoot, 367 api.compile(uri, libraryRoot, packageRoot,
368 inputProvider.readStringFromUri, handler, 368 inputProvider.readStringFromUri, handler,
369 options, outputProvider) 369 options, outputProvider)
370 .then(compilationDone); 370 .then(compilationDone);
371 } 371 }
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 print(trace); 567 print(trace);
568 } finally { 568 } finally {
569 exit(253); // 253 is recognized as a crash by our test scripts. 569 exit(253); // 253 is recognized as a crash by our test scripts.
570 } 570 }
571 } 571 }
572 } 572 }
573 573
574 void main() { 574 void main() {
575 mainWithErrorHandler(new Options()); 575 mainWithErrorHandler(new Options());
576 } 576 }
OLDNEW
« no previous file with comments | « samples/swarm/swarm_ui_lib/touch/Scroller.dart ('k') | sdk/lib/_internal/pub/lib/src/error_group.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698