Sha256: ed74a8a979e7bee40d9cb69bf308494bb38b68ac0d4a63d4d70c4bc833447403

Contents?: true

Size: 505 Bytes

Versions: 320

Compression:

Stored size: 505 Bytes

Contents

// optional / simple context binding
var aFunction = require('./_a-function');
module.exports = function(fn, that, length){
  aFunction(fn);
  if(that === undefined)return fn;
  switch(length){
    case 1: return function(a){
      return fn.call(that, a);
    };
    case 2: return function(a, b){
      return fn.call(that, a, b);
    };
    case 3: return function(a, b, c){
      return fn.call(that, a, b, c);
    };
  }
  return function(/* ...args */){
    return fn.apply(that, arguments);
  };
};

Version data entries

320 entries across 8 versions & 3 rubygems

Version Path
affiliator-0.2.1 node_modules/core-js/library/modules/_ctx.js
affiliator-0.2.1 node_modules/core-js/modules/_ctx.js
lanes-0.8.0 node_modules/babel-register/node_modules/core-js/modules/_ctx.js
lanes-0.8.0 node_modules/babel-runtime/node_modules/core-js/library/modules/_ctx.js
lanes-0.8.0 node_modules/babel-runtime/node_modules/core-js/modules/_ctx.js
lanes-0.8.0 node_modules/babel-register/node_modules/core-js/library/modules/_ctx.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-get-function-arity/node_modules/core-js/modules/_ctx.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-function-name/node_modules/core-js/library/modules/_ctx.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-hoist-variables/node_modules/core-js/library/modules/_ctx.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-call-delegate/node_modules/core-js/library/modules/_ctx.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-generator/node_modules/core-js/modules/_ctx.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-define-map/node_modules/core-js/modules/_ctx.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-function-name/node_modules/core-js/modules/_ctx.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-get-function-arity/node_modules/core-js/library/modules/_ctx.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-helper-call-delegate/node_modules/core-js/modules/_ctx.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-core/node_modules/core-js/library/modules/_ctx.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-core/node_modules/core-js/modules/_ctx.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-code-frame/node_modules/core-js/library/modules/_ctx.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-code-frame/node_modules/core-js/modules/_ctx.js
babel-schmooze-sprockets-0.1.3 node_modules/babel-generator/node_modules/core-js/library/modules/_ctx.js