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

Side by Side Diff: sdk/lib/internal/list.dart

Issue 1076013006: Improve return type of markUnmodifiableList to JSArray instead of List. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix bad change. Created 5 years, 8 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/_internal/compiler/js_lib/js_array.dart ('k') | no next file » | 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 part of dart._internal; 5 part of dart._internal;
6 6
7 /** 7 /**
8 * Mixin that throws on the length changing operations of [List]. 8 * Mixin that throws on the length changing operations of [List].
9 * 9 *
10 * Intended to mix-in on top of [ListMixin] for fixed-length lists. 10 * Intended to mix-in on top of [ListMixin] for fixed-length lists.
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 * 354 *
355 * For internal use only. 355 * For internal use only.
356 * Only works on growable lists as created by `[]` or `new List()`. 356 * Only works on growable lists as created by `[]` or `new List()`.
357 * May throw on any other list. 357 * May throw on any other list.
358 * 358 *
359 * The operation is efficient. It doesn't copy the elements, but converts 359 * The operation is efficient. It doesn't copy the elements, but converts
360 * the existing list directly to a fixed length list. 360 * the existing list directly to a fixed length list.
361 * That means that it is a destructive conversion. 361 * That means that it is a destructive conversion.
362 * The original list should not be used afterwards. 362 * The original list should not be used afterwards.
363 * 363 *
364 * The returned list may be the same list as the orginal, 364 * The returned list may be the same list as the original,
365 * or it may be a different list (according to [identical]). 365 * or it may be a different list (according to [identical]).
366 * The original list may have changed type to be a fixed list, 366 * The original list may have changed type to be a fixed list,
367 * or become empty or been otherwise modified. 367 * or become empty or been otherwise modified.
368 * It will still be a valid object, so references to it will not, e.g., crash 368 * It will still be a valid object, so references to it will not, e.g., crash
369 * the runtime if accessed, but no promises are made wrt. its contents. 369 * the runtime if accessed, but no promises are made wrt. its contents.
370 * 370 *
371 * This unspecified behavior is the reason the function is not exposed to 371 * This unspecified behavior is the reason the function is not exposed to
372 * users. We allow the underlying implementation to make the most efficient 372 * users. We allow the underlying implementation to make the most efficient
373 * conversion, at the cost of leaving the original list in an unspecified 373 * conversion, at the cost of leaving the original list in an unspecified
374 * state. 374 * state.
375 */ 375 */
376 external List makeListFixedLength(List growableList); 376 external List makeListFixedLength(List growableList);
377 377
378 /** 378 /**
379 * Converts a fixed-length list to an unmodifiable list. 379 * Converts a fixed-length list to an unmodifiable list.
380 * 380 *
381 * For internal use only. 381 * For internal use only.
382 * Only works for core fixed-length lists as created by `new List(length)`, 382 * Only works for core fixed-length lists as created by `new List(length)`,
383 * or as returned by [makeListFixedLength]. 383 * or as returned by [makeListFixedLength].
384 * 384 *
385 * The operation is efficient. It doesn't copy the elements, but converts 385 * The operation is efficient. It doesn't copy the elements, but converts
386 * the existing list directly to a fixed length list. 386 * the existing list directly to a fixed length list.
387 * That means that it is a destructive conversion. 387 * That means that it is a destructive conversion.
388 * The original list should not be used afterwards. 388 * The original list should not be used afterwards.
389 * 389 *
390 * The unmodifialbe list type is similar to the one used by const lists. 390 * The unmodifiable list type is similar to the one used by const lists.
391 */ 391 */
392 external List makeFixedListUnmodifiable(List fixedLengthList); 392 external List makeFixedListUnmodifiable(List fixedLengthList);
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/js_array.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698