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

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

Issue 949753005: Add String.replaceRange and use it in replaceFirst{,Mapped}. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. 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..f7da941338759819188323fb4199c24bc9dbe48c 100644
--- a/sdk/lib/_internal/compiler/js_lib/js_string.dart
+++ b/sdk/lib/_internal/compiler/js_lib/js_string.dart
@@ -97,6 +97,14 @@ class JSString extends Interceptor implements String, JSIndexable {
}
}
+ String replaceRange(int start, int end, String replacement) {
+ checkString(replacement);
+ checkInt(start);
+ end = RangeError.checkValidRange(start, end, this.length);
+ checkInt(end);
+ return stringReplaceRangeUnchecked(this, start, end, replacement);
+ }
+
List<String> _defaultSplit(Pattern pattern) {
List<String> result = <String>[];
// End of most recent match. That is, start of next part to add to result.
« 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