mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 15:17:07 +00:00
There are NativeTypedData classes that aren't lists and have no "length".
Review URL: https://codereview.chromium.org//714873002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41661 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
e0ed6f6385
commit
b22e265e1f
1 changed files with 5 additions and 2 deletions
|
@ -447,8 +447,11 @@ class NativeTypedData implements TypedData {
|
|||
|
||||
void _invalidIndex(int index, int length) {
|
||||
if (index < 0 || index >= length) {
|
||||
if (length == this.length) {
|
||||
throw new RangeError.index(index, this);
|
||||
if (this is List) {
|
||||
var list = this; // Typed as dynamic to avoid warning.
|
||||
if (length == list.length) {
|
||||
throw new RangeError.index(index, this);
|
||||
}
|
||||
}
|
||||
throw new RangeError.range(index, 0, length - 1);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue