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

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

Issue 8400038: Use strict equality when comparing with null, especially when null is a default value. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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/bin/string_stream.dart ('k') | runtime/vm/snapshot_test.dart » ('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) 2011, 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
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } 128 }
129 for (int index = fromIndex; index >= 0; index--) { 129 for (int index = fromIndex; index >= 0; index--) {
130 if (this.substringMatches(index, other)) { 130 if (this.substringMatches(index, other)) {
131 return index; 131 return index;
132 } 132 }
133 } 133 }
134 return -1; 134 return -1;
135 } 135 }
136 136
137 String substring(int startIndex, [int endIndex]) { 137 String substring(int startIndex, [int endIndex]) {
138 if (endIndex == null) endIndex = this.length; 138 if (endIndex === null) endIndex = this.length;
139 139
140 if ((startIndex < 0) || (startIndex > this.length)) { 140 if ((startIndex < 0) || (startIndex > this.length)) {
141 throw new IndexOutOfRangeException(startIndex); 141 throw new IndexOutOfRangeException(startIndex);
142 } 142 }
143 if ((endIndex < 0) || (endIndex > this.length)) { 143 if ((endIndex < 0) || (endIndex > this.length)) {
144 throw new IndexOutOfRangeException(endIndex); 144 throw new IndexOutOfRangeException(endIndex);
145 } 145 }
146 if (startIndex > endIndex) { 146 if (startIndex > endIndex) {
147 throw new IndexOutOfRangeException(startIndex); 147 throw new IndexOutOfRangeException(startIndex);
148 } 148 }
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 for (int g in groups) { 435 for (int g in groups) {
436 result.add(group(g)); 436 result.add(group(g));
437 } 437 }
438 return result; 438 return result;
439 } 439 }
440 440
441 final int _start; 441 final int _start;
442 final String str; 442 final String str;
443 final String pattern; 443 final String pattern;
444 } 444 }
OLDNEW
« no previous file with comments | « runtime/bin/string_stream.dart ('k') | runtime/vm/snapshot_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698