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

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

Issue 12441003: Rename String.concat to operator+. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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
OLDNEW
1 // Copyright (c) 2012, 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 6 * [_StringBase] contains common methods used by concrete String
7 * implementations, e.g., _OneByteString. 7 * implementations, e.g., _OneByteString.
8 */ 8 */
9 class _StringBase { 9 class _StringBase {
10 10
(...skipping 28 matching lines...) Expand all
39 String operator [](int index) native "String_charAt"; 39 String operator [](int index) native "String_charAt";
40 40
41 int codeUnitAt(int index) native "String_codeUnitAt"; 41 int codeUnitAt(int index) native "String_codeUnitAt";
42 42
43 int get length native "String_getLength"; 43 int get length native "String_getLength";
44 44
45 bool get isEmpty { 45 bool get isEmpty {
46 return this.length == 0; 46 return this.length == 0;
47 } 47 }
48 48
49 String concat(String other) native "String_concat"; 49 String operator +(String other) native "String_concat";
50
51 String concat(String other) => this + other;
50 52
51 String toString() { 53 String toString() {
52 return this; 54 return this;
53 } 55 }
54 56
55 bool operator ==(Object other) { 57 bool operator ==(Object other) {
56 if (identical(this, other)) { 58 if (identical(this, other)) {
57 return true; 59 return true;
58 } 60 }
59 if ((other is !String) || 61 if ((other is !String) ||
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 for (int g in groups) { 606 for (int g in groups) {
605 result.add(group(g)); 607 result.add(group(g));
606 } 608 }
607 return result; 609 return result;
608 } 610 }
609 611
610 final int start; 612 final int start;
611 final String str; 613 final String str;
612 final String pattern; 614 final String pattern;
613 } 615 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698