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

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

Issue 711003002: Add some ArgumentError and RangeError constructors that capture more information. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 ListBase<E> with UnmodifiableListMixin<E>; 232 ListBase<E> with UnmodifiableListMixin<E>;
233 233
234 class _ListIndicesIterable extends ListIterable<int> { 234 class _ListIndicesIterable extends ListIterable<int> {
235 List _backedList; 235 List _backedList;
236 236
237 _ListIndicesIterable(this._backedList); 237 _ListIndicesIterable(this._backedList);
238 238
239 int get length => _backedList.length; 239 int get length => _backedList.length;
240 int elementAt(int index) { 240 int elementAt(int index) {
241 if (index < 0 || index >= length) { 241 if (index < 0 || index >= length) {
242 throw new RangeError.range(index, 0, length); 242 throw new RangeError.index(index, this);
243 } 243 }
244 return index; 244 return index;
245 } 245 }
246 } 246 }
247 247
248 class ListMapView<E> implements Map<int, E> { 248 class ListMapView<E> implements Map<int, E> {
249 List<E> _values; 249 List<E> _values;
250 250
251 ListMapView(this._values); 251 ListMapView(this._values);
252 252
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 * or become empty or been otherwise modified. 369 * or become empty or been otherwise modified.
370 * It will still be a valid object, so references to it will not, e.g., crash 370 * It will still be a valid object, so references to it will not, e.g., crash
371 * the runtime if accessed, but no promises are made wrt. its contents. 371 * the runtime if accessed, but no promises are made wrt. its contents.
372 * 372 *
373 * This unspecified behavior is the reason the function is not exposed to 373 * This unspecified behavior is the reason the function is not exposed to
374 * users. We allow the underlying implementation to make the most efficient 374 * users. We allow the underlying implementation to make the most efficient
375 * conversion, at the cost of leaving the original list in an unspecified 375 * conversion, at the cost of leaving the original list in an unspecified
376 * state. 376 * state.
377 */ 377 */
378 external List makeListFixedLength(List growableList); 378 external List makeListFixedLength(List growableList);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698