summaryrefslogtreecommitdiff
path: root/lib/util.js
diff options
context:
space:
mode:
authorFedor Indutny <fedor.indutny@gmail.com>2012-01-24 00:30:28 +0600
committerFedor Indutny <fedor.indutny@gmail.com>2012-01-24 00:30:28 +0600
commit667aae596cded9336f50574386683ec39ada43f2 (patch)
tree41918ad8d4801cc34215b054cb63dc83bd1ce8a5 /lib/util.js
parent2433eeb3850a91feb99bab530cb7183800166390 (diff)
parent6c0c00a2052ec613503a0322dcbabb6fcf41dab0 (diff)
downloadnode-new-667aae596cded9336f50574386683ec39ada43f2.tar.gz
Merge branch 'v0.6'
Conflicts: ChangeLog doc/template.html lib/cluster.js lib/http.js lib/tls.js src/node.h src/node_version.h test/simple/test-cluster-kill-workers.js
Diffstat (limited to 'lib/util.js')
-rw-r--r--lib/util.js27
1 files changed, 13 insertions, 14 deletions
diff --git a/lib/util.js b/lib/util.js
index 8cc4739f27..d3b13066f8 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -296,29 +296,28 @@ function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
- var name, str;
- if (value.__lookupGetter__) {
- if (value.__lookupGetter__(key)) {
- if (value.__lookupSetter__(key)) {
- str = ctx.stylize('[Getter/Setter]', 'special');
- } else {
- str = ctx.stylize('[Getter]', 'special');
- }
+ var name, str, desc;
+ desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
+ if (desc.get) {
+ if (desc.set) {
+ str = ctx.stylize('[Getter/Setter]', 'special');
} else {
- if (value.__lookupSetter__(key)) {
- str = ctx.stylize('[Setter]', 'special');
- }
+ str = ctx.stylize('[Getter]', 'special');
+ }
+ } else {
+ if (desc.set) {
+ str = ctx.stylize('[Setter]', 'special');
}
}
if (visibleKeys.indexOf(key) < 0) {
name = '[' + key + ']';
}
if (!str) {
- if (ctx.seen.indexOf(value[key]) < 0) {
+ if (ctx.seen.indexOf(desc.value) < 0) {
if (recurseTimes === null) {
- str = formatValue(ctx, value[key], null);
+ str = formatValue(ctx, desc.value, null);
} else {
- str = formatValue(ctx, value[key], recurseTimes - 1);
+ str = formatValue(ctx, desc.value, recurseTimes - 1);
}
if (str.indexOf('\n') > -1) {
if (array) {