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 class _ProcessStartStatus { | 5 class _ProcessStartStatus { |
6 int _errorCode; // Set to OS error code if process start failed. | 6 int _errorCode; // Set to OS error code if process start failed. |
7 String _errorMessage; // Set to OS error message if process start failed. | 7 String _errorMessage; // Set to OS error message if process start failed. |
8 } | 8 } |
9 | 9 |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 throw new IllegalArgumentException("Arguments is not a List: $arguments"); | 48 throw new IllegalArgumentException("Arguments is not a List: $arguments"); |
49 } | 49 } |
50 int len = arguments.length; | 50 int len = arguments.length; |
51 _arguments = new ObjectArray<String>(len); | 51 _arguments = new ObjectArray<String>(len); |
52 for (int i = 0; i < len; i++) { | 52 for (int i = 0; i < len; i++) { |
53 var arg = arguments[i]; | 53 var arg = arguments[i]; |
54 if (arg is !String) { | 54 if (arg is !String) { |
55 throw new IllegalArgumentException("Non-string argument: $arg"); | 55 throw new IllegalArgumentException("Non-string argument: $arg"); |
56 } | 56 } |
57 _arguments[i] = arguments[i]; | 57 _arguments[i] = arguments[i]; |
58 if (new Platform().operatingSystem() == 'windows') { | 58 if (Platform.operatingSystem() == 'windows') { |
59 _arguments[i] = _windowsArgumentEscape(_arguments[i]); | 59 _arguments[i] = _windowsArgumentEscape(_arguments[i]); |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 if (options !== null && options.workingDirectory !== null) { | 63 if (options !== null && options.workingDirectory !== null) { |
64 _workingDirectory = options.workingDirectory; | 64 _workingDirectory = options.workingDirectory; |
65 if (_workingDirectory is !String) { | 65 if (_workingDirectory is !String) { |
66 throw new IllegalArgumentException( | 66 throw new IllegalArgumentException( |
67 "WorkingDirectory is not a String: $_workingDirectory"); | 67 "WorkingDirectory is not a String: $_workingDirectory"); |
68 } | 68 } |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 void close() => _process.close(); | 396 void close() => _process.close(); |
397 | 397 |
398 Process _process; | 398 Process _process; |
399 Function _callback; | 399 Function _callback; |
400 StringBuffer _stdoutBuffer; | 400 StringBuffer _stdoutBuffer; |
401 StringBuffer _stderrBuffer; | 401 StringBuffer _stderrBuffer; |
402 int _exitCode; | 402 int _exitCode; |
403 bool _stdoutClosed = false; | 403 bool _stdoutClosed = false; |
404 bool _stderrClosed = false; | 404 bool _stderrClosed = false; |
405 } | 405 } |
OLD | NEW |