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

Unified Diff: sdk/lib/core/identical.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: Now top-level and called identityHashCode 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
« no previous file with comments | « sdk/lib/_internal/lib/js_helper.dart ('k') | tests/corelib/hashcode_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/identical.dart
diff --git a/sdk/lib/core/identical.dart b/sdk/lib/core/identical.dart
index 236ce20ea590f6fdcaa0c8869ff5fca850609473..cc00c30cb864f87a7d7ad2574e090d1006ed995c 100644
--- a/sdk/lib/core/identical.dart
+++ b/sdk/lib/core/identical.dart
@@ -8,3 +8,14 @@ part of dart.core;
* Check whether two references are to the same object.
*/
external bool identical(Object a, Object b);
+
+/**
+ * Returns the identity hash code of `object`.
+ *
+ * Returns the same value as `object.hashCode` if [object] has not overridden
+ * [Object.hashCode]. Returns the value that [Object.hashCode] would return
+ * on this object, even if `hashCode` has been overridden.
+ *
+ * This hash code is compatible with [identical].
+ */
+external int identityHashCode(Object object);
« no previous file with comments | « sdk/lib/_internal/lib/js_helper.dart ('k') | tests/corelib/hashcode_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698