The reason you are calling IMS.putLogis a variable thisfor the function IMS; the implementation console.logprobably expects what thiswill be console.
Here's a workaround:
IMS.putLog = console.log.bind(console);
This ensures that this consolewhen you call the log function.
Unfortunately, this will not work in IE <9, or possibly other browsers. I know that binddoes not work in PhantomJS, if that matters.
Jacob source
share