2 PhantomJS does not implement bind. this is from
3 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
5 if (!Function.prototype.bind) {
6 Function.prototype.bind = function (oThis) {
7 if (typeof this !== "function") {
8 // closest thing possible to the ECMAScript 5 internal IsCallable function
9 throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
12 var aArgs = Array.prototype.slice.call(arguments, 1),
14 fNOP = function () {},
15 fBound = function () {
16 return fToBind.apply(this instanceof fNOP && oThis
19 aArgs.concat(Array.prototype.slice.call(arguments)));
22 fNOP.prototype = this.prototype;
23 fBound.prototype = new fNOP();