Changeset 71

Show
Ignore:
Timestamp:
07/27/06 12:34:43 (2 years ago)
Author:
Jan-Klaas Kollhof
Message:

adding asynchronous import support

Files:

Legend:

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

    r68 r71  
    108108            if(fileName.toLowerCase() != jsolait.__sourceURI__.toLowerCase()  &&  fileName.toLowerCase() != __sourceURI__.toLowerCase()){ 
    109109                var src = jsolait.loadURI(fileName); 
     110                 
    110111                var modl = jsolait.createModuleFromSource("__main__", src, fileName); 
    111                  
    112                 if(typeof modl.__main__=='function'){ 
     112                try{ 
     113                    var tmain =typeof(modl.__main__); 
     114                }catch(e){ 
     115                    var tmain=""; 
     116                } 
     117                if(tmain=='function'){ 
    113118                    //todo find arguments 
    114119                    if(WScript.arguments.named.exists("script-args")){ 
     
    127132                     
    128133                    try{ 
    129                         modl.__main__.apply(modl,args); 
     134                        modl.__main__.apply(modl, args); 
    130135                    }catch(e){ 
    131136                        throw new Exception("runing %s  __main__()  failed\n".format(modl),e) 
    132137                    } 
    133138                } 
     139                 
    134140            } 
    135141        };