Browse Source

fix utils.inspect's detection of circular structures

v0.7.4-release
Tim Cooijmans 14 years ago
committed by Ryan Dahl
parent
commit
d4b726a1a6
  1. 6
      lib/util.js

6
lib/util.js

@ -145,8 +145,6 @@ exports.inspect = function (obj, showHidden, depth, colors) {
base = ' ' + value.toUTCString();
}
seen.push(value);
if (keys.length === 0) {
return braces[0] + base + braces[1];
}
@ -159,6 +157,8 @@ exports.inspect = function (obj, showHidden, depth, colors) {
}
}
seen.push(value);
var output = keys.map(function (key) {
var name, str;
if (value.__lookupGetter__) {
@ -218,6 +218,8 @@ exports.inspect = function (obj, showHidden, depth, colors) {
return name + ": " + str;
});
seen.pop();
var numLinesEst = 0;
var length = output.reduce(function(prev, cur) {
numLinesEst++;

Loading…
Cancel
Save