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

Side by Side Diff: sdk/lib/_internal/pub/lib/src/package.dart

Issue 1142693002: Fix a crash in pub's version solver. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library pub.package; 5 library pub.package;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:barback/barback.dart'; 9 import 'package:barback/barback.dart';
10 import 'package:path/path.dart' as p; 10 import 'package:path/path.dart' as p;
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 } 392 }
393 393
394 /// A reference to a constrained range of versions of one package. 394 /// A reference to a constrained range of versions of one package.
395 class PackageDep extends _PackageName { 395 class PackageDep extends _PackageName {
396 /// The allowed package versions. 396 /// The allowed package versions.
397 final VersionConstraint constraint; 397 final VersionConstraint constraint;
398 398
399 PackageDep(String name, String source, this.constraint, description) 399 PackageDep(String name, String source, this.constraint, description)
400 : super(name, source, description); 400 : super(name, source, description);
401 401
402 PackageDep.magic(String name)
403 : super.magic(name),
404 constraint = Version.none;
405
402 String toString() { 406 String toString() {
403 if (isRoot) return "$name $constraint (root)"; 407 if (isRoot) return "$name $constraint (root)";
408 if (isMagic) return name;
404 return "$name $constraint from $source ($description)"; 409 return "$name $constraint from $source ($description)";
405 } 410 }
406 411
407 int get hashCode => name.hashCode ^ source.hashCode; 412 int get hashCode => name.hashCode ^ source.hashCode;
408 413
409 bool operator ==(other) { 414 bool operator ==(other) {
410 // TODO(rnystrom): We're assuming here that we don't need to delve into the 415 // TODO(rnystrom): We're assuming here that we don't need to delve into the
411 // description. 416 // description.
412 return other is PackageDep && 417 return other is PackageDep &&
413 other.name == name && 418 other.name == name &&
414 other.source == source && 419 other.source == source &&
415 other.constraint == constraint; 420 other.constraint == constraint;
416 } 421 }
417 } 422 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698