From 2420670104211d9d6bb9871b173fa33f99a071b3 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 17 Oct 2012 14:16:57 +0200 Subject: [PATCH] phantomjs has Function.prototype.bind undefined. --- 4chan_x.user.js | 8 ++++---- lib/$.coffee | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 1c24e63a8..afb728aa7 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -43,7 +43,7 @@ */ (function() { - var $, $$, Anonymize, AutoGIF, Board, Build, Clone, Conf, Config, FileInfo, Get, ImageHover, Main, Post, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, Quotify, Redirect, RevealSpoilers, Sauce, Thread, ThreadUpdater, Time, UI, d, g, unitTesting, + var $, $$, Anonymize, AutoGIF, Board, Build, Clone, Conf, Config, FileInfo, Get, ImageHover, Main, Post, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, Quotify, Redirect, RevealSpoilers, Sauce, Thread, ThreadUpdater, Time, UI, d, g, unitTesting, _base, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; @@ -379,7 +379,7 @@ MINUTE: 1000 * 60, HOUR: 1000 * 60 * 60, DAY: 1000 * 60 * 60 * 24, - log: console.log.bind(console), + log: typeof (_base = console.log).bind === "function" ? _base.bind(console) : void 0, engine: /WebKit|Presto|Gecko/.exec(navigator.userAgent)[0].toLowerCase(), id: function(id) { return d.getElementById(id); @@ -1483,8 +1483,8 @@ return $.add(this.nodes.info, container); }, getContainer: function(id) { - var _base; - return (_base = this.containers)[id] || (_base[id] = $.el('span', { + var _base1; + return (_base1 = this.containers)[id] || (_base1[id] = $.el('span', { className: 'container' })); } diff --git a/lib/$.coffee b/lib/$.coffee index 263564d85..1a030a6f1 100644 --- a/lib/$.coffee +++ b/lib/$.coffee @@ -16,7 +16,8 @@ $.extend $, MINUTE: 1000 * 60 HOUR : 1000 * 60 * 60 DAY : 1000 * 60 * 60 * 24 - log: console.log.bind console + # XXX http://code.google.com/p/phantomjs/issues/detail?id=522 + log: console.log.bind? console engine: /WebKit|Presto|Gecko/.exec(navigator.userAgent)[0].toLowerCase() id: (id) -> d.getElementById id