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

Side by Side Diff: runtime/lib/typed_data.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/string_patch.dart ('k') | samples/swarm/swarm_ui_lib/observable/observable.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 classes for Int8List ..... Float64List and ByteData implementations. 5 // patch classes for Int8List ..... Float64List and ByteData implementations.
6 6
7 patch class Int8List { 7 patch class Int8List {
8 /* patch */ factory Int8List(int length) { 8 /* patch */ factory Int8List(int length) {
9 return new _Int8Array(length); 9 return new _Int8Array(length);
10 } 10 }
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 } 351 }
352 352
353 int elementAt(int index) { 353 int elementAt(int index) {
354 return this[index]; 354 return this[index];
355 } 355 }
356 356
357 bool get isEmpty { 357 bool get isEmpty {
358 return this.length == 0; 358 return this.length == 0;
359 } 359 }
360 360
361 bool get isNotEmpty => !isEmpty;
361 362
362 // Method(s) implementing the List interface. 363 // Method(s) implementing the List interface.
363 364
364 set length(newLength) { 365 set length(newLength) {
365 throw new UnsupportedError( 366 throw new UnsupportedError(
366 "Cannot resize a non-extendable array"); 367 "Cannot resize a non-extendable array");
367 } 368 }
368 369
369 void add(value) { 370 void add(value) {
370 throw new UnsupportedError( 371 throw new UnsupportedError(
(...skipping 2734 matching lines...) Expand 10 before | Expand all | Expand 10 after
3105 return value; 3106 return value;
3106 } 3107 }
3107 return object; 3108 return object;
3108 } 3109 }
3109 3110
3110 3111
3111 void _throwRangeError(int index, int length) { 3112 void _throwRangeError(int index, int length) {
3112 String message = "$index must be in the range [0..$length)"; 3113 String message = "$index must be in the range [0..$length)";
3113 throw new RangeError(message); 3114 throw new RangeError(message);
3114 } 3115 }
OLDNEW
« no previous file with comments | « runtime/lib/string_patch.dart ('k') | samples/swarm/swarm_ui_lib/observable/observable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698