From 506e36c9cc1b66c02abf5e1b60784a91fd74cdf0 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Thu, 18 Feb 2016 11:15:59 +0700 Subject: [PATCH] Remove function bind polyfill from worker.js This is no longer required in Phantom.js 2.x --- src/worker/worker.js | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/worker/worker.js b/src/worker/worker.js index a19c6fa9..f08c1327 100644 --- a/src/worker/worker.js +++ b/src/worker/worker.js @@ -19,28 +19,6 @@ self.window = {}; // to make UMD bundles work -// Mozilla bind polyfill because phantomjs is stupid -if (!Function.prototype.bind) { - Function.prototype.bind = function(oThis) { - if (typeof this !== "function") { - // closest thing possible to the ECMAScript 5 internal IsCallable function - throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); - } - - var aArgs = Array.prototype.slice.call(arguments, 1), - fToBind = this, - FNOP = function() {}, - fBound = function() { - return fToBind.apply(this instanceof FNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments))); - }; - - FNOP.prototype = this.prototype; - fBound.prototype = new FNOP(); - - return fBound; - }; -} - importScripts('openpgp.js'); var openpgp = window.openpgp;