| Index: runtime/lib/typed_data.dart
|
| ===================================================================
|
| --- runtime/lib/typed_data.dart (revision 42948)
|
| +++ runtime/lib/typed_data.dart (working copy)
|
| @@ -424,13 +424,13 @@
|
| void setRange(int start, int end, Iterable from, [int skipCount = 0]) {
|
| // Check ranges.
|
| if ((start < 0) || (start > length)) {
|
| - _throwRangeError(start, length + 1);
|
| + throw _newRangeError(start, length + 1);
|
| }
|
| if ((end < 0) || (end > length)) {
|
| - _throwRangeError(end, length + 1);
|
| + throw _newRangeError(end, length + 1);
|
| }
|
| if (start > end) {
|
| - _throwRangeError(start, end + 1);
|
| + throw _newRangeError(start, end + 1);
|
| }
|
| if (skipCount < 0) {
|
| throw new ArgumentError(skipCount);
|
| @@ -844,7 +844,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getInt8(index);
|
| }
|
| @@ -851,7 +851,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setInt8(index, _toInt8(value));
|
| }
|
| @@ -885,7 +885,7 @@
|
| // Methods implementing List interface.
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getUint8(index);
|
| }
|
| @@ -892,7 +892,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setUint8(index, _toUint8(value));
|
| }
|
| @@ -925,7 +925,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getUint8(index);
|
| }
|
| @@ -932,7 +932,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setUint8(index, _toClampedUint8(value));
|
| }
|
| @@ -967,7 +967,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedInt16(index);
|
| }
|
| @@ -974,7 +974,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedInt16(index, _toInt16(value));
|
| }
|
| @@ -1017,7 +1017,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedUint16(index);
|
| }
|
| @@ -1024,7 +1024,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedUint16(index, _toUint16(value));
|
| }
|
| @@ -1067,7 +1067,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedInt32(index);
|
| }
|
| @@ -1074,7 +1074,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedInt32(index, _toInt32(value));
|
| }
|
| @@ -1117,7 +1117,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedUint32(index);
|
| }
|
| @@ -1124,7 +1124,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedUint32(index, _toUint32(value));
|
| }
|
| @@ -1167,7 +1167,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedInt64(index);
|
| }
|
| @@ -1174,7 +1174,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedInt64(index, _toInt64(value));
|
| }
|
| @@ -1217,7 +1217,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedUint64(index);
|
| }
|
| @@ -1224,7 +1224,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedUint64(index, _toUint64(value));
|
| }
|
| @@ -1267,7 +1267,7 @@
|
|
|
| double operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedFloat32(index);
|
| }
|
| @@ -1274,7 +1274,7 @@
|
|
|
| void operator[]=(int index, double value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedFloat32(index, value);
|
| }
|
| @@ -1317,7 +1317,7 @@
|
|
|
| double operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedFloat64(index);
|
| }
|
| @@ -1324,7 +1324,7 @@
|
|
|
| void operator[]=(int index, double value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedFloat64(index, value);
|
| }
|
| @@ -1365,7 +1365,7 @@
|
|
|
| Float32x4 operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedFloat32x4(index);
|
| }
|
| @@ -1372,7 +1372,7 @@
|
|
|
| void operator[]=(int index, Float32x4 value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedFloat32x4(index, value);
|
| }
|
| @@ -1413,7 +1413,7 @@
|
|
|
| Int32x4 operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedInt32x4(index);
|
| }
|
| @@ -1420,7 +1420,7 @@
|
|
|
| void operator[]=(int index, Int32x4 value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedInt32x4(index, value);
|
| }
|
| @@ -1461,7 +1461,7 @@
|
|
|
| Float64x2 operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedFloat64x2(index);
|
| }
|
| @@ -1468,7 +1468,7 @@
|
|
|
| void operator[]=(int index, Float64x2 value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedFloat64x2(index, value);
|
| }
|
| @@ -1510,7 +1510,7 @@
|
| // Method(s) implementing the List interface.
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getInt8(index);
|
| }
|
| @@ -1517,7 +1517,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setInt8(index, value);
|
| }
|
| @@ -1553,7 +1553,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getUint8(index);
|
| }
|
| @@ -1560,7 +1560,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setUint8(index, _toUint8(value));
|
| }
|
| @@ -1595,7 +1595,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getUint8(index);
|
| }
|
| @@ -1602,7 +1602,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setUint8(index, _toClampedUint8(value));
|
| }
|
| @@ -1638,7 +1638,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedInt16(index);
|
| }
|
| @@ -1645,7 +1645,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedInt16(index, _toInt16(value));
|
| }
|
| @@ -1689,7 +1689,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedUint16(index);
|
| }
|
| @@ -1696,7 +1696,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedUint16(index, _toUint16(value));
|
| }
|
| @@ -1740,7 +1740,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedInt32(index);
|
| }
|
| @@ -1747,7 +1747,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedInt32(index, _toInt32(value));
|
| }
|
| @@ -1791,7 +1791,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedUint32(index);
|
| }
|
| @@ -1798,7 +1798,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedUint32(index, _toUint32(value));
|
| }
|
| @@ -1842,7 +1842,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedInt64(index);
|
| }
|
| @@ -1849,7 +1849,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedInt64(index, _toInt64(value));
|
| }
|
| @@ -1893,7 +1893,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedUint64(index);
|
| }
|
| @@ -1900,7 +1900,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedUint64(index, _toUint64(value));
|
| }
|
| @@ -1944,7 +1944,7 @@
|
|
|
| double operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedFloat32(index);
|
| }
|
| @@ -1951,7 +1951,7 @@
|
|
|
| void operator[]=(int index, double value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedFloat32(index, value);
|
| }
|
| @@ -1995,7 +1995,7 @@
|
|
|
| double operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedFloat64(index);
|
| }
|
| @@ -2002,7 +2002,7 @@
|
|
|
| void operator[]=(int index, double value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedFloat64(index, value);
|
| }
|
| @@ -2046,7 +2046,7 @@
|
|
|
| Float32x4 operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedFloat32x4(index);
|
| }
|
| @@ -2053,7 +2053,7 @@
|
|
|
| void operator[]=(int index, Float32x4 value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedFloat32x4(index, value);
|
| }
|
| @@ -2097,7 +2097,7 @@
|
|
|
| Int32x4 operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedInt32x4(index);
|
| }
|
| @@ -2104,7 +2104,7 @@
|
|
|
| void operator[]=(int index, Int32x4 value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedInt32x4(index, value);
|
| }
|
| @@ -2148,7 +2148,7 @@
|
|
|
| Float64x2 operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _getIndexedFloat64x2(index);
|
| }
|
| @@ -2155,7 +2155,7 @@
|
|
|
| void operator[]=(int index, Float64x2 value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _setIndexedFloat64x2(index, value);
|
| }
|
| @@ -2476,7 +2476,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _typedData._getInt8(offsetInBytes +
|
| (index * Int8List.BYTES_PER_ELEMENT));
|
| @@ -2484,7 +2484,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _typedData._setInt8(offsetInBytes + (index * Int8List.BYTES_PER_ELEMENT),
|
| _toInt8(value));
|
| @@ -2523,7 +2523,8 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| +
|
| }
|
| return _typedData._getUint8(offsetInBytes +
|
| (index * Uint8List.BYTES_PER_ELEMENT));
|
| @@ -2531,7 +2532,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT),
|
| _toUint8(value));
|
| @@ -2571,7 +2572,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _typedData._getUint8(offsetInBytes +
|
| (index * Uint8List.BYTES_PER_ELEMENT));
|
| @@ -2579,7 +2580,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _typedData._setUint8(offsetInBytes + (index * Uint8List.BYTES_PER_ELEMENT),
|
| _toClampedUint8(value));
|
| @@ -2619,7 +2620,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _typedData._getInt16(offsetInBytes +
|
| (index * Int16List.BYTES_PER_ELEMENT));
|
| @@ -2627,7 +2628,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _typedData._setInt16(offsetInBytes + (index * Int16List.BYTES_PER_ELEMENT),
|
| _toInt16(value));
|
| @@ -2667,7 +2668,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _typedData._getUint16(offsetInBytes +
|
| (index * Uint16List.BYTES_PER_ELEMENT));
|
| @@ -2675,7 +2676,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _typedData._setUint16(offsetInBytes + (index * Uint16List.BYTES_PER_ELEMENT),
|
| _toUint16(value));
|
| @@ -2715,7 +2716,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _typedData._getInt32(offsetInBytes +
|
| (index * Int32List.BYTES_PER_ELEMENT));
|
| @@ -2723,7 +2724,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _typedData._setInt32(offsetInBytes + (index * Int32List.BYTES_PER_ELEMENT),
|
| _toInt32(value));
|
| @@ -2763,7 +2764,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _typedData._getUint32(offsetInBytes +
|
| (index * Uint32List.BYTES_PER_ELEMENT));
|
| @@ -2771,7 +2772,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _typedData._setUint32(offsetInBytes + (index * Uint32List.BYTES_PER_ELEMENT),
|
| _toUint32(value));
|
| @@ -2811,7 +2812,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _typedData._getInt64(offsetInBytes +
|
| (index * Int64List.BYTES_PER_ELEMENT));
|
| @@ -2819,7 +2820,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _typedData._setInt64(offsetInBytes + (index * Int64List.BYTES_PER_ELEMENT),
|
| _toInt64(value));
|
| @@ -2859,7 +2860,7 @@
|
|
|
| int operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _typedData._getUint64(offsetInBytes +
|
| (index * Uint64List.BYTES_PER_ELEMENT));
|
| @@ -2867,7 +2868,7 @@
|
|
|
| void operator[]=(int index, int value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _typedData._setUint64(offsetInBytes + (index * Uint64List.BYTES_PER_ELEMENT),
|
| _toUint64(value));
|
| @@ -2907,7 +2908,7 @@
|
|
|
| double operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _typedData._getFloat32(offsetInBytes +
|
| (index * Float32List.BYTES_PER_ELEMENT));
|
| @@ -2915,7 +2916,7 @@
|
|
|
| void operator[]=(int index, double value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _typedData._setFloat32(offsetInBytes +
|
| (index * Float32List.BYTES_PER_ELEMENT), value);
|
| @@ -2955,7 +2956,7 @@
|
|
|
| double operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _typedData._getFloat64(offsetInBytes +
|
| (index * Float64List.BYTES_PER_ELEMENT));
|
| @@ -2963,7 +2964,7 @@
|
|
|
| void operator[]=(int index, double value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _typedData._setFloat64(offsetInBytes +
|
| (index * Float64List.BYTES_PER_ELEMENT), value);
|
| @@ -3003,7 +3004,7 @@
|
|
|
| Float32x4 operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _typedData._getFloat32x4(offsetInBytes +
|
| (index * Float32x4List.BYTES_PER_ELEMENT));
|
| @@ -3011,7 +3012,7 @@
|
|
|
| void operator[]=(int index, Float32x4 value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _typedData._setFloat32x4(offsetInBytes +
|
| (index * Float32x4List.BYTES_PER_ELEMENT), value);
|
| @@ -3051,7 +3052,7 @@
|
|
|
| Int32x4 operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _typedData._getInt32x4(offsetInBytes +
|
| (index * Int32x4List.BYTES_PER_ELEMENT));
|
| @@ -3059,7 +3060,7 @@
|
|
|
| void operator[]=(int index, Int32x4 value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _typedData._setInt32x4(offsetInBytes +
|
| (index * Int32x4List.BYTES_PER_ELEMENT), value);
|
| @@ -3099,7 +3100,7 @@
|
|
|
| Float64x2 operator[](int index) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| return _typedData._getFloat64x2(offsetInBytes +
|
| (index * Float64x2List.BYTES_PER_ELEMENT));
|
| @@ -3107,7 +3108,7 @@
|
|
|
| void operator[]=(int index, Float64x2 value) {
|
| if (index < 0 || index >= length) {
|
| - _throwRangeError(index, length);
|
| + throw _newRangeError(index, length);
|
| }
|
| _typedData._setFloat64x2(offsetInBytes +
|
| (index * Float64x2List.BYTES_PER_ELEMENT), value);
|
| @@ -3160,13 +3161,13 @@
|
|
|
| int getInt8(int byteOffset) {
|
| if (byteOffset < 0 || byteOffset >= length) {
|
| - _throwRangeError(byteOffset, length);
|
| + throw _newRangeError(byteOffset, length);
|
| }
|
| return _typedData._getInt8(_offset + byteOffset);
|
| }
|
| void setInt8(int byteOffset, int value) {
|
| if (byteOffset < 0 || byteOffset >= length) {
|
| - _throwRangeError(byteOffset, length);
|
| + throw _newRangeError(byteOffset, length);
|
| }
|
| _typedData._setInt8(_offset + byteOffset, _toInt8(value));
|
| }
|
| @@ -3173,13 +3174,13 @@
|
|
|
| int getUint8(int byteOffset) {
|
| if (byteOffset < 0 || byteOffset >= length) {
|
| - _throwRangeError(byteOffset, length);
|
| + throw _newRangeError(byteOffset, length);
|
| }
|
| return _typedData._getUint8(_offset + byteOffset);
|
| }
|
| void setUint8(int byteOffset, int value) {
|
| if (byteOffset < 0 || byteOffset >= length) {
|
| - _throwRangeError(byteOffset, length);
|
| + throw _newRangeError(byteOffset, length);
|
| }
|
| _typedData._setUint8(_offset + byteOffset, _toUint8(value));
|
| }
|
| @@ -3186,7 +3187,7 @@
|
|
|
| int getInt16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 1 >= length) {
|
| - _throwRangeError(byteOffset + 1, length);
|
| + throw _newRangeError(byteOffset + 1, length);
|
| }
|
| var result = _typedData._getInt16(_offset + byteOffset);
|
| if (identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3198,7 +3199,7 @@
|
| int value,
|
| [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 1 >= length) {
|
| - _throwRangeError(byteOffset + 1, length);
|
| + throw _newRangeError(byteOffset + 1, length);
|
| }
|
| var set_value = _toInt16(value);
|
| if (!identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3209,7 +3210,7 @@
|
|
|
| int getUint16(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 1 >= length) {
|
| - _throwRangeError(byteOffset + 1, length);
|
| + throw _newRangeError(byteOffset + 1, length);
|
| }
|
| var result = _typedData._getUint16(_offset + byteOffset);
|
| if (identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3221,7 +3222,7 @@
|
| int value,
|
| [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 1 >= length) {
|
| - _throwRangeError(byteOffset + 1, length);
|
| + throw _newRangeError(byteOffset + 1, length);
|
| }
|
| var set_value = _toUint16(value);
|
| if (!identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3232,7 +3233,7 @@
|
|
|
| int getInt32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 3 >= length) {
|
| - _throwRangeError(byteOffset + 3, length);
|
| + throw _newRangeError(byteOffset + 3, length);
|
| }
|
| var result = _typedData._getInt32(_offset + byteOffset);
|
| if (identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3244,7 +3245,7 @@
|
| int value,
|
| [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 3 >= length) {
|
| - _throwRangeError(byteOffset + 3, length);
|
| + throw _newRangeError(byteOffset + 3, length);
|
| }
|
| var set_value = _toInt32(value);
|
| if (!identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3255,7 +3256,7 @@
|
|
|
| int getUint32(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 3 >= length) {
|
| - _throwRangeError(byteOffset + 3, length);
|
| + throw _newRangeError(byteOffset + 3, length);
|
| }
|
| var result = _typedData._getUint32(_offset + byteOffset);
|
| if (identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3267,7 +3268,7 @@
|
| int value,
|
| [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 3 >= length) {
|
| - _throwRangeError(byteOffset + 3, length);
|
| + throw _newRangeError(byteOffset + 3, length);
|
| }
|
| var set_value = _toUint32(value);
|
| if (!identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3278,7 +3279,7 @@
|
|
|
| int getInt64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 7 >= length) {
|
| - _throwRangeError(byteOffset + 7, length);
|
| + throw _newRangeError(byteOffset + 7, length);
|
| }
|
| var result = _typedData._getInt64(_offset + byteOffset);
|
| if (identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3290,7 +3291,7 @@
|
| int value,
|
| [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 7 >= length) {
|
| - _throwRangeError(byteOffset + 7, length);
|
| + throw _newRangeError(byteOffset + 7, length);
|
| }
|
| var set_value = _toInt64(value);
|
| if (!identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3301,7 +3302,7 @@
|
|
|
| int getUint64(int byteOffset, [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 7 >= length) {
|
| - _throwRangeError(byteOffset + 7, length);
|
| + throw _newRangeError(byteOffset + 7, length);
|
| }
|
| var result = _typedData._getUint64(_offset + byteOffset);
|
| if (identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3313,7 +3314,7 @@
|
| int value,
|
| [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 7 >= length) {
|
| - _throwRangeError(byteOffset + 7, length);
|
| + throw _newRangeError(byteOffset + 7, length);
|
| }
|
| var set_value = _toUint64(value);
|
| if (!identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3325,7 +3326,7 @@
|
| double getFloat32(int byteOffset,
|
| [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 3 >= length) {
|
| - _throwRangeError(byteOffset + 3, length);
|
| + throw _newRangeError(byteOffset + 3, length);
|
| }
|
| var result = _typedData._getFloat32(_offset + byteOffset);
|
| if (identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3337,7 +3338,7 @@
|
| double value,
|
| [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 3 >= length) {
|
| - _throwRangeError(byteOffset + 3, length);
|
| + throw _newRangeError(byteOffset + 3, length);
|
| }
|
| var set_value = value;
|
| if (!identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3349,7 +3350,7 @@
|
| double getFloat64(int byteOffset,
|
| [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 7 >= length) {
|
| - _throwRangeError(byteOffset + 7, length);
|
| + throw _newRangeError(byteOffset + 7, length);
|
| }
|
| var result = _typedData._getFloat64(_offset + byteOffset);
|
| if (identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3361,7 +3362,7 @@
|
| double value,
|
| [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 7 >= length) {
|
| - _throwRangeError(byteOffset + 7, length);
|
| + throw _newRangeError(byteOffset + 7, length);
|
| }
|
| var set_value = value;
|
| if (!identical(endian, Endianness.HOST_ENDIAN)) {
|
| @@ -3373,7 +3374,7 @@
|
| Float32x4 getFloat32x4(int byteOffset,
|
| [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 3 >= length) {
|
| - _throwRangeError(byteOffset + 3, length);
|
| + throw _newRangeError(byteOffset + 3, length);
|
| }
|
| // TODO(johnmccutchan) : Need to resolve this for endianity.
|
| return _typedData._getFloat32x4(_offset + byteOffset);
|
| @@ -3382,7 +3383,7 @@
|
| Float32x4 value,
|
| [Endianness endian = Endianness.BIG_ENDIAN]) {
|
| if (byteOffset < 0 || byteOffset + 3 >= length) {
|
| - _throwRangeError(byteOffset + 3, length);
|
| + throw _newRangeError(byteOffset + 3, length);
|
| }
|
| // TODO(johnmccutchan) : Need to resolve this for endianity.
|
| _typedData._setFloat32x4(_offset + byteOffset, value);
|
| @@ -3500,7 +3501,7 @@
|
| }
|
|
|
|
|
| -void _throwRangeError(int index, int length) {
|
| +void _newRangeError(int index, int length) {
|
| String message = "$index must be in the range [0..$length)";
|
| - throw new RangeError(message);
|
| + return new RangeError(message);
|
| }
|
|
|