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

Unified Diff: runtime/lib/string_patch.dart

Issue 13874008: Remove String.slice. Too much overlap with String.substring. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add VM changes. Created 7 years, 8 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 | « no previous file | sdk/lib/_internal/compiler/implementation/lib/js_string.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/string_patch.dart
diff --git a/runtime/lib/string_patch.dart b/runtime/lib/string_patch.dart
index 43101b0e47580695298a33a27c167640876e4aeb..2d148ecaabe36a4f843623b3deb54278504e4439 100644
--- a/runtime/lib/string_patch.dart
+++ b/runtime/lib/string_patch.dart
@@ -157,41 +157,6 @@ class _StringBase {
return _substringUnchecked(startIndex, endIndex);
}
- String slice([int startIndex, int endIndex]) {
- int start, end;
- if (startIndex == null) {
- start = 0;
- } else if (startIndex is! int) {
- throw new ArgumentError("startIndex is not int");
- } else if (startIndex >= 0) {
- start = startIndex;
- } else {
- start = this.length + startIndex;
- }
- if (start < 0 || start > this.length) {
- throw new RangeError(
- "startIndex out of range: $startIndex (length: $length)");
- }
- if (endIndex == null) {
- end = this.length;
- } else if (endIndex is! int) {
- throw new ArgumentError("endIndex is not int");
- } else if (endIndex >= 0) {
- end = endIndex;
- } else {
- end = this.length + endIndex;
- }
- if (end < 0 || end > this.length) {
- throw new RangeError(
- "endIndex out of range: $endIndex (length: $length)");
- }
- if (end < start) {
- throw new ArgumentError(
- "End before start: $endIndex < $startIndex (length: $length)");
- }
- return _substringUnchecked(start, end);
- }
-
String _substringUnchecked(int startIndex, int endIndex) {
assert(endIndex != null);
assert((startIndex >= 0) && (startIndex <= this.length));
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/lib/js_string.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698