Having a callback is useful to shut down a node app after an uncaughtException, while making sure Hoptoad has received the error. Shutting down (and restarting) is usually a good idea since exceptions cause the call stack to drop and most libraries will not take kindly to sudden interruption. That is, their state will become inconsistent and future calls to them might produce unpredictable results. This patch does not include a test since JSpec seems to put plenty of emphasis on cute syntax sugar, but does very little in the way of advanced stubbing, faking and mocking. I did consider bringing in gently as a dependency, but since I was not sure if that would increase the chances of this getting merged I just went ahead and implemented this the old school way. Not happy with it, but I can't justify spending more time on it right now.
The process.env object uses getters and setters within node.cc which caused problems. Specifcially the following function in node.cc: static Handle<Value> EnvSetter Was turning every value set into a string. So `undefined` was cast into `'undefined'` which made two tests go haywire. This patches fixes the problem by replacing process.env with a plain object for the test.
…ch as "at /Users/my/path/file.js:95:19".
This reverts commit e270329.
…ems in the array, not a porition of it.