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

Unified Diff: sdk/lib/_internal/compiler/js_lib/string_helper.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
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/js_string.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/js_lib/string_helper.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/string_helper.dart b/sdk/lib/_internal/compiler/js_lib/string_helper.dart
index 0206fe197a9e0605f79ed756fc63f8f7f854a8a4..51b696bc708c5b5fb401cf72de21a19fb9a55553 100644
--- a/sdk/lib/_internal/compiler/js_lib/string_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/string_helper.dart
@@ -145,10 +145,11 @@ stringReplaceAllFuncUnchecked(receiver, pattern, onMatch, onNonMatch) {
return stringReplaceAllStringFuncUnchecked(receiver, pattern,
onMatch, onNonMatch);
}
- // Pattern test here is indistingishable from at the top of the method but we
- // don't need to do it on the `pattern is String` path.
+ // Placing the Pattern test here is indistingishable from placing it at the
+ // top of the method but it saves an extra check on the `pattern is String`
+ // path.
if (pattern is! Pattern) {
- throw new ArgumentError("${pattern} is not a Pattern");
+ throw new ArgumentError.value(pattern, 'pattern', 'is not a Pattern');
}
StringBuffer buffer = new StringBuffer();
int startIndex = 0;
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/js_string.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698