LearnBoost/mongoose — pull request #646 by chrisleishman (2011-12-13 17:53:50+00:00)
Title: Fix compatability with datejs

Fixes compatibility with datejs (or any other library that adds a toObject method to the Date prototype).

The fix ensures that mongoose ignores toObject methods for the standard types "Date", "Function" and "Regex" (these were currently checked for _after_ looking for a toObject method).

This fix addresses issue #502.