From e20d07e1be9e9794577728c657853a67be36f479 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 11 Dec 2011 21:04:42 +0100 Subject: [PATCH] console.log.bind --- 4chan_x.user.js | 8 ++------ script.coffee | 6 +----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index dcfc4895e..ee44c4fb2 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -64,7 +64,7 @@ */ (function() { - var $, $$, DAY, Favicon, HOUR, MINUTE, Main, NAMESPACE, Recaptcha, SECOND, Time, VERSION, anonymize, conf, config, cooldown, d, engine, expandComment, expandThread, filter, flatten, g, getTitle, imgExpand, imgGif, imgHover, key, keybinds, log, nav, options, qr, quoteBacklink, quoteDR, quoteInline, quoteOP, quotePreview, redirect, replyHiding, reportButton, revealSpoilers, sauce, strikethroughQuotes, threadHiding, threadStats, threading, titlePost, ui, unread, updater, val, watcher; + var $, $$, DAY, Favicon, HOUR, MINUTE, Main, NAMESPACE, Recaptcha, SECOND, Time, VERSION, anonymize, conf, config, cooldown, d, engine, expandComment, expandThread, filter, flatten, g, getTitle, imgExpand, imgGif, imgHover, key, keybinds, log, nav, options, qr, quoteBacklink, quoteDR, quoteInline, quoteOP, quotePreview, redirect, replyHiding, reportButton, revealSpoilers, sauce, strikethroughQuotes, threadHiding, threadStats, threading, titlePost, ui, unread, updater, val, watcher, _base; var __slice = Array.prototype.slice; config = { @@ -171,11 +171,7 @@ } }; - if (typeof console !== "undefined" && console !== null) { - log = function(arg) { - return console.log(arg); - }; - } + log = typeof (_base = console.log).bind === "function" ? _base.bind(console) : void 0; if (!Object.keys) { Object.keys = function(o) { diff --git a/script.coffee b/script.coffee index ca8a7db52..6120a9072 100644 --- a/script.coffee +++ b/script.coffee @@ -98,11 +98,7 @@ config = 'Auto Update': [true, 'Automatically fetch new posts'] 'Interval': 30 -# XXX chrome can't into `{log} = console` -if console? - # XXX scriptish - console.log.apply is not a function - log = (arg) -> - console.log arg +log = console.log.bind? console # XXX opera cannot into Object.keys if not Object.keys