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

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

Issue 1181003005: Use ArgumentError.value in more places in js_lib. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months 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
Index: sdk/lib/_internal/compiler/js_lib/js_array.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/js_array.dart b/sdk/lib/_internal/compiler/js_lib/js_array.dart
index 7283f21f667f81e6943acb950095d8aa851e1d08..f6bcbbbe6d382bdd4a1e136d6ff73bc0fa84b918 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_array.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_array.dart
@@ -105,7 +105,7 @@ class JSArray<E> extends Interceptor implements List<E>, JSIndexable {
E removeAt(int index) {
checkGrowable('removeAt');
- if (index is !int) throw new ArgumentError(index);
+ if (index is !int) throw argumentErrorValue(index);
if (index < 0 || index >= length) {
throw new RangeError.value(index);
}
@@ -114,7 +114,7 @@ class JSArray<E> extends Interceptor implements List<E>, JSIndexable {
void insert(int index, E value) {
checkGrowable('insert');
- if (index is !int) throw new ArgumentError(index);
+ if (index is !int) throw argumentErrorValue(index);
if (index < 0 || index > length) {
throw new RangeError.value(index);
}
@@ -341,14 +341,14 @@ class JSArray<E> extends Interceptor implements List<E>, JSIndexable {
List<E> sublist(int start, [int end]) {
checkNull(start); // TODO(ahe): This is not specified but co19 tests it.
- if (start is !int) throw new ArgumentError(start);
+ if (start is !int) throw argumentErrorValue(start);
if (start < 0 || start > length) {
throw new RangeError.range(start, 0, length);
}
if (end == null) {
end = length;
} else {
- if (end is !int) throw new ArgumentError(end);
+ if (end is !int) throw argumentErrorValue(end);
if (end < start || end > length) {
throw new RangeError.range(end, start, length);
}
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/interceptors.dart ('k') | sdk/lib/_internal/compiler/js_lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698