13 lines
		
	
	
		
			386 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			386 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| var uncurryThis = require('../internals/function-uncurry-this');
 | |
| var aCallable = require('../internals/a-callable');
 | |
| 
 | |
| var bind = uncurryThis(uncurryThis.bind);
 | |
| 
 | |
| // optional / simple context binding
 | |
| module.exports = function (fn, that) {
 | |
|   aCallable(fn);
 | |
|   return that === undefined ? fn : bind ? bind(fn, that) : function (/* ...args */) {
 | |
|     return fn.apply(that, arguments);
 | |
|   };
 | |
| };
 | 
