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

Unified Diff: sdk/lib/_internal/lib/core_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/object_patch.dart ('k') | sdk/lib/_internal/lib/js_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3cd1ef97ae36b82ab19d32b61a55abaf3ee2a69d 100644
--- a/sdk/lib/_internal/lib/core_patch.dart
+++ b/sdk/lib/_internal/lib/core_patch.dart
@@ -8,7 +8,8 @@ import 'dart:_js_helper' show checkNull,
getRuntimeType,
JSSyntaxRegExp,
Primitives,
- stringJoinUnchecked;
+ stringJoinUnchecked,
+ objectHashCode;
import "dart:_collection-dev" as _symbol_dev;
String _symbolToString(Symbol symbol) => _symbol_dev.Symbol.getName(symbol);
@@ -26,10 +27,13 @@ patch void print(Object object) {
Primitives.printString(object.toString());
}
+patch int identityHashCode(Object object) => objectHashCode(object);
+
// Patch for Object implementation.
patch class Object {
patch int get hashCode => Primitives.objectHashCode(this);
+
patch String toString() => Primitives.objectToString(this);
patch dynamic noSuchMethod(Invocation invocation) {
« no previous file with comments | « runtime/lib/object_patch.dart ('k') | sdk/lib/_internal/lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698