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

Unified Diff: runtime/bin/process_impl.dart

Issue 8383037: Improve error handling in the process library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 2 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 | « runtime/bin/process.dart ('k') | runtime/bin/process_linux.cc » ('j') | 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 b121d2cece06d22bdd2004086834d22c20286273..a868599e85e2a27b217fa4276c505d86954ca786 100644
--- a/runtime/bin/process_impl.dart
+++ b/runtime/bin/process_impl.dart
@@ -11,14 +11,24 @@ class _ProcessStartStatus {
class _Process implements Process {
_Process(String path, List<String> arguments) {
+ if (path is !String) {
+ throw new ProcessException("Path is not a String: $path");
+ }
_path = path;
- {
- int len = arguments.length;
- _arguments = new ObjectArray<String>(len);
- for (int i = 0; i < len; i++) {
- _arguments[i] = arguments[i];
+
+ if (arguments is !List) {
+ throw new ProcessException("Arguments is not a List: $arguments");
+ }
+ int len = arguments.length;
+ _arguments = new ObjectArray<String>(len);
+ for (int i = 0; i < len; i++) {
+ var arg = arguments[i];
+ if (arg is !String) {
+ throw new ProcessException("Non-string argument: $arg");
}
+ _arguments[i] = arguments[i];
}
+
_in = new _Socket._internal();
_out = new _Socket._internal();
_err = new _Socket._internal();
« no previous file with comments | « runtime/bin/process.dart ('k') | runtime/bin/process_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698