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; |