joyent/node — pull request #2717 by visionmedia (2012-02-08 16:54:13+00:00)
Title: Changed: `console.dir()` to bypass inspect() methods

Given the following script:

```js
function User(first, last) {
this.first = first;
this.last = last;
this._id = 12345;
this._role = 'admin';
this.inspect = function(){
return '#'
};
}

function UserCollection() {
var users = [];
this.push = function(user){ users.push(user); };
this.inspect = function(){
return '#'
};
}

var users = new UserCollection;
users.push(new User('tobi', 'ferret'));
users.push(new User('loki', 'ferret'));
users.push(new User('jane', 'ferret'));

console.log(users);
console.log();
console.dir(users);
```

before this change you get the same output of:

```
#
#
#>

#
#
#>
```

not so useful, to make `console.dir()` more like the browser in that it's more representative of what the object really contains I think this would be a really useful switch, otherwise there's no way (AFAIK) to bypass potentially confusing `.inspect()` implementations. With this change you'll then get:

```js

#
#
#>

{ push: [Function], inspect: [Function] }
```