Fixing console polyfill when a browser has some console methods but not all