OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |