| 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 import "dart:_internal"; |
| 8 import 'dart:math' show Random; |
| 9 |
| 7 patch class Int8List { | 10 patch class Int8List { |
| 8 /* patch */ factory Int8List(int length) { | 11 /* patch */ factory Int8List(int length) { |
| 9 return new _Int8Array(length); | 12 return new _Int8Array(length); |
| 10 } | 13 } |
| 11 | 14 |
| 12 /* patch */ factory Int8List.fromList(List<int> elements) { | 15 /* patch */ factory Int8List.fromList(List<int> elements) { |
| 13 var result = new _Int8Array(elements.length); | 16 var result = new _Int8Array(elements.length); |
| 14 for (int i = 0; i < elements.length; i++) { | 17 for (int i = 0; i < elements.length; i++) { |
| 15 result[i] = elements[i]; | 18 result[i] = elements[i]; |
| 16 } | 19 } |
| (...skipping 3383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3400 return value; | 3403 return value; |
| 3401 } | 3404 } |
| 3402 return object; | 3405 return object; |
| 3403 } | 3406 } |
| 3404 | 3407 |
| 3405 | 3408 |
| 3406 void _throwRangeError(int index, int length) { | 3409 void _throwRangeError(int index, int length) { |
| 3407 String message = "$index must be in the range [0..$length)"; | 3410 String message = "$index must be in the range [0..$length)"; |
| 3408 throw new RangeError(message); | 3411 throw new RangeError(message); |
| 3409 } | 3412 } |
| OLD | NEW |