Changeset 31

Show
Ignore:
Timestamp:
01/03/06 23:03:31 (3 years ago)
Author:
Jan-Klaas Kollhof
Message:

fixing ticket:7 and removing priv object generation for a new solution see ticket:5

Files:

Legend:

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

    r28 r31  
    3636                                            If the created class is a public member of a module then 
    3737                                            the __name__ property of that class is automatically set by Module(). 
    38     @param bases *                  The base classes
     38    @param base1 *                  The base classes (not an array but one argument per base class)
    3939    @param classScope(-1)        A function which is executed for class construction. 
    4040                                            As 1st parameter it will get the new class' protptype for 
     
    4242                                            the super class' wrapper for calling inherited methods. 
    4343**/ 
    44 Class=function(name, bases, classScope){ 
     44Class=function(name, base1, classScope){ 
    4545    var args=[]; 
    4646    for(var i=0;i<arguments.length;i++){ 
     
    146146                }; 
    147147 
    148                 var privId='__priv__' + arguments.callee.__id__; 
    149                 rslt[privId]={}; 
    150  
    151148                var proto=arguments.callee.prototype; 
    152149                for(var n in proto){ 
     
    168165                rslt=[]; 
    169166 
    170                 var privId='__priv__' + arguments.callee.__id__; 
    171                 rslt[privId]={}; 
    172  
    173167                var proto=arguments.callee.prototype; 
    174168                for(var n in proto){ 
     
    179173                if(rslt.__init__){ 
    180174                    rslt.__init__.apply(rslt, arguments); 
    181                 }else{//implement Array's defaul behavior 
    182                     if(arguments.lengt==1){ 
     175                }else{//implement Array's default behavior 
     176                    if(arguments.length==1){ 
    183177                        rslt.length=arguments[0]; 
    184178                    }else{ 
     
    196190        var NewClass = function(calledBy){ 
    197191            if(calledBy !== Class){ 
    198                 var privId='__priv__' + arguments.callee.__id__; 
    199                 this[privId] = {}; 
    200192                if(this.__init__){ 
    201193                    this.__init__.apply(this, arguments); 
     
    448440    /*@moduleURIs end*/ 
    449441 
    450     ///The base URIs to search for modules in. They may contain StringFormating symbols e.g '%(baseURI)s/lib' 
    451     mod.moduleSearchURIs = [".", "%(baseURI)s/lib"]; 
     442    /** 
     443        The base URIs to search for modules in.  
     444        each item will be formated using moduleSearchURIs[i].format(jsolait) so, 
     445        they may contain StringFormating symbols e.g '%(baseURI)s/lib' 
     446    **/ 
     447    mod.moduleSearchURIs = ["."]; 
    452448 
    453449    ///The location where jsolait is installed. 
     
    576572                var srcURI = src.__sourceURI__; 
    577573                src = 'Module.currentURI="%s";\n%s\nModule.currentURI=null;\n'.format(src.__sourceURI__.replace(/\\/g, '\\\\'), src); 
    578                 var f=new Function("",src); //todo should it use globalEval ? 
     574                var f=new Function("",src); 
    579575                f(); 
    580576            }catch(e){