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

Unified Diff: test/generated_sdk/lib/internal/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/uri.dart ('k') | test/generated_sdk/lib/internal/print.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/generated_sdk/lib/internal/list.dart
diff --git a/test/generated_sdk/lib/internal/list.dart b/test/generated_sdk/lib/internal/list.dart
index e4f876d23ae5d28c105f54f4f6306ce647e6179d..890a7895327466e706267803793d7746ca8251af 100644
--- a/test/generated_sdk/lib/internal/list.dart
+++ b/test/generated_sdk/lib/internal/list.dart
@@ -349,7 +349,30 @@ abstract class NonGrowableListError {
=> new UnsupportedError("Cannot remove from non-growable List");
}
-@patch
+/**
+ * Converts a growable list to a fixed length list with the same elements.
+ *
+ * For internal use only.
+ * Only works on growable lists as created by `[]` or `new List()`.
+ * May throw on any other list.
+ *
+ * The operation is efficient. It doesn't copy the elements, but converts
+ * the existing list directly to a fixed length list.
+ * That means that it is a destructive conversion.
+ * The original list should not be used afterwards.
+ *
+ * The returned list may be the same list as the orginal,
+ * or it may be a different list (according to [identical]).
+ * The original list may have changed type to be a fixed list,
+ * or become empty or been otherwise modified.
+ * It will still be a valid object, so references to it will not, e.g., crash
+ * the runtime if accessed, but no promises are made wrt. its contents.
+ *
+ * This unspecified behavior is the reason the function is not exposed to
+ * users. We allow the underlying implementation to make the most efficient
+ * conversion, at the cost of leaving the original list in an unspecified
+ * state.
+ */
List makeListFixedLength(List growableList) {
JSArray.markFixedList(growableList);
return growableList;
« no previous file with comments | « test/generated_sdk/lib/core/uri.dart ('k') | test/generated_sdk/lib/internal/print.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698