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

Unified Diff: utils/pub/utils.dart

Issue 11821012: Get more pub tests working. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
Index: utils/pub/utils.dart
diff --git a/utils/pub/utils.dart b/utils/pub/utils.dart
index 544a3ce0bef5c1c9a9d99dc98154aa04694a91d3..9094984adcf3d37cd926fc35546b61e243c9a735 100644
--- a/utils/pub/utils.dart
+++ b/utils/pub/utils.dart
@@ -104,13 +104,16 @@ bool endsWithPattern(String str, Pattern matcher) {
}
/// Returns the hex-encoded sha1 hash of [source].
-String sha1(String source) =>
- CryptoUtils.bytesToHex(new SHA1().add(source.charCodes).close());
+String sha1(String source) {
+ var sha = new SHA1();
+ sha.add(source.charCodes);
+ return CryptoUtils.bytesToHex(sha.close());
+}
/// Returns a [Future] that completes in [milliseconds].
Future sleep(int milliseconds) {
var completer = new Completer();
- new Timer(milliseconds, completer.complete);
+ new Timer(milliseconds, (_) => completer.complete());
return completer.future;
}

Powered by Google App Engine
This is Rietveld 408576698