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

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

Issue 415873002: Fix some merge issues with using source_span in pub. (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 128a3a9c5a3a505c4af04149a93b9c93f5ff64a4..7501951ba2167ba88ba439bf3b940e3b6dfa3b3e 100644
--- a/sdk/lib/_internal/pub/lib/src/lock_file.dart
+++ b/sdk/lib/_internal/pub/lib/src/lock_file.dart
@@ -5,7 +5,7 @@
library pub.lock_file;
import 'package:path/path.dart' as p;
-import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
import 'package:yaml/yaml.dart';
import 'io.dart';
@@ -54,9 +54,9 @@ class LockFile {
if (contents.trim() == '') return new LockFile.empty();
- var sourceName;
- if (filePath != null) sourceName = p.toUri(filePath).toString();
- var parsed = loadYamlNode(contents, sourceName: sourceName);
+ var sourceUrl;
+ if (filePath != null) sourceUrl = p.toUri(filePath);
+ var parsed = loadYamlNode(contents, sourceUrl: sourceUrl);
_validate(parsed is Map, 'The lockfile must be a YAML mapping.', parsed);
@@ -86,7 +86,8 @@ class LockFile {
description = source.parseDescription(filePath, description,
fromLockFile: true);
} on FormatException catch (ex) {
- throw new SpanFormatException(ex.message, spec.nodes['source'].span);
+ throw new SourceSpanFormatException(ex.message,
+ spec.nodes['source'].span);
}
var id = new PackageId(name, sourceName, version, description);
@@ -105,7 +106,7 @@ class LockFile {
/// If [condition] is `false` throws a format error with [message] for [node].
static void _validate(bool condition, String message, YamlNode node) {
if (condition) return;
- throw new SpanFormatException(message, node.span);
+ throw new SourceSpanFormatException(message, node.span);
}
/// Returns the serialized YAML text of the lock file.
« 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