Changeset 32
- Timestamp:
- 01/09/06 16:29:19 (3 years ago)
- Files:
-
- trunk/jsolait/jsolait.js (modified) (9 diffs)
- trunk/jsolait/lib/iter.js (modified) (4 diffs)
- trunk/tools/build.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/jsolait/jsolait.js
r31 r32 95 95 if(i==0){//for the first base class just use it's proto as the final proto 96 96 proto = baseProto; 97 }else{//for all others extend(do not over ride) the final proto with the properties in the baseProto97 }else{//for all others extend(do not overwrite) the final proto with the properties in the baseProto 98 98 for(var key in baseProto){ 99 99 if(proto[key] === undefined){ … … 145 145 return rslt.__call__.apply(rslt, arguments); 146 146 }; 147 147 148 //this will only work for the current class but not create any priv objects for any base class 148 149 var proto=arguments.callee.prototype; 149 150 for(var n in proto){ … … 184 185 return rslt; 185 186 } 186 }; 187 }; 187 188 }else{ 188 189 //this is a 'normal' object constructor which does nothing but call the __init__ method … … 196 197 }; 197 198 } 199 198 200 199 201 //reset the constructor for new objects to the actual constructor. … … 440 442 /*@moduleURIs end*/ 441 443 444 442 445 /** 443 446 The base URIs to search for modules in. … … 543 546 }else{ 544 547 var src,modPath; 548 549 name = name.split('.'); 550 545 551 //check if jsolait already knows the path of the module 546 if(mod.knownModuleURIs[name] != undefined){ 547 modPath = mod.knownModuleURIs[name].format(mod); 552 if(mod.knownModuleURIs[name[0]] != undefined){ 553 modPath = mod.knownModuleURIs[name[0]].format(mod); 554 if(name.length>1){ 555 modPath = "%s%s.js".format(modPath, name.slice(1).join('/')); 556 } 548 557 try{//to load the source of the module 549 558 src = mod.loadURI(modPath); … … 552 561 } 553 562 } 554 563 555 564 if(src == null){//go through the search paths and try loading the module 556 565 var failedURIs=[]; 557 566 for(var i=0;i<mod.moduleSearchURIs.length; i++){ 558 modPath = "%s/%s.js".format(mod.moduleSearchURIs[i].format(mod), name. split(".").join("/"));567 modPath = "%s/%s.js".format(mod.moduleSearchURIs[i].format(mod), name.join("/")); 559 568 try{ 560 569 src = mod.loadURI(modPath); … … 565 574 } 566 575 if(src == null){ 567 throw new mod.ImportFailed(name , failedURIs);576 throw new mod.ImportFailed(name.join('.'), failedURIs); 568 577 } 569 578 } … … 575 584 f(); 576 585 }catch(e){ 577 throw new mod.ImportFailed(name , [srcURI], e);578 } 579 580 return mod.modules[name ];586 throw new mod.ImportFailed(name.join('.'), [srcURI], e); 587 } 588 589 return mod.modules[name.join('.')]; 581 590 } 582 591 }; trunk/jsolait/lib/iter.js
r30 r32 232 232 this.isRunning = false; 233 233 clearTimeout(this.timeout); 234 delete iter.iterations[this. id];234 delete iter.iterations[this.__hash__()]; 235 235 } 236 236 }; … … 239 239 if(this.isRunning == false){ 240 240 this.isRunning = true; 241 var id=0;//find unused id 242 while(iter.iterations[id]!==undefined){ 243 this.id++; 244 } 245 this.id = "" + id; 246 iter.iterations[this.id] = this; 241 var id = this.__hash__(); 242 iter.iterations[id] = this; 247 243 //let the iteration be handled using a timer 248 this.timeout = setTimeout("iter.handleAsyncStep('" + this.id + "')", this.interval);244 this.timeout = setTimeout("iter.handleAsyncStep('" + id + "')", this.interval); 249 245 } 250 246 }; … … 252 248 publ.handleAsyncStep = function(){ 253 249 if(this.isRunning){ 254 tem=this.iterator.next();250 var item=this.iterator.next(); 255 251 if(item === undefined){ 256 252 this.stop(); … … 258 254 //let the callback handle the item 259 255 this.callback.call(this.thisObj==null?this : this.thisObj, item, this); 260 this.timeout = setTimeout("iter.handleAsyncStep('" + this. id+ "')", this.interval);256 this.timeout = setTimeout("iter.handleAsyncStep('" + this.__hash__()+ "')", this.interval); 261 257 } 262 258 } trunk/tools/build.js
r29 r32 59 59 } 60 60 } 61 var sfe=new Enumerator(fldr.SubFolders); 62 for (;!sfe.atEnd(); sfe.moveNext()){ 63 var f = sfe.item(); 64 mods.push('"' + f.name + '":"%(baseURI)s/'+libFolder+'/' + f.name + '/"'); 65 } 61 66 } 62 67 } 63 64 68 65 69 modDirs='mod.knownModuleURIs={' + mods.join(',') + '};'; 66 70 s=s.join(modDirs);
