Chromium Code Reviews| 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..3ba213ad66586217e4da62e3e15b9f1bd522f196 100644 |
| --- a/sdk/lib/_internal/compiler/js_lib/js_string.dart |
| +++ b/sdk/lib/_internal/compiler/js_lib/js_string.dart |
| @@ -97,6 +97,16 @@ class JSString extends Interceptor implements String, JSIndexable { |
| } |
| } |
| + String replaceRange(String replacement, int start, [int end]) { |
| + checkString(replacement); |
| + checkInt(start); |
| + end = RangeError.checkValidRange(start, end, this.length); |
| + checkInt(end); |
| + var prefix = JS('String', '#.substring(0, #)', this, start); |
| + var suffix = JS('String', '#.substring(#)', this, end); |
| + return "$prefix$replacement$suffix"; |
|
sra1
2015/02/23 18:58:27
There are use cases for an unchecked version.
rep
Lasse Reichstein Nielsen
2015/02/25 12:09:09
Done.
|
| + } |
| + |
| List<String> _defaultSplit(Pattern pattern) { |
| List<String> result = <String>[]; |
| // End of most recent match. That is, start of next part to add to result. |