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

Side by Side Diff: sdk/lib/typed_data/dart2js/typed_data_dart2js.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 | « sdk/lib/io/platform_impl.dart ('k') | tests/corelib/collection_length_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) 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 /// The Dart TypedData library. 5 /// The Dart TypedData library.
6 library dart.typed_data; 6 library dart.typed_data;
7 7
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:_collection-dev'; 9 import 'dart:_collection-dev';
10 import 'dart:_js_helper' show Creates, JavaScriptIndexingBehavior, JSName, Null, Returns; 10 import 'dart:_js_helper' show Creates, JavaScriptIndexingBehavior, JSName, Null, Returns;
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 307
308 bool any(bool f(num element)) => IterableMixinWorkaround.any(this, f); 308 bool any(bool f(num element)) => IterableMixinWorkaround.any(this, f);
309 309
310 List<num> toList({ bool growable: true }) => 310 List<num> toList({ bool growable: true }) =>
311 new List<num>.from(this, growable: growable); 311 new List<num>.from(this, growable: growable);
312 312
313 Set<num> toSet() => new Set<num>.from(this); 313 Set<num> toSet() => new Set<num>.from(this);
314 314
315 bool get isEmpty => this.length == 0; 315 bool get isEmpty => this.length == 0;
316 316
317 bool get isNotEmpty => !isEmpty;
318
317 Iterable<num> take(int n) => IterableMixinWorkaround.takeList(this, n); 319 Iterable<num> take(int n) => IterableMixinWorkaround.takeList(this, n);
318 320
319 Iterable<num> takeWhile(bool test(num value)) { 321 Iterable<num> takeWhile(bool test(num value)) {
320 return IterableMixinWorkaround.takeWhile(this, test); 322 return IterableMixinWorkaround.takeWhile(this, test);
321 } 323 }
322 324
323 Iterable<num> skip(int n) => IterableMixinWorkaround.skipList(this, n); 325 Iterable<num> skip(int n) => IterableMixinWorkaround.skipList(this, n);
324 326
325 Iterable<num> skipWhile(bool test(num value)) { 327 Iterable<num> skipWhile(bool test(num value)) {
326 return IterableMixinWorkaround.skipWhile(this, test); 328 return IterableMixinWorkaround.skipWhile(this, test);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 529
528 bool any(bool f(num element)) => IterableMixinWorkaround.any(this, f); 530 bool any(bool f(num element)) => IterableMixinWorkaround.any(this, f);
529 531
530 List<num> toList({ bool growable: true }) => 532 List<num> toList({ bool growable: true }) =>
531 new List<num>.from(this, growable: growable); 533 new List<num>.from(this, growable: growable);
532 534
533 Set<num> toSet() => new Set<num>.from(this); 535 Set<num> toSet() => new Set<num>.from(this);
534 536
535 bool get isEmpty => this.length == 0; 537 bool get isEmpty => this.length == 0;
536 538
539 bool get isNotEmpty => !isEmpty;
540
537 Iterable<num> take(int n) => IterableMixinWorkaround.takeList(this, n); 541 Iterable<num> take(int n) => IterableMixinWorkaround.takeList(this, n);
538 542
539 Iterable<num> takeWhile(bool test(num value)) { 543 Iterable<num> takeWhile(bool test(num value)) {
540 return IterableMixinWorkaround.takeWhile(this, test); 544 return IterableMixinWorkaround.takeWhile(this, test);
541 } 545 }
542 546
543 Iterable<num> skip(int n) => IterableMixinWorkaround.skipList(this, n); 547 Iterable<num> skip(int n) => IterableMixinWorkaround.skipList(this, n);
544 548
545 Iterable<num> skipWhile(bool test(num value)) { 549 Iterable<num> skipWhile(bool test(num value)) {
546 return IterableMixinWorkaround.skipWhile(this, test); 550 return IterableMixinWorkaround.skipWhile(this, test);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 751
748 bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f); 752 bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
749 753
750 List<int> toList({ bool growable: true }) => 754 List<int> toList({ bool growable: true }) =>
751 new List<int>.from(this, growable: growable); 755 new List<int>.from(this, growable: growable);
752 756
753 Set<int> toSet() => new Set<int>.from(this); 757 Set<int> toSet() => new Set<int>.from(this);
754 758
755 bool get isEmpty => this.length == 0; 759 bool get isEmpty => this.length == 0;
756 760
761 bool get isNotEmpty => !isEmpty;
762
757 Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n); 763 Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
758 764
759 Iterable<int> takeWhile(bool test(int value)) { 765 Iterable<int> takeWhile(bool test(int value)) {
760 return IterableMixinWorkaround.takeWhile(this, test); 766 return IterableMixinWorkaround.takeWhile(this, test);
761 } 767 }
762 768
763 Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n); 769 Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
764 770
765 Iterable<int> skipWhile(bool test(int value)) { 771 Iterable<int> skipWhile(bool test(int value)) {
766 return IterableMixinWorkaround.skipWhile(this, test); 772 return IterableMixinWorkaround.skipWhile(this, test);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 973
968 bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f); 974 bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
969 975
970 List<int> toList({ bool growable: true }) => 976 List<int> toList({ bool growable: true }) =>
971 new List<int>.from(this, growable: growable); 977 new List<int>.from(this, growable: growable);
972 978
973 Set<int> toSet() => new Set<int>.from(this); 979 Set<int> toSet() => new Set<int>.from(this);
974 980
975 bool get isEmpty => this.length == 0; 981 bool get isEmpty => this.length == 0;
976 982
983 bool get isNotEmpty => !isEmpty;
984
977 Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n); 985 Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
978 986
979 Iterable<int> takeWhile(bool test(int value)) { 987 Iterable<int> takeWhile(bool test(int value)) {
980 return IterableMixinWorkaround.takeWhile(this, test); 988 return IterableMixinWorkaround.takeWhile(this, test);
981 } 989 }
982 990
983 Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n); 991 Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
984 992
985 Iterable<int> skipWhile(bool test(int value)) { 993 Iterable<int> skipWhile(bool test(int value)) {
986 return IterableMixinWorkaround.skipWhile(this, test); 994 return IterableMixinWorkaround.skipWhile(this, test);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 1195
1188 bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f); 1196 bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
1189 1197
1190 List<int> toList({ bool growable: true }) => 1198 List<int> toList({ bool growable: true }) =>
1191 new List<int>.from(this, growable: growable); 1199 new List<int>.from(this, growable: growable);
1192 1200
1193 Set<int> toSet() => new Set<int>.from(this); 1201 Set<int> toSet() => new Set<int>.from(this);
1194 1202
1195 bool get isEmpty => this.length == 0; 1203 bool get isEmpty => this.length == 0;
1196 1204
1205 bool get isNotEmpty => !isEmpty;
1206
1197 Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n); 1207 Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
1198 1208
1199 Iterable<int> takeWhile(bool test(int value)) { 1209 Iterable<int> takeWhile(bool test(int value)) {
1200 return IterableMixinWorkaround.takeWhile(this, test); 1210 return IterableMixinWorkaround.takeWhile(this, test);
1201 } 1211 }
1202 1212
1203 Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n); 1213 Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
1204 1214
1205 Iterable<int> skipWhile(bool test(int value)) { 1215 Iterable<int> skipWhile(bool test(int value)) {
1206 return IterableMixinWorkaround.skipWhile(this, test); 1216 return IterableMixinWorkaround.skipWhile(this, test);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 1417
1408 bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f); 1418 bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
1409 1419
1410 List<int> toList({ bool growable: true }) => 1420 List<int> toList({ bool growable: true }) =>
1411 new List<int>.from(this, growable: growable); 1421 new List<int>.from(this, growable: growable);
1412 1422
1413 Set<int> toSet() => new Set<int>.from(this); 1423 Set<int> toSet() => new Set<int>.from(this);
1414 1424
1415 bool get isEmpty => this.length == 0; 1425 bool get isEmpty => this.length == 0;
1416 1426
1427 bool get isNotEmpty => !isEmpty;
1428
1417 Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n); 1429 Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
1418 1430
1419 Iterable<int> takeWhile(bool test(int value)) { 1431 Iterable<int> takeWhile(bool test(int value)) {
1420 return IterableMixinWorkaround.takeWhile(this, test); 1432 return IterableMixinWorkaround.takeWhile(this, test);
1421 } 1433 }
1422 1434
1423 Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n); 1435 Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
1424 1436
1425 Iterable<int> skipWhile(bool test(int value)) { 1437 Iterable<int> skipWhile(bool test(int value)) {
1426 return IterableMixinWorkaround.skipWhile(this, test); 1438 return IterableMixinWorkaround.skipWhile(this, test);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 1639
1628 bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f); 1640 bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
1629 1641
1630 List<int> toList({ bool growable: true }) => 1642 List<int> toList({ bool growable: true }) =>
1631 new List<int>.from(this, growable: growable); 1643 new List<int>.from(this, growable: growable);
1632 1644
1633 Set<int> toSet() => new Set<int>.from(this); 1645 Set<int> toSet() => new Set<int>.from(this);
1634 1646
1635 bool get isEmpty => this.length == 0; 1647 bool get isEmpty => this.length == 0;
1636 1648
1649 bool get isNotEmpty => !isEmpty;
1650
1637 Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n); 1651 Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
1638 1652
1639 Iterable<int> takeWhile(bool test(int value)) { 1653 Iterable<int> takeWhile(bool test(int value)) {
1640 return IterableMixinWorkaround.takeWhile(this, test); 1654 return IterableMixinWorkaround.takeWhile(this, test);
1641 } 1655 }
1642 1656
1643 Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n); 1657 Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
1644 1658
1645 Iterable<int> skipWhile(bool test(int value)) { 1659 Iterable<int> skipWhile(bool test(int value)) {
1646 return IterableMixinWorkaround.skipWhile(this, test); 1660 return IterableMixinWorkaround.skipWhile(this, test);
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1846 1860
1847 bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f); 1861 bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
1848 1862
1849 List<int> toList({ bool growable: true }) => 1863 List<int> toList({ bool growable: true }) =>
1850 new List<int>.from(this, growable: growable); 1864 new List<int>.from(this, growable: growable);
1851 1865
1852 Set<int> toSet() => new Set<int>.from(this); 1866 Set<int> toSet() => new Set<int>.from(this);
1853 1867
1854 bool get isEmpty => this.length == 0; 1868 bool get isEmpty => this.length == 0;
1855 1869
1870 bool get isNotEmpty => !isEmpty;
1871
1856 Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n); 1872 Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
1857 1873
1858 Iterable<int> takeWhile(bool test(int value)) { 1874 Iterable<int> takeWhile(bool test(int value)) {
1859 return IterableMixinWorkaround.takeWhile(this, test); 1875 return IterableMixinWorkaround.takeWhile(this, test);
1860 } 1876 }
1861 1877
1862 Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n); 1878 Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
1863 1879
1864 Iterable<int> skipWhile(bool test(int value)) { 1880 Iterable<int> skipWhile(bool test(int value)) {
1865 return IterableMixinWorkaround.skipWhile(this, test); 1881 return IterableMixinWorkaround.skipWhile(this, test);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
2066 2082
2067 bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f); 2083 bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
2068 2084
2069 List<int> toList({ bool growable: true }) => 2085 List<int> toList({ bool growable: true }) =>
2070 new List<int>.from(this, growable: growable); 2086 new List<int>.from(this, growable: growable);
2071 2087
2072 Set<int> toSet() => new Set<int>.from(this); 2088 Set<int> toSet() => new Set<int>.from(this);
2073 2089
2074 bool get isEmpty => this.length == 0; 2090 bool get isEmpty => this.length == 0;
2075 2091
2092 bool get isNotEmpty => !isEmpty;
2093
2076 Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n); 2094 Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
2077 2095
2078 Iterable<int> takeWhile(bool test(int value)) { 2096 Iterable<int> takeWhile(bool test(int value)) {
2079 return IterableMixinWorkaround.takeWhile(this, test); 2097 return IterableMixinWorkaround.takeWhile(this, test);
2080 } 2098 }
2081 2099
2082 Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n); 2100 Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
2083 2101
2084 Iterable<int> skipWhile(bool test(int value)) { 2102 Iterable<int> skipWhile(bool test(int value)) {
2085 return IterableMixinWorkaround.skipWhile(this, test); 2103 return IterableMixinWorkaround.skipWhile(this, test);
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
2444 static Uint32List _U32_3(arg1, arg2, arg3) => 2462 static Uint32List _U32_3(arg1, arg2, arg3) =>
2445 JS('Uint32List', 'new Uint32Array(#, #, #)', arg1, arg2, arg3); 2463 JS('Uint32List', 'new Uint32Array(#, #, #)', arg1, arg2, arg3);
2446 static Uint8ClampedList _U8C_3(arg1, arg2, arg3) => 2464 static Uint8ClampedList _U8C_3(arg1, arg2, arg3) =>
2447 JS('Uint8ClampedList', 'new Uint8ClampedArray(#, #, #)', arg1, arg2, arg3) ; 2465 JS('Uint8ClampedList', 'new Uint8ClampedArray(#, #, #)', arg1, arg2, arg3) ;
2448 2466
2449 2467
2450 // Ensures that [list] is a JavaScript Array or a typed array. If necessary, 2468 // Ensures that [list] is a JavaScript Array or a typed array. If necessary,
2451 // copies the list. 2469 // copies the list.
2452 static ensureNative(List list) => list; // TODO: make sure. 2470 static ensureNative(List list) => list; // TODO: make sure.
2453 } 2471 }
OLDNEW
« no previous file with comments | « sdk/lib/io/platform_impl.dart ('k') | tests/corelib/collection_length_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698