Use readline.columns in sys.inspect when possible

Though, this should probably be an option to sys.inspect and be set by REPL.
This commit is contained in:
Ryan Dahl 2010-10-09 12:40:15 -07:00
parent d164989e3f
commit 39b9043bef

View File

@ -230,7 +230,7 @@ exports.inspect = function (obj, showHidden, depth, colors) {
return prev + cur.length + 1;
},0);
if (length > 50) {
if (length > (require('readline').columns || 50)) {
output = braces[0]
+ (base === '' ? '' : base + '\n ')
+ ' '