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

Side by Side Diff: runtime/lib/string.dart

Issue 10829459: Deprecate Math object in corelib in favor of dart:math library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/math_patch.dart ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * [StringBase] contains common methods used by concrete String implementations, 6 * [StringBase] contains common methods used by concrete String implementations,
7 * e.g., OneByteString. 7 * e.g., OneByteString.
8 */ 8 */
9 class StringBase { 9 class StringBase {
10 10
11 factory StringBase._uninstantiable() { 11 factory StringBase._uninstantiable() {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 if (this.substringMatches(index, other)) { 120 if (this.substringMatches(index, other)) {
121 return index; 121 return index;
122 } 122 }
123 } 123 }
124 return -1; 124 return -1;
125 } 125 }
126 126
127 int lastIndexOf(String other, [int start = null]) { 127 int lastIndexOf(String other, [int start = null]) {
128 if (start == null) start = length - 1; 128 if (start == null) start = length - 1;
129 if (other.isEmpty()) { 129 if (other.isEmpty()) {
130 return Math.min(this.length, start); 130 return min(this.length, start);
131 } 131 }
132 if (start >= this.length) { 132 if (start >= this.length) {
133 start = this.length - 1; 133 start = this.length - 1;
134 } 134 }
135 for (int index = start; index >= 0; index--) { 135 for (int index = start; index >= 0; index--) {
136 if (this.substringMatches(index, other)) { 136 if (this.substringMatches(index, other)) {
137 return index; 137 return index;
138 } 138 }
139 } 139 }
140 return -1; 140 return -1;
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 for (int g in groups) { 497 for (int g in groups) {
498 result.add(group(g)); 498 result.add(group(g));
499 } 499 }
500 return result; 500 return result;
501 } 501 }
502 502
503 final int _start; 503 final int _start;
504 final String str; 504 final String str;
505 final String pattern; 505 final String pattern;
506 } 506 }
OLDNEW
« no previous file with comments | « runtime/lib/math_patch.dart ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698