joyent/node — pull request #8477 by gyson (2014-10-01 03:02:12+00:00)
Title: util: add es6 Symbol support for `util.inspect`

* `util.inspect` cannot accept es6 symbol primitive
* it will throw exception if do `util.inspect(Symbol())`
* this also affects repl, console.log, etc.

```
$ node --harmony
> Symbol()
TypeError: Object.keys called on non-object
at Function.keys (native)
at formatValue (util.js:235:21)
at Object.inspect (util.js:147:10)
at REPLServer.self.writer (repl.js:209:19)
at finish (repl.js:316:38)
at REPLServer.defaultEval (repl.js:145:5)
at bound (domain.js:257:14)
at REPLServer.runBound [as eval] (domain.js:270:12)
at REPLServer. (repl.js:277:12)
at REPLServer.EventEmitter.emit (events.js:107:17)
```

This pull request adds a symbol check in `formatPrimitive`

Note, we don't need concern about boxed symbol primitive because
`new Symbol()` will throw a `TypeError`