I\'m trying to subclass/extend the native Date object, without modifying the native object itself.
I\'ve tried this:
var util = require(\'util\')
I know this is a bit late, but for others who may encounter this issue, I manged to effectively subclass Date for a polyfill I needed for PhantomJS. The technique seems to work in other browser as well. There were a few additional issues to work out but essentially I followed the same approach as Rudu.
The full commented code is at https://github.com/kbaltrinic/PhantomJS-DatePolyfill.