[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.
--- 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);
}
},