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

Unified Diff: runtime/lib/object_patch.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 | « runtime/lib/null_patch.dart ('k') | sdk/lib/_internal/lib/core_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/object_patch.dart
diff --git a/runtime/lib/object_patch.dart b/runtime/lib/object_patch.dart
index 2d42da7df44ebf90db1c20f3e6b0045f3bf5533a..6bba2c7f7df8c67cc4d0e3180976bce06408fa48 100644
--- a/runtime/lib/object_patch.dart
+++ b/runtime/lib/object_patch.dart
@@ -12,7 +12,9 @@ patch class Object {
static _getHash(obj) native "Object_getHash";
static _setHash(obj, hash) native "Object_setHash";
- /* patch */ int get hashCode {
+ /* patch */ int get hashCode => _identityHashCode;
+
+ int get _identityHashCode {
var result = _getHash(this);
if (result == 0) {
// We want the hash to be a Smi value greater than 0.
« no previous file with comments | « runtime/lib/null_patch.dart ('k') | sdk/lib/_internal/lib/core_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698