Changeset 74

Show
Ignore:
Timestamp:
10/09/06 09:34:44 (2 years ago)
Author:
Jan-Klaas Kollhof
Message:

some work in experimental branch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/experimental/jsolait/jsolait.js

    r73 r74  
    646646            } 
    647647        }else{ 
    648             attachTo[name] = m; 
     648            var finalModuleName=name.split('.'); 
     649            finalModuleName=finalModuleName.pop(); 
     650            attachTo[finalModuleName] = m; 
    649651        } 
    650652    }; 
     
    754756            args.push(locals[key]); 
    755757        }                
    756          
     758 
    757759        var modFn = new Function(argNames.join(","), source); 
    758760             
  • branches/experimental/jsolait/jsolait.wsf

    r73 r74  
    9696            //get the base of the file to execute 
    9797            var fileBase= fs.getParentFolderName(fileName); 
    98              
    9998            //make sure the search path is updated to include the fileBase 
    10099            jsolait.moduleSearchURIs = [fileBase,  "%(baseURI)s/lib"]; 
    101100             
     101             
     102            //see if there are any jsolait config files in any of the parent folders 
     103            var parentFolder= fileBase; 
     104            while(parentFolder){ 
     105                try{ 
     106                    var src = jsolait.loadURI(parentFolder+'/.jsolait'); 
     107                    try{ 
     108                        var f = new Function('__baseURI__',src); 
     109                        f(parentFolder); 
     110                        break; 
     111                    }catch(e){ 
     112                        print('error in .jsolait', parentFolder); 
     113                        break; 
     114                    } 
     115                }catch(e){ 
     116                } 
     117                parentFolder=fs.getParentFolderName(parentFolder); 
     118            } 
     119 
     120 
    102121            //change working dir to the file's location 
    103122            //todo:is it OK to change cwd? 
  • branches/experimental/jsolait/lib/testing.js

    r73 r74  
    144144 
    145145/** 
     146    Tests a module by running each of the modules test_ methods; 
     147**/ 
     148mod.testModule=function(modObj){ 
     149     
     150    for(var key in modObj){ 
     151        if(key.slice(0,5)=='test_'){ 
     152            print(mod.test(modObj.__name__+'.'+key, modObj[key])); 
     153        } 
     154    } 
     155}; 
     156 
     157/** 
    146158    Raised when an assertion fails. 
    147159**/