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

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

Issue 1348173002: Dartium JS Enabled take 2 (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « sdk/lib/indexed_db/dartium/indexed_db_dartium.dart ('k') | sdk/lib/js/dart2js/js_dart2js.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 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.
11 */ 11 */
12 abstract class FixedLengthListMixin<E> { 12 abstract class FixedLengthListMixin<E> {
13 /** This operation is not supported by a fixed length list. */ 13 /** This operation is not supported by a fixed length list. */
14 void set length(int newLength) { 14 set length(int newLength) {
15 throw new UnsupportedError( 15 throw new UnsupportedError(
16 "Cannot change the length of a fixed-length list"); 16 "Cannot change the length of a fixed-length list");
17 } 17 }
18 18
19 /** This operation is not supported by a fixed length list. */ 19 /** This operation is not supported by a fixed length list. */
20 void add(E value) { 20 void add(E value) {
21 throw new UnsupportedError( 21 throw new UnsupportedError(
22 "Cannot add to a fixed-length list"); 22 "Cannot add to a fixed-length list");
23 } 23 }
24 24
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 */ 98 */
99 abstract class UnmodifiableListMixin<E> implements List<E> { 99 abstract class UnmodifiableListMixin<E> implements List<E> {
100 100
101 /** This operation is not supported by an unmodifiable list. */ 101 /** This operation is not supported by an unmodifiable list. */
102 void operator []=(int index, E value) { 102 void operator []=(int index, E value) {
103 throw new UnsupportedError( 103 throw new UnsupportedError(
104 "Cannot modify an unmodifiable list"); 104 "Cannot modify an unmodifiable list");
105 } 105 }
106 106
107 /** This operation is not supported by an unmodifiable list. */ 107 /** This operation is not supported by an unmodifiable list. */
108 void set length(int newLength) { 108 set length(int newLength) {
109 throw new UnsupportedError( 109 throw new UnsupportedError(
110 "Cannot change the length of an unmodifiable list"); 110 "Cannot change the length of an unmodifiable list");
111 } 111 }
112 112
113 /** This operation is not supported by an unmodifiable list. */ 113 /** This operation is not supported by an unmodifiable list. */
114 void setAll(int at, Iterable<E> iterable) { 114 void setAll(int at, Iterable<E> iterable) {
115 throw new UnsupportedError( 115 throw new UnsupportedError(
116 "Cannot modify an unmodifiable list"); 116 "Cannot modify an unmodifiable list");
117 } 117 }
118 118
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 unmodifiable 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/indexed_db/dartium/indexed_db_dartium.dart ('k') | sdk/lib/js/dart2js/js_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698