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

Unified Diff: utils/pub/validator/name.dart

Issue 12079112: Make a bunch of stuff in pub synchronous. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix after merge. 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
« no previous file with comments | « utils/pub/validator/lib.dart ('k') | utils/tests/pub/io_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/validator/name.dart
diff --git a/utils/pub/validator/name.dart b/utils/pub/validator/name.dart
index 7c4778c8af4604b849c9b16b4e9a4c6587d4a7c9..0386089c9821fa9c226cec98ed0338037159c4ba 100644
--- a/utils/pub/validator/name.dart
+++ b/utils/pub/validator/name.dart
@@ -10,6 +10,7 @@ import 'dart:io';
import '../../../pkg/path/lib/path.dart' as path;
import '../entrypoint.dart';
import '../io.dart';
+import '../utils.dart';
import '../validator.dart';
/// Dart reserved words, from the Dart spec.
@@ -47,8 +48,8 @@ class NameValidator extends Validator {
/// to the package's root directory.
Future<List<String>> get _libraries {
var libDir = join(entrypoint.root.dir, "lib");
- return dirExists(libDir).then((libDirExists) {
- if (!libDirExists) return [];
+ return defer(() {
+ if (!dirExists(libDir)) return [];
return listDir(libDir, recursive: true);
}).then((files) {
return files
« no previous file with comments | « utils/pub/validator/lib.dart ('k') | utils/tests/pub/io_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698