Sha256: 139a04988fed27807d7b9b2457a6ca6a772e4551a0d2dc0d516f592870466482

Contents?: true

Size: 709 Bytes

Versions: 422

Compression:

Stored size: 709 Bytes

Contents

// fast apply, http://jsperf.lnkit.com/fast-apply/5
module.exports = function(fn, args, that){
  var un = that === undefined;
  switch(args.length){
    case 0: return un ? fn()
                      : fn.call(that);
    case 1: return un ? fn(args[0])
                      : fn.call(that, args[0]);
    case 2: return un ? fn(args[0], args[1])
                      : fn.call(that, args[0], args[1]);
    case 3: return un ? fn(args[0], args[1], args[2])
                      : fn.call(that, args[0], args[1], args[2]);
    case 4: return un ? fn(args[0], args[1], args[2], args[3])
                      : fn.call(that, args[0], args[1], args[2], args[3]);
  } return              fn.apply(that, args);
};

Version data entries

422 entries across 50 versions & 9 rubygems

Version Path
sequenceserver-3.1.3 public/vendor/npm/core-js@1.1.2/modules/$.invoke.js
sequenceserver-3.1.3 public/vendor/npm/core-js@1.1.2/library/modules/$.invoke.js
sequenceserver-3.1.2 public/vendor/npm/core-js@1.1.2/library/modules/$.invoke.js
sequenceserver-3.1.2 public/vendor/npm/core-js@1.1.2/modules/$.invoke.js
sequenceserver-3.1.1 public/vendor/npm/core-js@1.1.2/library/modules/$.invoke.js
sequenceserver-3.1.1 public/vendor/npm/core-js@1.1.2/modules/$.invoke.js
sequenceserver-3.1.0 public/vendor/npm/core-js@1.1.2/library/modules/$.invoke.js
sequenceserver-3.1.0 public/vendor/npm/core-js@1.1.2/modules/$.invoke.js
sequenceserver-3.0.1 public/vendor/npm/core-js@1.1.2/library/modules/$.invoke.js
sequenceserver-3.0.1 public/vendor/npm/core-js@1.1.2/modules/$.invoke.js
sequenceserver-3.0 public/vendor/npm/core-js@1.1.2/modules/$.invoke.js
sequenceserver-3.0 public/vendor/npm/core-js@1.1.2/library/modules/$.invoke.js
sequenceserver-2.2.0 public/vendor/npm/core-js@1.1.2/modules/$.invoke.js
sequenceserver-2.2.0 public/vendor/npm/core-js@1.1.2/library/modules/$.invoke.js
sequenceserver-2.1.0 public/vendor/npm/core-js@1.1.2/library/modules/$.invoke.js
sequenceserver-2.1.0 public/vendor/npm/core-js@1.1.2/modules/$.invoke.js
sequenceserver-2.0.0 public/vendor/npm/core-js@1.1.2/library/modules/$.invoke.js
sequenceserver-2.0.0 public/vendor/npm/core-js@1.1.2/modules/$.invoke.js
sequenceserver-2.0.0.rc8 public/vendor/npm/core-js@1.1.2/library/modules/$.invoke.js
sequenceserver-2.0.0.rc8 public/vendor/npm/core-js@1.1.2/modules/$.invoke.js