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

Unified Diff: sdk/lib/_internal/compiler/js_lib/js_string.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_string.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/js_string.dart b/sdk/lib/_internal/compiler/js_lib/js_string.dart
index e381b1f24c100b3f78ba40b5fd5bfce762692d91..ed8189dd3a814c093dae1ea8510945c40eb10420 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_string.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_string.dart
@@ -383,7 +383,7 @@ class JSString extends Interceptor implements String, JSIndexable {
int indexOf(Pattern pattern, [int start = 0]) {
checkNull(pattern);
- if (start is! int) throw new ArgumentError(start);
+ if (start is! int) throw argumentErrorValue(start);
if (start < 0 || start > this.length) {
throw new RangeError.range(start, 0, this.length);
}
@@ -406,7 +406,7 @@ class JSString extends Interceptor implements String, JSIndexable {
if (start == null) {
start = length;
} else if (start is! int) {
- throw new ArgumentError(start);
+ throw argumentErrorValue(start);
} else if (start < 0 || start > this.length) {
throw new RangeError.range(start, 0, this.length);
}
@@ -436,7 +436,7 @@ class JSString extends Interceptor implements String, JSIndexable {
bool get isNotEmpty => !isEmpty;
int compareTo(String other) {
- if (other is !String) throw new ArgumentError(other);
+ if (other is !String) throw argumentErrorValue(other);
return this == other ? 0
: JS('bool', r'# < #', this, other) ? -1 : 1;
}
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/js_number.dart ('k') | sdk/lib/_internal/compiler/js_lib/string_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698