visionmedia/dox — pull request #80 by timoxley (2013-01-10 02:26:28+00:00)
Title: Prevent error when using --api & comments have no example code.

Output if trying to use `--api` flag on anything that doesn't have example code in the comments:

```
/usr/local/share/npm/lib/node_modules/dox/lib/api.js:25
code.forEach(function(block){
^
TypeError: Cannot call method 'forEach' of null
at Object.module.exports [as api] (/usr/local/share/npm/lib/node_modules/dox/lib/api.js:25:8)
at Socket. (/usr/local/share/npm/lib/node_modules/dox/bin/dox:46:30)
at Socket.EventEmitter.emit (events.js:93:17)
at Pipe.onread (net.js:418:51)
```

Simply needs to ensure `code` is an array before doing the `forEach`. Patch includes previously failing test.