| Index: pkg/kernel/lib/kernel.dart
|
| diff --git a/pkg/kernel/lib/kernel.dart b/pkg/kernel/lib/kernel.dart
|
| index 361f59aaa265445c0a472feb4138df8e821c00b3..752617b9d3fc2ed5ee541fd11667fa9026c92417 100644
|
| --- a/pkg/kernel/lib/kernel.dart
|
| +++ b/pkg/kernel/lib/kernel.dart
|
| @@ -29,13 +29,24 @@ Program loadProgramFromBinary(String path, [Program program]) {
|
| }
|
|
|
| Future writeProgramToBinary(Program program, String path) {
|
| - var sink = new File(path).openWrite();
|
| + var sink;
|
| + if (path == 'null' || path == 'stdout') {
|
| + sink = stdout.nonBlocking;
|
| + } else {
|
| + sink = new File(path).openWrite();
|
| + }
|
| +
|
| var future;
|
| try {
|
| new BinaryPrinter(sink).writeProgramFile(program);
|
| } finally {
|
| - future = sink.close();
|
| + if (sink == stdout.nonBlocking) {
|
| + future = sink.flush();
|
| + } else {
|
| + future = sink.close();
|
| + }
|
| }
|
| +
|
| return future;
|
| }
|
|
|
|
|