Skip to content

Commit

Permalink
Add some ArgumentError and RangeError constructors that capture more …
Browse files Browse the repository at this point in the history
…information.

Switch some uses of RangeError.range to RangeError.index.
Fix bug in Queue where elementAt allowed `length` as input.

[email protected]

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
lrhn committed Nov 11, 2014
1 parent 89de11a commit be5d543
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkgs/typed_data/lib/typed_buffers.dart
Original file line number Diff line number Diff line change
@@ -32,12 +32,12 @@ abstract class _TypedDataBuffer<E> extends ListBase<E> {

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;
}

2 changes: 1 addition & 1 deletion pkgs/typed_data/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: typed_data
version: 1.0.0
version: 1.0.1-dev
author: Dart Team <[email protected]>
description: Utility functions and classes related to the 'dart:typed_data' library.
homepage: http://www.dartlang.org

0 comments on commit be5d543

Please sign in to comment.