From 5383d4fd19b55afa81417ef844bb895b9213ec14 Mon Sep 17 00:00:00 2001
From: "lrn@google.com" <lrn@google.com>
Date: Fri, 15 Mar 2013 09:15:39 +0000
Subject: [PATCH] Change getRange to sublist. Make getRange deprecated.

This changes the exception behavior of getRange. It used to accept
a length of zero, no matter what start value. Now the start value
must be a valid list index.

Review URL: https://codereview.chromium.org//12817003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@20064 260f80e4-7a28-3924-810f-c04153c831b5
---
 lib/src/pub.dart   | 3 +--
 test/test_pub.dart | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/src/pub.dart b/lib/src/pub.dart
index 1c7830b9..1c05c45b 100644
--- a/lib/src/pub.dart
+++ b/lib/src/pub.dart
@@ -137,8 +137,7 @@ main() {
       return;
     }
 
-    var commandArgs =
-        globalOptions.rest.getRange(1, globalOptions.rest.length - 1);
+    var commandArgs = globalOptions.rest.sublist(1);
     command.run(cache, globalOptions, commandArgs);
   });
 }
diff --git a/test/test_pub.dart b/test/test_pub.dart
index a0150ceb..8c9730d7 100644
--- a/test/test_pub.dart
+++ b/test/test_pub.dart
@@ -1025,7 +1025,7 @@ class DirectoryDescriptor extends Descriptor {
 
     for (var descriptor in contents) {
       if (descriptor.name == path[0]) {
-        return descriptor.load(path.getRange(1, path.length - 1));
+        return descriptor.load(path.sublist(1));
       }
     }
 
-- 
GitLab