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
lanes-0.8.0 node_modules/babel-register/node_modules/core-js/modules/_invoke.js
lanes-0.8.0 node_modules/babel-register/node_modules/core-js/library/modules/_invoke.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/core-js/modules/$.invoke.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/core-js/library/modules/$.invoke.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/core-js/modules/$.invoke.js
xcodebuild-helper-1.2.3 externals/ios-sim-master/node_modules/core-js/library/modules/$.invoke.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helpers/node_modules/core-js/modules/_invoke.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helpers/node_modules/core-js/library/modules/_invoke.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-messages/node_modules/core-js/library/modules/_invoke.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-messages/node_modules/core-js/modules/_invoke.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-plugin-check-es2015-constants/node_modules/core-js/library/modules/_invoke.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-regex/node_modules/core-js/library/modules/_invoke.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-regex/node_modules/core-js/modules/_invoke.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-optimise-call-expression/node_modules/core-js/modules/_invoke.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-remap-async-to-generator/node_modules/core-js/library/modules/_invoke.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-hoist-variables/node_modules/core-js/library/modules/_invoke.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-hoist-variables/node_modules/core-js/modules/_invoke.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-optimise-call-expression/node_modules/core-js/library/modules/_invoke.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-remap-async-to-generator/node_modules/core-js/modules/_invoke.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-function-name/node_modules/core-js/library/modules/_invoke.js