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

Unified Diff: sdk/lib/_internal/pub/lib/src/lock_file.dart

Issue 412553002: Handle lockfiles with null path. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/lock_file.dart
diff --git a/sdk/lib/_internal/pub/lib/src/lock_file.dart b/sdk/lib/_internal/pub/lib/src/lock_file.dart
index 9dacba2e93e73bec542e425d0dbab14c6a22ec33..128a3a9c5a3a505c4af04149a93b9c93f5ff64a4 100644
--- a/sdk/lib/_internal/pub/lib/src/lock_file.dart
+++ b/sdk/lib/_internal/pub/lib/src/lock_file.dart
@@ -45,13 +45,18 @@ class LockFile {
}
/// Parses the lockfile whose text is [contents].
+ ///
+ /// [filePath] is the system-native path to the lockfile on disc. It may be
+ /// `null`.
static LockFile _parse(String filePath, String contents,
SourceRegistry sources) {
var packages = <String, PackageId>{};
if (contents.trim() == '') return new LockFile.empty();
- var parsed = loadYamlNode(contents,
- sourceName: p.toUri(filePath).toString());
+
+ var sourceName;
+ if (filePath != null) sourceName = p.toUri(filePath).toString();
+ var parsed = loadYamlNode(contents, sourceName: sourceName);
_validate(parsed is Map, 'The lockfile must be a YAML mapping.', parsed);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698