| OLD | NEW |
| 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 // patch classes for Int8List ..... Float64List and ByteData implementations. | 5 // patch classes for Int8List ..... Float64List and ByteData implementations. |
| 6 | 6 |
| 7 patch class Int8List { | 7 patch class Int8List { |
| 8 /* patch */ factory Int8List(int length) { | 8 /* patch */ factory Int8List(int length) { |
| 9 return new _Int8Array(length); | 9 return new _Int8Array(length); |
| 10 } | 10 } |
| (...skipping 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1975 } | 1975 } |
| 1976 return _typeddata._getInt8(offsetInBytes + | 1976 return _typeddata._getInt8(offsetInBytes + |
| 1977 (index * Int8List.BYTES_PER_ELEMENT)); | 1977 (index * Int8List.BYTES_PER_ELEMENT)); |
| 1978 } | 1978 } |
| 1979 | 1979 |
| 1980 void operator[]=(int index, int value) { | 1980 void operator[]=(int index, int value) { |
| 1981 if (index < 0 || index >= length) { | 1981 if (index < 0 || index >= length) { |
| 1982 String message = "$index must be in the range [0..$length)"; | 1982 String message = "$index must be in the range [0..$length)"; |
| 1983 throw new RangeError(message); | 1983 throw new RangeError(message); |
| 1984 } | 1984 } |
| 1985 _typeddata. setInt8(offsetInBytes + (index * Int8List.BYTES_PER_ELEMENT), | 1985 _typeddata._setInt8(offsetInBytes + (index * Int8List.BYTES_PER_ELEMENT), |
| 1986 _toInt8(value)); | 1986 _toInt8(value)); |
| 1987 } | 1987 } |
| 1988 | 1988 |
| 1989 Iterator<int> get iterator { | 1989 Iterator<int> get iterator { |
| 1990 return new _TypedListIterator<int>(this); | 1990 return new _TypedListIterator<int>(this); |
| 1991 } | 1991 } |
| 1992 | 1992 |
| 1993 | 1993 |
| 1994 // Method(s) implementing TypedData interface. | 1994 // Method(s) implementing TypedData interface. |
| 1995 | 1995 |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2628 } | 2628 } |
| 2629 } | 2629 } |
| 2630 | 2630 |
| 2631 | 2631 |
| 2632 int _defaultIfNull(object, value) { | 2632 int _defaultIfNull(object, value) { |
| 2633 if (object == null) { | 2633 if (object == null) { |
| 2634 return value; | 2634 return value; |
| 2635 } | 2635 } |
| 2636 return object; | 2636 return object; |
| 2637 } | 2637 } |
| OLD | NEW |