Firefox has no problem with
var logger = window.console.log, // breaks Safari but not Firefox
but Safari gives a Type Error the first place I try to use logger(). Note the snippet below.
I went ahead and replaced all my logger()’s with window.console.log() to get rid of the error.
I don’t understand why Safari doesn’t like it and why it calls it a type error.
Error
TypeError: Type error
Snippet
/*log
**
**
**
*/
NS.log = function (arg) {
if (window.console) {
var logger = window.console.log, // breaks Safari but not Firefox
str1 = Object.prototype.toString.call(arg);
// ... snip
This should work: