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 patch class _WindowsCodePageDecoder { | 5 patch class _WindowsCodePageDecoder { |
6 /* patch */ static String _decodeBytes(List<int> bytes) | 6 /* patch */ static String _decodeBytes(List<int> bytes) |
7 native "SystemEncodingToString"; | 7 native "SystemEncodingToString"; |
8 } | 8 } |
9 | 9 |
10 | 10 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 return (negative == 0) ? code : -code; | 192 return (negative == 0) ? code : -code; |
193 } | 193 } |
194 | 194 |
195 void handleExit() { | 195 void handleExit() { |
196 _ended = true; | 196 _ended = true; |
197 _exitCode.complete(exitCode(exitDataBuffer)); | 197 _exitCode.complete(exitCode(exitDataBuffer)); |
198 // Kill stdin, helping hand if the user forgot to do it. | 198 // Kill stdin, helping hand if the user forgot to do it. |
199 _stdin._sink.destroy(); | 199 _stdin._sink.destroy(); |
200 } | 200 } |
201 | 201 |
202 exitDataBuffer.setRange(exitDataRead, data.length, data); | 202 exitDataBuffer.setRange(exitDataRead, exitDataRead + data.length, data); |
203 exitDataRead += data.length; | 203 exitDataRead += data.length; |
204 if (exitDataRead == EXIT_DATA_SIZE) { | 204 if (exitDataRead == EXIT_DATA_SIZE) { |
205 handleExit(); | 205 handleExit(); |
206 } | 206 } |
207 }); | 207 }); |
208 | 208 |
209 completer.complete(this); | 209 completer.complete(this); |
210 }); | 210 }); |
211 return completer.future; | 211 return completer.future; |
212 } | 212 } |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 | 324 |
325 class _ProcessResult implements ProcessResult { | 325 class _ProcessResult implements ProcessResult { |
326 const _ProcessResult(int this.exitCode, | 326 const _ProcessResult(int this.exitCode, |
327 String this.stdout, | 327 String this.stdout, |
328 String this.stderr); | 328 String this.stderr); |
329 | 329 |
330 final int exitCode; | 330 final int exitCode; |
331 final String stdout; | 331 final String stdout; |
332 final String stderr; | 332 final String stderr; |
333 } | 333 } |
OLD | NEW |