Avoiding rewriting the console.log in IE. The new nv.log implementation works under IE.

master-patched
Ricardo 12 years ago
parent 66b38c9c23
commit 1167814745

@ -34,12 +34,14 @@ if (nv.dev) {
// ********************************************
// Public Core NV functions
// Make console.log a FUNCTION in IE9 (https://gist.github.com/1466437)
(function(){var a=this.console,b=a&&a.log,c=!b||b.call?0:a.log=function(){c.apply.call(b,a,arguments)}})();
// Logs all arguments, and returns the last so you can test things in place
nv.log = function() {
if (nv.dev && console.log && console.log.apply) console.log.apply(console, arguments);
if (nv.dev && console.log && console.log.apply)
console.log.apply(console, arguments)
else if (nv.dev && console.log && Function.prototype.bind) {
var log = Function.prototype.bind.call(console.log, console);
log.apply(console, arguments);
}
return arguments[arguments.length - 1];
};

10
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -33,12 +33,14 @@ if (nv.dev) {
// ********************************************
// Public Core NV functions
// Make console.log a FUNCTION in IE9 (https://gist.github.com/1466437)
(function(){var a=this.console,b=a&&a.log,c=!b||b.call?0:a.log=function(){c.apply.call(b,a,arguments)}})();
// Logs all arguments, and returns the last so you can test things in place
nv.log = function() {
if (nv.dev && console.log && console.log.apply) console.log.apply(console, arguments);
if (nv.dev && console.log && console.log.apply)
console.log.apply(console, arguments)
else if (nv.dev && console.log && Function.prototype.bind) {
var log = Function.prototype.bind.call(console.log, console);
log.apply(console, arguments);
}
return arguments[arguments.length - 1];
};

Loading…
Cancel
Save