Changeset 14

Show
Ignore:
Timestamp:
10/26/05 16:44:36 (3 years ago)
Author:
Jan-Klaas Kollhof
Message:

fixed bug in hash calculation for objects

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jsolait/trunk/jsolait/jsolait.js

    r12 r14  
    126126            //todo 
    127127            NewClass.prototype.__hash__=function(){ 
    128                 if(NewClass.__objcnt__){ 
    129                     NewClass.__objcnt__ ++; 
    130                 }else{ 
    131                     NewClass.__objcnt__ = 1; 
    132                 } 
    133                 return NewClass.__objcnt__; 
     128                if(this.__id__==null){ 
     129                    this.__id__ = '#auto#' +  Class.hashCount++ 
     130                } 
     131                return this.__id__; 
    134132            }; 
    135133            break; 
     
    182180    return NewClass; 
    183181};     
    184  
     182Class.hashCount=0; 
    185183Class.toString = function(){ 
    186184    return "[object Class]";