# HG changeset patch # User Adrien Di Mascio # Date 1406297506 -7200 # Node ID 18d1ef2d2a3ee5c8f44ea79b2d2271db4150f0c0 # Parent 9c7461bf99a77fe9e3e9fc674e2b5ebd5d2bdf1c [js] simplify cw.log implementation There's no need to rebuild and array and join its content, just call console.log with ``arguments``. The only trick is that console.log must be called on a console instance. diff -r 9c7461bf99a7 -r 18d1ef2d2a3e web/data/cubicweb.js --- a/web/data/cubicweb.js Mon Jun 22 11:28:16 2015 +0200 +++ b/web/data/cubicweb.js Fri Jul 25 16:11:46 2014 +0200 @@ -15,13 +15,10 @@ removeEventListener: function() {}, detachEvent: function() {}, - log: function () { - var args = []; - for (var i = 0; i < arguments.length; i++) { - args.push(arguments[i]); - } + log: function log() { if (typeof(window) != "undefined" && window.console && window.console.log) { - window.console.log(args.join(' ')); + // NOTE console.log requires "console" to be the console to be "this" + window.console.log.apply(console, arguments); } },