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

Unified Diff: sdk/lib/_internal/compiler/js_lib/native_typed_data.dart

Issue 713243002: Arguments swapped in IndexError constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/core/errors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/js_lib/native_typed_data.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/native_typed_data.dart b/sdk/lib/_internal/compiler/js_lib/native_typed_data.dart
index 3267296bec6375bb31e9041eed3c1c0f7c495af2..7769b46b4923f3af8369eeae22b418905e6288e9 100644
--- a/sdk/lib/_internal/compiler/js_lib/native_typed_data.dart
+++ b/sdk/lib/_internal/compiler/js_lib/native_typed_data.dart
@@ -149,7 +149,10 @@ class NativeFloat32x4List
void _invalidIndex(int index, int length) {
if (index < 0 || index >= length) {
Lasse Reichstein Nielsen 2014/11/11 10:23:15 This check is also used for things that are not pu
- throw new RangeError.index(index, this);
+ if (length == this.length) {
+ throw new RangeError.index(index, this);
+ }
+ throw new RangeError.range(index, 0, length - 1);
} else {
throw new ArgumentError('Invalid list index $index');
}
@@ -255,7 +258,10 @@ class NativeInt32x4List
void _invalidIndex(int index, int length) {
if (index < 0 || index >= length) {
- throw new RangeError.index(index, this);
+ if (length == this.length) {
+ throw new RangeError.index(index, this);
+ }
+ throw new RangeError.range(index, 0, length - 1);
} else {
throw new ArgumentError('Invalid list index $index');
}
@@ -361,7 +367,10 @@ class NativeFloat64x2List
void _invalidIndex(int index, int length) {
if (index < 0 || index >= length) {
- throw new RangeError.index(index, this);
+ if (length == this.length) {
+ throw new RangeError.index(index, this);
+ }
+ throw new RangeError.range(index, 0, length - 1);
} else {
throw new ArgumentError('Invalid list index $index');
}
@@ -438,7 +447,10 @@ class NativeTypedData implements TypedData {
void _invalidIndex(int index, int length) {
if (index < 0 || index >= length) {
- throw new RangeError.index(index, this);
+ if (length == this.length) {
+ throw new RangeError.index(index, this);
+ }
+ throw new RangeError.range(index, 0, length - 1);
} else {
throw new ArgumentError('Invalid list index $index');
}
« no previous file with comments | « no previous file | sdk/lib/core/errors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698