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

Unified Diff: lib/src/pubspec.dart

Issue 2184303002: Make pub strong-mode clean. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 4 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 | « lib/src/package_graph.dart ('k') | lib/src/solver/backtracking_solver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/pubspec.dart
diff --git a/lib/src/pubspec.dart b/lib/src/pubspec.dart
index 254c18844e680ca932ccbc6f8b65b5d8a8d0cd24..2186cdef17e236eccc1ade8cf444dce4273eaf95 100644
--- a/lib/src/pubspec.dart
+++ b/lib/src/pubspec.dart
@@ -151,7 +151,7 @@ class Pubspec {
fields.nodes['transformers'].span);
}
- _transformers = transformers.nodes.map((phase) {
+ _transformers = (transformers as YamlList).nodes.map((phase) {
var phaseNodes = phase is YamlList ? phase.nodes : [phase];
return phaseNodes.map((transformerNode) {
var transformer = transformerNode.value;
@@ -428,14 +428,17 @@ class Pubspec {
factory Pubspec.parse(String contents, SourceRegistry sources,
{String expectedName, Uri location}) {
var pubspecNode = loadYamlNode(contents, sourceUrl: location);
+ Map pubspecMap;
if (pubspecNode is YamlScalar && pubspecNode.value == null) {
- pubspecNode = new YamlMap(sourceUrl: location);
- } else if (pubspecNode is! YamlMap) {
+ pubspecMap = new YamlMap(sourceUrl: location);
+ } else if (pubspecNode is YamlMap) {
+ pubspecMap = pubspecNode;
+ } else {
throw new PubspecException(
'The pubspec must be a YAML mapping.', pubspecNode.span);
}
- return new Pubspec.fromMap(pubspecNode, sources,
+ return new Pubspec.fromMap(pubspecMap, sources,
expectedName: expectedName, location: location);
}
« no previous file with comments | « lib/src/package_graph.dart ('k') | lib/src/solver/backtracking_solver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698