Changeset 16

Show
Ignore:
Timestamp:
10/28/05 14:31:05 (3 years ago)
Author:
Jan-Klaas Kollhof
Message:

trace message indention fix

Files:

Legend:

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

    r15 r16  
    273273        if(this.trace){ 
    274274            if(this.trace.toTraceString){ 
    275                 s+='\n\n'+ this.trace.toTraceString(indent + 8); 
     275                s+=('\n\nbecause:\n'+ this.trace.toTraceString(indent + 4)); 
    276276            }else{ 
    277                 s+=(this.trace +'\n').indent(indent); 
     277                s+=(this.trace +'\n').indent(indent+4); 
    278278            } 
    279279        } 
     
    407407        **/ 
    408408        publ.__init__=function(sourceURI, trace){ 
    409             supr.__init__.call(this, "Failed to load file: '%s'".format(sourceURI), trace); 
     409            supr.__init__.call(this, "Failed to load file: '%s'".format(sourceURI.indent(2)), trace); 
    410410            this.sourceURI = sourceURI; 
    411411        }; 
     
    457457                         
    458458            try{//interpret the script 
     459                var srcURI = src.__sourceURI__; 
    459460                src = 'Module.currentURI="%s";\n%s\nModule.currentURI=null;\n'.format(src.__sourceURI__.replace(/\\/g, '\\\\'), src); 
    460461                var f=new Function("",src); //todo should it use globalEval ? 
    461462                f(); 
    462463            }catch(e){ 
    463                 throw new mod.ImportFailed(name, [src.__sourceURI__], e); 
     464                throw new mod.ImportFailed(name, [srcURI], e); 
    464465            } 
    465466             
     
    480481        **/ 
    481482        publ.__init__=function(moduleName, moduleURIs, trace){ 
    482             supr.__init__.call(this, "Failed to import module: '%s' from:\n%s".format(moduleName, moduleURIs.join(',\n')), trace); 
     483            supr.__init__.call(this, "Failed to import module: '%s' from:\n%s".format(moduleName, moduleURIs.join(',\n').indent(2)), trace); 
    483484            this.moduleName = moduleName; 
    484485            this.moduleURIs = moduleURIs; 
     
    755756        var s=this.split('\n'); 
    756757        for(var i=0;i<s.length;i++){ 
    757             var pr=''; 
    758             for(var k=0;k<indent;k++){ 
    759                 pr +=' '; 
    760             }   
    761             out.push(pr + s[i]); 
     758            out.push(' '.mul(indent) + s[i]); 
    762759        } 
    763760        return out.join('\n'); 
    764761    }; 
     762     
     763    String.prototype.mul=function(l){ 
     764        var a=new Array(l+1); 
     765        return a.join(this); 
     766    } 
    765767     
    766768    ///Tests the module. 
     
    770772}); 
    771773 
    772