mirror of https://github.com/nodejs/node.git
lib: Remove unused var+operations in util.inspect
This was originally introduced inpull/28770/head6034701
to prevent the closing brace being pushed onto the next line if an object is longer than the max width, however the functionality was removed ind164989
but the supplementary variables (and operations) were left behind
parent
ab54e32bbd
commit
8eaa1ac463
|
@ -424,10 +424,7 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
|
||||||
|
|
||||||
|
|
||||||
function reduceToSingleString(output, base, braces) {
|
function reduceToSingleString(output, base, braces) {
|
||||||
var numLinesEst = 0;
|
|
||||||
var length = output.reduce(function(prev, cur) {
|
var length = output.reduce(function(prev, cur) {
|
||||||
numLinesEst++;
|
|
||||||
if (cur.indexOf('\n') >= 0) numLinesEst++;
|
|
||||||
return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
|
return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue