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 (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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 void close() => _process.close(); | 420 void close() => _process.close(); |
421 | 421 |
422 Process _process; | 422 Process _process; |
423 Function _callback; | 423 Function _callback; |
424 StringBuffer _stdoutBuffer; | 424 StringBuffer _stdoutBuffer; |
425 StringBuffer _stderrBuffer; | 425 StringBuffer _stderrBuffer; |
426 int _exitCode; | 426 int _exitCode; |
427 bool _stdoutClosed = false; | 427 bool _stdoutClosed = false; |
428 bool _stderrClosed = false; | 428 bool _stderrClosed = false; |
429 } | 429 } |
OLD | NEW |