OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 _exit(int status) native "Exit"; | 5 _exit(int status) native "Exit"; |
6 | 6 |
7 class _ProcessStartStatus { | 7 class _ProcessStartStatus { |
8 int _errorCode; // Set to OS error code if process start failed. | 8 int _errorCode; // Set to OS error code if process start failed. |
9 String _errorMessage; // Set to OS error message if process start failed. | 9 String _errorMessage; // Set to OS error message if process start failed. |
10 } | 10 } |
(...skipping 11 matching lines...) Expand all Loading... |
22 ProcessOptions options) { | 22 ProcessOptions options) { |
23 if (path is !String) { | 23 if (path is !String) { |
24 throw new ArgumentError("Path is not a String: $path"); | 24 throw new ArgumentError("Path is not a String: $path"); |
25 } | 25 } |
26 _path = path; | 26 _path = path; |
27 | 27 |
28 if (arguments is !List) { | 28 if (arguments is !List) { |
29 throw new ArgumentError("Arguments is not a List: $arguments"); | 29 throw new ArgumentError("Arguments is not a List: $arguments"); |
30 } | 30 } |
31 int len = arguments.length; | 31 int len = arguments.length; |
32 _arguments = new ObjectArray<String>(len); | 32 _arguments = new List<String>(len); |
33 for (int i = 0; i < len; i++) { | 33 for (int i = 0; i < len; i++) { |
34 var arg = arguments[i]; | 34 var arg = arguments[i]; |
35 if (arg is !String) { | 35 if (arg is !String) { |
36 throw new ArgumentError("Non-string argument: $arg"); | 36 throw new ArgumentError("Non-string argument: $arg"); |
37 } | 37 } |
38 _arguments[i] = arguments[i]; | 38 _arguments[i] = arguments[i]; |
39 if (Platform.operatingSystem == 'windows') { | 39 if (Platform.operatingSystem == 'windows') { |
40 _arguments[i] = _windowsArgumentEscape(_arguments[i]); | 40 _arguments[i] = _windowsArgumentEscape(_arguments[i]); |
41 } | 41 } |
42 } | 42 } |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 | 275 |
276 void _reportError(e) { | 276 void _reportError(e) { |
277 if (_onError != null) { | 277 if (_onError != null) { |
278 _onError(e); | 278 _onError(e); |
279 } else { | 279 } else { |
280 throw e; | 280 throw e; |
281 } | 281 } |
282 } | 282 } |
283 | 283 |
284 String _path; | 284 String _path; |
285 ObjectArray<String> _arguments; | 285 List<String> _arguments; |
286 String _workingDirectory; | 286 String _workingDirectory; |
287 List<String> _environment; | 287 List<String> _environment; |
288 // Private methods of _Socket are used by _in, _out, and _err. | 288 // Private methods of _Socket are used by _in, _out, and _err. |
289 _Socket _in; | 289 _Socket _in; |
290 _Socket _out; | 290 _Socket _out; |
291 _Socket _err; | 291 _Socket _err; |
292 Socket _exitHandler; | 292 Socket _exitHandler; |
293 bool _closed; | 293 bool _closed; |
294 bool _ended; | 294 bool _ended; |
295 bool _started; | 295 bool _started; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 390 |
391 class _ProcessResult implements ProcessResult { | 391 class _ProcessResult implements ProcessResult { |
392 const _ProcessResult(int this.exitCode, | 392 const _ProcessResult(int this.exitCode, |
393 String this.stdout, | 393 String this.stdout, |
394 String this.stderr); | 394 String this.stderr); |
395 | 395 |
396 final int exitCode; | 396 final int exitCode; |
397 final String stdout; | 397 final String stdout; |
398 final String stderr; | 398 final String stderr; |
399 } | 399 } |
OLD | NEW |