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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/js_string.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 | « runtime/lib/string_patch.dart ('k') | sdk/lib/core/string.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/lib/js_string.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_string.dart b/sdk/lib/_internal/compiler/implementation/lib/js_string.dart
index e6184c0d893fc9fe19a4db0f3bc1b97c00464754..56a494daee63d7b666ce7fea20fa0e0b46946e91 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_string.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_string.dart
@@ -89,42 +89,6 @@ class JSString extends Interceptor implements String, JSIndexable {
return JS('String', r'#.substring(#, #)', this, 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 JS('String', '#.substring(#, #)', this, start, end);
- }
-
-
String toLowerCase() {
return JS('String', r'#.toLowerCase()', this);
}
« no previous file with comments | « runtime/lib/string_patch.dart ('k') | sdk/lib/core/string.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698