justaprogrammer/ObjectId.js — pull request #7 by cstigler (2014-08-11 20:58:01+00:00)
Title: Fix crashes on Node (from stringifying invalid ObjectIds, and from no document global)

We at [Zaption](http://www.zaption.com) have been using ObjectId.js on Node. It works pretty well, but had a few persistent crashes (which are annoying on Node because they down the entire process). We fixed them a while back, but I thought it'd be good to contribute them back to the source.

* Fix crash when stringifying an invalid ObjectId (returns ```Invalid ObjectId``` instead, similar behavior to the JS Date object when stringifying an invalid Date)
* Works without a ```document``` global, which Node doesn't have, by faking it