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

Side by Side Diff: runtime/lib/byte_array.dart

Issue 10989013: Change IllegalArgumentException to ArgumentError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated co19 test expectations. Created 8 years, 2 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 patch class Int8List { 5 patch class Int8List {
6 /* patch */ factory Int8List(int length) { 6 /* patch */ factory Int8List(int length) {
7 return new _Int8Array(length); 7 return new _Int8Array(length);
8 } 8 }
9 9
10 /* patch */ factory Int8List.view(ByteArray array, 10 /* patch */ factory Int8List.view(ByteArray array,
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 if (start + length > listLength) { 316 if (start + length > listLength) {
317 throw new IndexOutOfRangeException(start + length); 317 throw new IndexOutOfRangeException(start + length);
318 } 318 }
319 } 319 }
320 320
321 321
322 int _requireInteger(object) { 322 int _requireInteger(object) {
323 if (object is int) { 323 if (object is int) {
324 return object; 324 return object;
325 } 325 }
326 throw new IllegalArgumentException("$object is not an integer"); 326 throw new ArgumentError("$object is not an integer");
327 } 327 }
328 328
329 329
330 int _requireIntegerOrNull(object, value) { 330 int _requireIntegerOrNull(object, value) {
331 if (object is int) { 331 if (object is int) {
332 return object; 332 return object;
333 } 333 }
334 if (object === null) { 334 if (object === null) {
335 return _requireInteger(value); 335 return _requireInteger(value);
336 } 336 }
337 throw new IllegalArgumentException("$object is not an integer or null"); 337 throw new ArgumentError("$object is not an integer or null");
338 } 338 }
339 339
340 340
341 class _Int8Array extends _ByteArrayBase implements Int8List { 341 class _Int8Array extends _ByteArrayBase implements Int8List {
342 factory _Int8Array(int length) { 342 factory _Int8Array(int length) {
343 return _new(length); 343 return _new(length);
344 } 344 }
345 345
346 factory _Int8Array.view(ByteArray array, [int start = 0, int length]) { 346 factory _Int8Array.view(ByteArray array, [int start = 0, int length]) {
347 if (length === null) { 347 if (length === null) {
(...skipping 2062 matching lines...) Expand 10 before | Expand all | Expand 10 after
2410 } 2410 }
2411 _rangeCheck(this.length, start, length); 2411 _rangeCheck(this.length, start, length);
2412 return _array.subByteArray(_offset + start, length); 2412 return _array.subByteArray(_offset + start, length);
2413 } 2413 }
2414 2414
2415 static const int _BYTES_PER_ELEMENT = 8; 2415 static const int _BYTES_PER_ELEMENT = 8;
2416 final ByteArray _array; 2416 final ByteArray _array;
2417 final int _offset; 2417 final int _offset;
2418 final int _length; 2418 final int _length;
2419 } 2419 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698