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

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

Issue 917663004: Revert "Add String.replaceFirstMapped." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 e682626f8d7200b197e511320b2d27497687ed22..67f37d500cedbd5a5f89ac27f7a2a0321f3431fe 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_string.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_string.dart
@@ -73,18 +73,12 @@ class JSString extends Interceptor implements String, JSIndexable {
String replaceFirst(Pattern from, String to, [int startIndex = 0]) {
checkString(to);
checkInt(startIndex);
- RangeError.checkValueInInterval(startIndex, 0, this.length, "startIndex");
+ if (startIndex < 0 || startIndex > this.length) {
+ throw new RangeError.range(startIndex, 0, this.length);
+ }
return stringReplaceFirstUnchecked(this, from, to, startIndex);
}
- String replaceFirstMapped(Pattern from, String replace(Match match),
- [int startIndex = 0]) {
- checkNull(replace);
- checkInt(startIndex);
- RangeError.checkValueInInterval(startIndex, 0, this.length, "startIndex");
- return stringReplaceFirstMappedUnchecked(this, from, replace, startIndex);
- }
-
List<String> split(Pattern pattern) {
checkNull(pattern);
if (pattern is String) {
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/interceptors.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