Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Unified Diff: runtime/bin/process_impl.dart

Issue 10202014: Fix exception throwing in connection with process starting. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_impl.dart
diff --git a/runtime/bin/process_impl.dart b/runtime/bin/process_impl.dart
index 6c11501a837a197a7b9b736980ebb8395eac9883..1963451252dab384f41d1888d047993703f59785 100644
--- a/runtime/bin/process_impl.dart
+++ b/runtime/bin/process_impl.dart
@@ -318,20 +318,11 @@ class _InteractiveProcess implements Process {
// buffers output so it can be delivered to the callback when the
// process exits.
class _NonInteractiveProcess implements Process {
-
_NonInteractiveProcess.start(String path,
List<String> arguments,
ProcessOptions options,
Function this._callback) {
- _process = new _InteractiveProcess.start(path, arguments, options);
-
- // Setup process exit handling.
- _process.onExit = (exitCode) {
- _exitCode = exitCode;
- _checkDone();
- };
-
- // Extract output encoding options.
+ // Extract output encoding options and verify arguments.
var stdoutEncoding = Encoding.UTF_8;
var stderrEncoding = Encoding.UTF_8;
if (options !== null) {
@@ -351,6 +342,15 @@ class _NonInteractiveProcess implements Process {
}
}
+ // Start the underlying process.
+ _process = new _InteractiveProcess.start(path, arguments, options);
+
+ // Setup process exit handling.
+ _process.onExit = (exitCode) {
+ _exitCode = exitCode;
+ _checkDone();
+ };
+
// Setup stdout handling.
_stdoutBuffer = new StringBuffer();
var stdoutStream = new StringInputStream(_process.stdout, stdoutEncoding);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698