emul/src/main/java/java/lang/Object.java
brancharithmetic
changeset 429 7c4442271367
parent 411 6506d5132e03
child 443 9359b006782b
     1.1 --- a/emul/src/main/java/java/lang/Object.java	Mon Jan 07 16:46:09 2013 +0100
     1.2 +++ b/emul/src/main/java/java/lang/Object.java	Sat Jan 12 15:39:33 2013 +0100
     1.3 @@ -106,11 +106,14 @@
     1.4       */
     1.5      @JavaScriptBody(args = "self", body = 
     1.6          "if (self.$hashCode) return self.$hashCode;\n"
     1.7 -        + "var h = Math.random() * Math.pow(2, 32);\n"
     1.8 +        + "var h = self.computeHashCode__I(self);\n"
     1.9          + "return self.$hashCode = h & h;"
    1.10      )
    1.11      public native int hashCode();
    1.12  
    1.13 +    @JavaScriptBody(args = "self", body = "Math.random() * Math.pow(2, 32);")
    1.14 +    native int computeHashCode();
    1.15 +    
    1.16      /**
    1.17       * Indicates whether some other object is "equal to" this one.
    1.18       * <p>