Add some ArgumentError and RangeError constructors that capture more information.
Switch some uses of RangeError.range to RangeError.index.
Fix bug in Queue where elementAt allowed `length` as input.
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//711003002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart/pkg/typed_data@41653 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/lib/typed_buffers.dart b/lib/typed_buffers.dart
index b880338..50ed241 100644
--- a/lib/typed_buffers.dart
+++ b/lib/typed_buffers.dart
@@ -32,12 +32,12 @@
int get length => _length;
E operator[](int index) {
- if (index >= length) throw new RangeError.range(index, 0, length - 1);
+ if (index >= length) throw new RangeError.index(index, this);
return _buffer[index];
}
void operator[]=(int index, E value) {
- if (index >= length) throw new RangeError.range(index, 0, length - 1);
+ if (index >= length) throw new RangeError.index(index, this);
_buffer[index] = value;
}
diff --git a/pubspec.yaml b/pubspec.yaml
index 5688a24..b4c3945 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: typed_data
-version: 1.0.0
+version: 1.0.1-dev
author: Dart Team <misc@dartlang.org>
description: Utility functions and classes related to the 'dart:typed_data' library.
homepage: http://www.dartlang.org