| 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 library web_ui.src.utils_observe; | 5 library web_ui.src.utils_observe; |
| 6 | 6 |
| 7 import 'dart:collection'; | |
| 8 | |
| 9 // TODO(jmesserly): helpers to combine hash codes. Reuse these from somewhere. | 7 // TODO(jmesserly): helpers to combine hash codes. Reuse these from somewhere. |
| 10 hash2(x, y) => x.hashCode * 31 + y.hashCode; | 8 hash2(x, y) => x.hashCode * 31 + y.hashCode; |
| 11 | 9 |
| 12 hash3(x, y, z) => hash2(hash2(x, y), z); | 10 hash3(x, y, z) => hash2(hash2(x, y), z); |
| 13 | 11 |
| 14 hash4(w, x, y, z) => hash2(hash2(w, x), hash2(y, z)); | 12 hash4(w, x, y, z) => hash2(hash2(w, x), hash2(y, z)); |
| 15 | 13 |
| 16 class Arrays { | 14 class Arrays { |
| 17 static void copy(List src, int srcStart, | 15 static void copy(List src, int srcStart, |
| 18 List dst, int dstStart, int count) { | 16 List dst, int dstStart, int count) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 38 if (start < 0 ) { | 36 if (start < 0 ) { |
| 39 String message = "$start must be greater than or equal to 0"; | 37 String message = "$start must be greater than or equal to 0"; |
| 40 throw new RangeError(message); | 38 throw new RangeError(message); |
| 41 } | 39 } |
| 42 if (start + length > a.length) { | 40 if (start + length > a.length) { |
| 43 String message = "$start + $length must be in the range [0..${a.length})"; | 41 String message = "$start + $length must be in the range [0..${a.length})"; |
| 44 throw new RangeError(message); | 42 throw new RangeError(message); |
| 45 } | 43 } |
| 46 } | 44 } |
| 47 } | 45 } |
| 48 | |
| 49 // TODO(jmesserly): bogus type to workaround spurious VM bug with generic base | |
| 50 // class and mixins. | |
| 51 abstract class IterableWorkaround extends IterableBase<dynamic> {} | |
| 52 abstract class ListMixinWorkaround extends ListMixin<dynamic> {} | |
| OLD | NEW |