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

Unified Diff: dart/lib/compiler/implementation/lib/core_patch.dart

Issue 10965034: Implement Object.hashCode() (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Update dart2dart status Created 8 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: dart/lib/compiler/implementation/lib/core_patch.dart
diff --git a/dart/lib/compiler/implementation/lib/core_patch.dart b/dart/lib/compiler/implementation/lib/core_patch.dart
index 0376eaaeb472a4801ec89b1a188f136c2dae0a98..2407ff4bc9ba080d6e4b8dd88f9eb4b198cc00f2 100644
--- a/dart/lib/compiler/implementation/lib/core_patch.dart
+++ b/dart/lib/compiler/implementation/lib/core_patch.dart
@@ -13,17 +13,11 @@ patch void print(var obj) {
}
}
-
// Patch for Object implementation.
patch class Object {
- patch int hashCode() {
- throw new RuntimeError("Unimplemented: Object.hashCode");
- return -1;
- }
+ patch int hashCode() => Primitives.objectHashCode(this);
- patch String toString() {
- return Primitives.objectToString(this);
- }
+ patch String toString() => Primitives.objectToString(this);
patch void noSuchMethod(String name, List args) {
throw new NoSuchMethodError(this, name, args);
« no previous file with comments | « dart/lib/compiler/implementation/js_backend/native_emitter.dart ('k') | dart/lib/compiler/implementation/lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698