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

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

Issue 15263004: Adding isNotEmpty property to collection and string. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix template generation Created 7 years, 6 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/immutable_map.dart ('k') | runtime/lib/typed_data.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) 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 patch class String { 5 patch class String {
6 /* patch */ factory String.fromCharCodes(Iterable<int> charCodes) { 6 /* patch */ factory String.fromCharCodes(Iterable<int> charCodes) {
7 return _StringBase.createFromCharCodes(charCodes); 7 return _StringBase.createFromCharCodes(charCodes);
8 } 8 }
9 } 9 }
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 String operator [](int index) native "String_charAt"; 63 String operator [](int index) native "String_charAt";
64 64
65 int codeUnitAt(int index) native "String_codeUnitAt"; 65 int codeUnitAt(int index) native "String_codeUnitAt";
66 66
67 int get length native "String_getLength"; 67 int get length native "String_getLength";
68 68
69 bool get isEmpty { 69 bool get isEmpty {
70 return this.length == 0; 70 return this.length == 0;
71 } 71 }
72 72
73 bool get isNotEmpty => !isEmpty;
74
73 String operator +(String other) native "String_concat"; 75 String operator +(String other) native "String_concat";
74 76
75 String concat(String other) => this + other; 77 String concat(String other) => this + other;
76 78
77 String toString() { 79 String toString() {
78 return this; 80 return this;
79 } 81 }
80 82
81 bool operator ==(Object other) { 83 bool operator ==(Object other) {
82 if (identical(this, other)) { 84 if (identical(this, other)) {
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 class _CodeUnits extends Object with ListMixin<int>, 667 class _CodeUnits extends Object with ListMixin<int>,
666 UnmodifiableListMixin<int> { 668 UnmodifiableListMixin<int> {
667 /** The string that this is the code units of. */ 669 /** The string that this is the code units of. */
668 String _string; 670 String _string;
669 671
670 _CodeUnits(this._string); 672 _CodeUnits(this._string);
671 673
672 int get length => _string.length; 674 int get length => _string.length;
673 int operator[](int i) => _string.codeUnitAt(i); 675 int operator[](int i) => _string.codeUnitAt(i);
674 } 676 }
OLDNEW
« no previous file with comments | « runtime/lib/immutable_map.dart ('k') | runtime/lib/typed_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698