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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
188 bool includeParentEnvironment, | 188 bool includeParentEnvironment, |
189 bool runInShell, | 189 bool runInShell, |
190 ProcessStartMode mode) : super() { | 190 ProcessStartMode mode) : super() { |
191 _processes[_serviceId] = this; | 191 _processes[_serviceId] = this; |
192 if (runInShell) { | 192 if (runInShell) { |
193 arguments = _getShellArguments(path, arguments); | 193 arguments = _getShellArguments(path, arguments); |
194 path = _getShellCommand(); | 194 path = _getShellCommand(); |
195 } | 195 } |
196 | 196 |
197 if (path is !String) { | 197 if (path is !String) { |
198 throw new ArgumentError("Path is not a String: $path"); | 198 throw new ArgumentError("Path is not a String: $path"); |
Ivan Posva
2015/10/20 06:39:12
Here?
zra
2015/10/20 16:03:26
As discussed, we no longer populate the map.
| |
199 } | 199 } |
200 _path = path; | 200 _path = path; |
201 | 201 |
202 if (arguments is !List) { | 202 if (arguments is !List) { |
203 throw new ArgumentError("Arguments is not a List: $arguments"); | 203 throw new ArgumentError("Arguments is not a List: $arguments"); |
Ivan Posva
2015/10/20 06:39:12
And here?
| |
204 } | 204 } |
205 int len = arguments.length; | 205 int len = arguments.length; |
206 _arguments = new List<String>(len); | 206 _arguments = new List<String>(len); |
207 for (int i = 0; i < len; i++) { | 207 for (int i = 0; i < len; i++) { |
208 var arg = arguments[i]; | 208 var arg = arguments[i]; |
209 if (arg is !String) { | 209 if (arg is !String) { |
210 throw new ArgumentError("Non-string argument: $arg"); | 210 throw new ArgumentError("Non-string argument: $arg"); |
Ivan Posva
2015/10/20 06:39:12
And many more places?
| |
211 } | 211 } |
212 _arguments[i] = arguments[i]; | 212 _arguments[i] = arguments[i]; |
213 if (Platform.isWindows) { | 213 if (Platform.isWindows) { |
214 _arguments[i] = _windowsArgumentEscape(_arguments[i]); | 214 _arguments[i] = _windowsArgumentEscape(_arguments[i]); |
215 } | 215 } |
216 } | 216 } |
217 | 217 |
218 if (_workingDirectory != null && _workingDirectory is !String) { | 218 if (_workingDirectory != null && _workingDirectory is !String) { |
219 throw new ArgumentError( | 219 throw new ArgumentError( |
220 "WorkingDirectory is not a String: $_workingDirectory"); | 220 "WorkingDirectory is not a String: $_workingDirectory"); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
402 _mode == ProcessStartMode.DETACHED | 402 _mode == ProcessStartMode.DETACHED |
403 ? null : _stdin._sink._nativeSocket, | 403 ? null : _stdin._sink._nativeSocket, |
404 _mode == ProcessStartMode.DETACHED | 404 _mode == ProcessStartMode.DETACHED |
405 ? null : _stdout._stream._nativeSocket, | 405 ? null : _stdout._stream._nativeSocket, |
406 _mode == ProcessStartMode.DETACHED | 406 _mode == ProcessStartMode.DETACHED |
407 ? null : _stderr._stream._nativeSocket, | 407 ? null : _stderr._stream._nativeSocket, |
408 _mode != ProcessStartMode.NORMAL | 408 _mode != ProcessStartMode.NORMAL |
409 ? null : _exitHandler._nativeSocket, | 409 ? null : _exitHandler._nativeSocket, |
410 status); | 410 status); |
411 if (!success) { | 411 if (!success) { |
412 _processes.remove(_serviceId); | |
412 completer.completeError( | 413 completer.completeError( |
413 new ProcessException(_path, | 414 new ProcessException(_path, |
414 _arguments, | 415 _arguments, |
415 status._errorMessage, | 416 status._errorMessage, |
416 status._errorCode)); | 417 status._errorCode)); |
417 return; | 418 return; |
418 } | 419 } |
419 | 420 |
420 _started = true; | 421 _started = true; |
421 | 422 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
464 _arguments, | 465 _arguments, |
465 _workingDirectory, | 466 _workingDirectory, |
466 _environment, | 467 _environment, |
467 ProcessStartMode.NORMAL.index, | 468 ProcessStartMode.NORMAL.index, |
468 _stdin._sink._nativeSocket, | 469 _stdin._sink._nativeSocket, |
469 _stdout._stream._nativeSocket, | 470 _stdout._stream._nativeSocket, |
470 _stderr._stream._nativeSocket, | 471 _stderr._stream._nativeSocket, |
471 _exitHandler._nativeSocket, | 472 _exitHandler._nativeSocket, |
472 status); | 473 status); |
473 if (!success) { | 474 if (!success) { |
475 _processes.remove(_serviceId); | |
474 throw new ProcessException(_path, | 476 throw new ProcessException(_path, |
475 _arguments, | 477 _arguments, |
476 status._errorMessage, | 478 status._errorMessage, |
477 status._errorCode); | 479 status._errorCode); |
478 } | 480 } |
479 | 481 |
480 var result = _wait( | 482 var result = _wait( |
481 _stdin._sink._nativeSocket, | 483 _stdin._sink._nativeSocket, |
482 _stdout._stream._nativeSocket, | 484 _stdout._stream._nativeSocket, |
483 _stderr._stream._nativeSocket, | 485 _stderr._stream._nativeSocket, |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
618 Encoding stderrEncoding) { | 620 Encoding stderrEncoding) { |
619 var process = new _ProcessImpl(executable, | 621 var process = new _ProcessImpl(executable, |
620 arguments, | 622 arguments, |
621 workingDirectory, | 623 workingDirectory, |
622 environment, | 624 environment, |
623 includeParentEnvironment, | 625 includeParentEnvironment, |
624 runInShell, | 626 runInShell, |
625 ProcessStartMode.NORMAL); | 627 ProcessStartMode.NORMAL); |
626 return process._runAndWait(stdoutEncoding, stderrEncoding); | 628 return process._runAndWait(stdoutEncoding, stderrEncoding); |
627 } | 629 } |
OLD | NEW |