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