From 221e1054b8152da1ae2d86680c9051f9ddcbcd35 Mon Sep 17 00:00:00 2001 From: Farrin Reid Date: Sat, 23 Jun 2012 06:58:00 -0800 Subject: [PATCH] [fix] Changed require('sys') to require('util') for compatibility with node v0.8 --- vendor/jsclass/console.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/jsclass/console.js b/vendor/jsclass/console.js index 5ac1c8a..5dc46f6 100644 --- a/vendor/jsclass/console.js +++ b/vendor/jsclass/console.js @@ -1 +1 @@ -JS.Console=new JS.Module('Console',{extend:{nameOf:function(a,b){var d=[],e,j,c,f;if(JS.isType(a,Array)){for(e=0,j=a.length;e0){var d=this.__buffer__.length,e=this.BROWSER?1000:this.MAX_BUFFER_LENGTH,j=(d>0&&this.coloring()),c=j?this.escape('1F')+this.escape((d+1)+'G'):'',f=a.substr(0,e-d);this.__buffer__+=f;if(this.coloring())this.writeToStdout(c+this.flushFormat()+f);else if(this.__buffer__.length===e)this.writeToStdout(this.__buffer__);if(this.__buffer__.length===e)this.__buffer__='';a=a.substr(e-d)}if(!b){if(a===''&&!this.__buffer__)this.writeToStdout(this.flushFormat()+'');if(!this.coloring()&&this.__buffer__)this.writeToStdout(this.__buffer__);this.__buffer__=''}},writeToStdout:function(a){if(this.BROWSER&&window.runtime)return window.runtime.trace(a);if(typeof console!=='undefined')return console.log(a);if(typeof alert==='function')return alert(a);if(typeof process==='object')return require('sys').puts(a);if(typeof WScript!=='undefined')return WScript.Echo(a);if(typeof print==='function')return print(a)}},consoleFormat:function(){if(!JS.Console.coloring())return;this.reset();var a=arguments.length;while(a--)this[arguments[a]]()},puts:function(a){a=(a===undefined?'':a).toString();var b=JS.Console;if(!b.NODE)return b.output(a,false);require('sys').puts(b.flushFormat()+a);b.__print__=false},print:function(a){a=(a===undefined?'':a).toString();var b=JS.Console;if(!b.NODE)return b.output(a,true);require('sys').print(b.flushFormat()+a);b.__print__=true},printTable:function(c,f){var g=[],c=[['Method','Calls']].concat(c),l=JS.Console,i=c.length,h,m;while(i--){h=c[i].length;while(h--){g[h]=g[h]||0;m=(c[i][h]===undefined?'':c[i][h]).toString();g[h]=Math.max(m.length,g[h])}}var k='+',h=g.length;while(h--)k='+'+l.repeat('-',g[h]+2)+k;k=' '+k;this.reset();this.puts();this.puts(k);var n=function(a,b){var d=c[a];this.reset();this.print(' ');for(var e=0,j=d.length;e0){var d=this.__buffer__.length,e=this.BROWSER?1000:this.MAX_BUFFER_LENGTH,j=(d>0&&this.coloring()),c=j?this.escape('1F')+this.escape((d+1)+'G'):'',f=a.substr(0,e-d);this.__buffer__+=f;if(this.coloring())this.writeToStdout(c+this.flushFormat()+f);else if(this.__buffer__.length===e)this.writeToStdout(this.__buffer__);if(this.__buffer__.length===e)this.__buffer__='';a=a.substr(e-d)}if(!b){if(a===''&&!this.__buffer__)this.writeToStdout(this.flushFormat()+'');if(!this.coloring()&&this.__buffer__)this.writeToStdout(this.__buffer__);this.__buffer__=''}},writeToStdout:function(a){if(this.BROWSER&&window.runtime)return window.runtime.trace(a);if(typeof console!=='undefined')return console.log(a);if(typeof alert==='function')return alert(a);if(typeof process==='object')return require('util').puts(a);if(typeof WScript!=='undefined')return WScript.Echo(a);if(typeof print==='function')return print(a)}},consoleFormat:function(){if(!JS.Console.coloring())return;this.reset();var a=arguments.length;while(a--)this[arguments[a]]()},puts:function(a){a=(a===undefined?'':a).toString();var b=JS.Console;if(!b.NODE)return b.output(a,false);require('util').puts(b.flushFormat()+a);b.__print__=false},print:function(a){a=(a===undefined?'':a).toString();var b=JS.Console;if(!b.NODE)return b.output(a,true);require('util').print(b.flushFormat()+a);b.__print__=true},printTable:function(c,f){var g=[],c=[['Method','Calls']].concat(c),l=JS.Console,i=c.length,h,m;while(i--){h=c[i].length;while(h--){g[h]=g[h]||0;m=(c[i][h]===undefined?'':c[i][h]).toString();g[h]=Math.max(m.length,g[h])}}var k='+',h=g.length;while(h--)k='+'+l.repeat('-',g[h]+2)+k;k=' '+k;this.reset();this.puts();this.puts(k);var n=function(a,b){var d=c[a];this.reset();this.print(' ');for(var e=0,j=d.length;e