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

Unified Diff: utils/pub/validator.dart

Issue 12042053: Get rid of unneeded Future.immediate() calls. (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/validator.dart
diff --git a/utils/pub/validator.dart b/utils/pub/validator.dart
index d3bc0a7d042debf2bbe134c0c81b7b594149c759..5ec0f233f5a808ba6c2a72b4dd68abb0acae1a86 100644
--- a/utils/pub/validator.dart
+++ b/utils/pub/validator.dart
@@ -53,13 +53,8 @@ abstract class Validator {
new DirectoryValidator(entrypoint)
];
- // TODO(nweiz): The sleep 0 here forces us to go async. This works around
- // 3356, which causes a bug if all validators are (synchronously) using
- // Future.immediate and an error is thrown before a handler is set up.
- return sleep(0).then((_) {
- return Future.wait(
- validators.mappedBy((validator) => validator.validate()));
- }).then((_) {
+ return Future.wait(validators.mappedBy((validator) => validator.validate()))
+ .then((_) {
var errors =
flatten(validators.mappedBy((validator) => validator.errors));
var warnings =

Powered by Google App Engine
This is Rietveld 408576698