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

Unified Diff: test/generated_sdk/lib/core/list.dart

Issue 959913003: cleanup patch generation to preseve comments and remove @patch (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/generated_sdk/lib/core/int.dart ('k') | test/generated_sdk/lib/core/object.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/generated_sdk/lib/core/list.dart
diff --git a/test/generated_sdk/lib/core/list.dart b/test/generated_sdk/lib/core/list.dart
index 9d1e569606af9bc8f66c933b6c68287098de05c1..24e8eccf6109d04927d32819bef4e69d26f2a807 100644
--- a/test/generated_sdk/lib/core/list.dart
+++ b/test/generated_sdk/lib/core/list.dart
@@ -52,7 +52,28 @@ part of dart.core;
* break the iteration.
*/
abstract class List<E> implements Iterable<E>, EfficientLength {
- @patch
+ /**
+ * Creates a list of the given length.
+ *
+ * The created list is fixed-length if [length] is provided.
+ *
+ * List fixedLengthList = new List(3);
+ * fixedLengthList.length; // 3
+ * fixedLengthList.length = 1; // Error
+ *
+ * The list has length 0 and is growable if [length] is omitted.
+ *
+ * List growableList = new List();
+ * growableList.length; // 0;
+ * growableList.length = 3;
+ *
+ * To create a growable list with a given length, just assign the length
+ * right after creation:
+ *
+ * List growableList = new List()..length = 500;
+ *
+ * The [length] must not be negative or null, if it is provided.
+ */
factory List([int length = const _ListConstructorSentinel()]) {
if (length == const _ListConstructorSentinel()) {
return new JSArray<E>.emptyGrowable();
@@ -60,7 +81,14 @@ abstract class List<E> implements Iterable<E>, EfficientLength {
return new JSArray<E>.fixed(length);
}
- @patch
+ /**
+ * Creates a fixed-length list of the given length, and initializes the
+ * value at each position with [fill]:
+ *
+ * new List<int>.filled(3, 0); // [0, 0, 0]
+ *
+ * The [length] must not be negative or null.
+ */
factory List.filled(int length, E fill) {
List result = new JSArray<E>.fixed(length);
if (length != 0 && fill != null) {
@@ -71,7 +99,14 @@ abstract class List<E> implements Iterable<E>, EfficientLength {
return result;
}
- @patch
+ /**
+ * Creates a list containing all [elements].
+ *
+ * The [Iterator] of [elements] provides the order of the elements.
+ *
+ * This constructor returns a growable list when [growable] is true;
+ * otherwise, it returns a fixed-length list.
+ */
factory List.from(Iterable elements, { bool growable: true }) {
List<E> list = new List<E>();
for (E e in elements) {
« no previous file with comments | « test/generated_sdk/lib/core/int.dart ('k') | test/generated_sdk/lib/core/object.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698