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

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: 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 String sourceMapTag = '//@ sourceMappingURL=$sourceMapFileName\n'; 315 String sourceMapTag = '//@ sourceMappingURL=$sourceMapFileName\n';
316 sink.count += sourceMapTag.length; 316 sink.count += sourceMapTag.length;
317 output.write(sourceMapTag); 317 output.write(sourceMapTag);
318 } 318 }
319 output.close(); 319 output.close();
320 if (isPrimaryOutput) { 320 if (isPrimaryOutput) {
321 charactersWritten += sink.count; 321 charactersWritten += sink.count;
322 } 322 }
323 } 323 }
324 324
325 var controller = new StreamController<String>(); 325 var controller = new StreamController<String>(sync: true);
326 controller.stream.listen(output.write, onDone: onDone); 326 controller.stream.listen(output.write, onDone: onDone);
327 sink = new CountingSink(controller); 327 sink = new CountingSink(controller);
328 return sink; 328 return sink;
329 } 329 }
330 330
331 api.compile(uri, libraryRoot, packageRoot, 331 api.compile(uri, libraryRoot, packageRoot,
332 inputProvider.readStringFromUri, handler, 332 inputProvider.readStringFromUri, handler,
333 options, outputProvider) 333 options, outputProvider)
334 .then(compilationDone); 334 .then(compilationDone);
335 } 335 }
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 print(trace); 515 print(trace);
516 } finally { 516 } finally {
517 exit(253); // 253 is recognized as a crash by our test scripts. 517 exit(253); // 253 is recognized as a crash by our test scripts.
518 } 518 }
519 } 519 }
520 } 520 }
521 521
522 void main() { 522 void main() {
523 mainWithErrorHandler(new Options()); 523 mainWithErrorHandler(new Options());
524 } 524 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698