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

Unified Diff: sdk/lib/io/process.dart

Issue 13497008: Add more tests and argument check to Process.sleep (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | tests/standalone/io/sleep_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/process.dart
diff --git a/sdk/lib/io/process.dart b/sdk/lib/io/process.dart
index 8ceb41d9e7d16a61d188b22901800cdfadccc91d..1c9fddb985eef94ae8147aaf5bf6b6f010d6c014 100644
--- a/sdk/lib/io/process.dart
+++ b/sdk/lib/io/process.dart
@@ -46,7 +46,11 @@ set exitCode(int status) {
* in a isolate while it is blocked in a [sleep] call.
*/
void sleep(Duration duration) {
- _ProcessUtils._sleep(duration.inMilliseconds);
+ int milliseconds = duration.inMilliseconds;
+ if (milliseconds < 0) {
+ throw new ArgumentError("sleep: duration cannot be negative");
+ }
+ _ProcessUtils._sleep(milliseconds);
}
/**
« no previous file with comments | « no previous file | tests/standalone/io/sleep_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698