Permalink
Browse files

prevent multiple instances of ref from chaining inspects in "overwrit…

…eInspect"
  • Loading branch information...
1 parent 7d0a386 commit 2396e7ef88d8c0fbcddb6fe816456221bfb863e4 Brandon Benvie committed with Aug 3, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 lib/ref.js
View
@@ -1423,8 +1423,12 @@ if (!(exports.NULL instanceof Buffer)) {
}
function overwriteInspect (inspect) {
- return function () {
- var v = inspect.apply(this, arguments)
- return v.replace('Buffer', 'Buffer@0x' + this.address().toString(16))
+ if (inspect.name === 'refinspect') {
+ return inspect
+ } else {
+ return function refinspect() {
+ var v = inspect.apply(this, arguments)
+ return v.replace('Buffer', 'Buffer@0x' + this.address().toString(16))
+ }
}
}

0 comments on commit 2396e7e

Please sign in to comment.