Chromium Code Reviews| Index: sdk/lib/_internal/lib/core_patch.dart |
| diff --git a/sdk/lib/_internal/lib/core_patch.dart b/sdk/lib/_internal/lib/core_patch.dart |
| index aaa816442dc320e3b21552d9f60f39a1e1f26b10..0a1c3ac8fac8c7ba09191e6340b08b572aa12cd1 100644 |
| --- a/sdk/lib/_internal/lib/core_patch.dart |
| +++ b/sdk/lib/_internal/lib/core_patch.dart |
| @@ -30,6 +30,14 @@ patch void print(Object object) { |
| patch class Object { |
| patch int get hashCode => Primitives.objectHashCode(this); |
| + patch static int hashCodeOf(Object object) { |
| + // Basic JS non-object types don't work with objectHashCode. |
|
Johnni Winther
2013/09/20 18:23:03
Use the implementation for _objectHashCode in js_h
Lasse Reichstein Nielsen
2013/09/23 07:08:28
Done. Actually, I made _objectHashCode public in _
|
| + if (object is num || object is bool || object is String || object == null) { |
| + return object.hashCode; |
| + } |
| + return Primitives.objectHashCode(object); |
| + } |
| + |
| patch String toString() => Primitives.objectToString(this); |
| patch dynamic noSuchMethod(Invocation invocation) { |