Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Unified Diff: sdk/lib/core/object.dart

Issue 24280003: Add Object.hashCodeOf to get the default hashCode of an object. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/core/object.dart
diff --git a/sdk/lib/core/object.dart b/sdk/lib/core/object.dart
index 975a8a79b4bfd34c770f99c633d6ccb75e4fb1a0..c4c2ffb458343a66420f1f7b17154d4c8a3891cd 100644
--- a/sdk/lib/core/object.dart
+++ b/sdk/lib/core/object.dart
@@ -93,5 +93,14 @@ class Object {
* A representation of the runtime type of the object.
*/
external Type get runtimeType;
+
+ /**
+ * Returns the same value as [hashCode] on [object] would.
+ *
+ * If [object] hasn't overridden [hashCode] from [Object], this is the
+ * same as `object.hashCode`. This method can be used to get the object's
+ * hashCode event if `hashCode` has been overridden.
+ */
+ external static int hashCodeOf(Object object);
kasperl 2013/09/20 13:17:17 How about calling this identityHashCode? Maybe con
}

Powered by Google App Engine
This is Rietveld 408576698