|
|
@ -211,7 +211,7 @@ function formatValue(ctx, value, recurseTimes) { |
|
|
|
base = ' ' + value.toUTCString(); |
|
|
|
} |
|
|
|
|
|
|
|
if (keys.length === 0) { |
|
|
|
if (keys.length === 0 && (!array || value.length == 0)) { |
|
|
|
return braces[0] + base + braces[1]; |
|
|
|
} |
|
|
|
|
|
|
@ -225,9 +225,14 @@ function formatValue(ctx, value, recurseTimes) { |
|
|
|
|
|
|
|
ctx.seen.push(value); |
|
|
|
|
|
|
|
var output = keys.map(function(key) { |
|
|
|
var output; |
|
|
|
if (array) { |
|
|
|
output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); |
|
|
|
} else { |
|
|
|
output = keys.map(function(key) { |
|
|
|
return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
ctx.seen.pop(); |
|
|
|
|
|
|
@ -259,6 +264,26 @@ function formatPrimitive(ctx, value) { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { |
|
|
|
var output = []; |
|
|
|
for (var i = 0, l = value.length; i < l; ++i) { |
|
|
|
if (Object.prototype.hasOwnProperty.call(value, String(i))) { |
|
|
|
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, |
|
|
|
String(i), true)); |
|
|
|
} else { |
|
|
|
output.push(''); |
|
|
|
} |
|
|
|
} |
|
|
|
keys.forEach(function(key) { |
|
|
|
if (!key.match(/^\d+$/)) { |
|
|
|
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, |
|
|
|
key, true)); |
|
|
|
} |
|
|
|
}); |
|
|
|
return output; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { |
|
|
|
var name, str; |
|
|
|
if (value.__lookupGetter__) { |
|
|
|