Sha256: 1f099c85144619bd7169e40ae8a94dd4efaf317c29549a87acdae78ec53cdb5b

Contents?: true

Size: 978 Bytes

Versions: 3

Compression:

Stored size: 978 Bytes

Contents

/*
   PhantomJS does not implement bind. this is from
              https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
 */
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;
    };
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
less-2.6.0 lib/less/js/test/browser/es5.js
less-2.5.1 lib/less/js/test/browser/es5.js
less-2.5.0 lib/less/js/test/browser/es5.js