Added type check for console.log to prevent IE8+modernizr issues

master-patched
Jacob Quant 11 years ago
parent 683eb18ce1
commit 9cac28a26a

@ -35,10 +35,13 @@ if (nv.dev) {
// Public Core NV functions
// Logs all arguments, and returns the last so you can test things in place
// Note: in IE8 console.log is an object not a function, and if modernizr is used
// then calling Function.prototype.bind with with anything other than a function
// causes a TypeError to be thrown.
nv.log = function() {
if (nv.dev && console.log && console.log.apply)
console.log.apply(console, arguments)
else if (nv.dev && console.log && Function.prototype.bind) {
else if (nv.dev && typeof console.log == "function" && Function.prototype.bind) {
var log = Function.prototype.bind.call(console.log, console);
log.apply(console, arguments);
}

2
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -34,10 +34,13 @@ if (nv.dev) {
// Public Core NV functions
// Logs all arguments, and returns the last so you can test things in place
// Note: in IE8 console.log is an object not a function, and if modernizr is used
// then calling Function.prototype.bind with with anything other than a function
// causes a TypeError to be thrown.
nv.log = function() {
if (nv.dev && console.log && console.log.apply)
console.log.apply(console, arguments)
else if (nv.dev && console.log && Function.prototype.bind) {
else if (nv.dev && typeof console.log == "function" && Function.prototype.bind) {
var log = Function.prototype.bind.call(console.log, console);
log.apply(console, arguments);
}

Loading…
Cancel
Save