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 utils; | 5 library unittest.utils; |
6 | 6 |
7 /** | 7 /** |
8 * Returns the name of the type of [x], or "Unknown" if the type name can't be | 8 * Returns the name of the type of [x], or "Unknown" if the type name can't be |
9 * determined. | 9 * determined. |
10 */ | 10 */ |
11 String typeName(x) { | 11 String typeName(x) { |
12 // dart2js blows up on some objects (e.g. window.navigator). | 12 // dart2js blows up on some objects (e.g. window.navigator). |
13 // So we play safe here. | 13 // So we play safe here. |
14 try { | 14 try { |
15 if (x == null) return "null"; | 15 if (x == null) return "null"; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 String toString() => '($first, $last)'; | 60 String toString() => '($first, $last)'; |
61 | 61 |
62 bool operator==(other) { | 62 bool operator==(other) { |
63 if (other is! Pair) return false; | 63 if (other is! Pair) return false; |
64 return other.first == first && other.last == last; | 64 return other.first == first && other.last == last; |
65 } | 65 } |
66 | 66 |
67 int get hashCode => first.hashCode ^ last.hashCode; | 67 int get hashCode => first.hashCode ^ last.hashCode; |
68 } | 68 } |
69 | 69 |
OLD | NEW |