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

Unified Diff: dart/lib/compiler/implementation/js_backend/native_emitter.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
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/lib/core_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/js_backend/native_emitter.dart
diff --git a/dart/lib/compiler/implementation/js_backend/native_emitter.dart b/dart/lib/compiler/implementation/js_backend/native_emitter.dart
index 129343642543ac4b274c0ef0e9618d79edcad1a8..647fab4f38af7ac01846251a0add4bc0a1e74938 100644
--- a/dart/lib/compiler/implementation/js_backend/native_emitter.dart
+++ b/dart/lib/compiler/implementation/js_backend/native_emitter.dart
@@ -84,6 +84,12 @@ class NativeEmitter {
return backend.namer.isolateAccess(element);
}
+ String get hashCodeHelperName {
+ Element element = compiler.findHelper(
+ const SourceString('hashCodeForNativeObject'));
+ return backend.namer.isolateAccess(element);
+ }
+
String get defineNativeClassName
=> '${backend.namer.CURRENT_ISOLATE}.\$defineNativeClass';
@@ -417,6 +423,12 @@ function(cls, fields, methods) {
objectProperties[toStringName] =
'function() { return $toStringHelperName(this); }';
+ // Same as above, but for hashCode.
+ String hashCodeName = backend.namer.publicInstanceMethodNameByArity(
+ const SourceString('hashCode'), 0);
+ objectProperties[hashCodeName] =
+ 'function() { return $hashCodeHelperName(this); }';
+
// If the native emitter has been asked to take care of the
// noSuchMethod handlers, we do that now.
if (handleNoSuchMethod) {
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/lib/core_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698