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

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

Issue 11191078: Make hashCode a getter and not a method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 years, 2 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: lib/compiler/implementation/lib/interceptors.dart
diff --git a/lib/compiler/implementation/lib/interceptors.dart b/lib/compiler/implementation/lib/interceptors.dart
index 8aa6509f96bd68c22e525c77762359d8cec68f0e..4304e154308f0f5d3b32b224f4169c296e9e5eb2 100644
--- a/lib/compiler/implementation/lib/interceptors.dart
+++ b/lib/compiler/implementation/lib/interceptors.dart
@@ -626,14 +626,14 @@ trim(receiver) {
*
* [1]: http://en.wikipedia.org/wiki/Jenkins_hash_function
*/
-hashCode(receiver) {
+get$hashCode(receiver) {
// TODO(ahe): This method shouldn't have to use JS. Update when our
// optimizations are smarter.
if (receiver == null) return 0;
if (receiver is num) return JS('int', r'# & 0x1FFFFFFF', receiver);
if (receiver is bool) return receiver ? 0x40377024 : 0xc18c0076;
if (isJsArray(receiver)) return Primitives.objectHashCode(receiver);
- if (receiver is !String) return UNINTERCEPTED(receiver.hashCode());
+ if (receiver is !String) return UNINTERCEPTED(receiver.hashCode);
int hash = 0;
int length = JS('int', r'#.length', receiver);
for (int i = 0; i < length; i++) {
@@ -687,5 +687,3 @@ get$runtimeType(receiver) {
// TODO(lrn): These getters should be generated automatically for all
// intercepted methods.
get$toString(receiver) => () => toString(receiver);
-
-get$hashCode(receiver) => () => hashCode(receiver);

Powered by Google App Engine
This is Rietveld 408576698