Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / socket.io-client / components / component-bind / index.js
1
2 /**
3  * Slice reference.
4  */
5
6 var slice = [].slice;
7
8 /**
9  * Bind `obj` to `fn`.
10  *
11  * @param {Object} obj
12  * @param {Function|String} fn or string
13  * @return {Function}
14  * @api public
15  */
16
17 module.exports = function(obj, fn){
18   if ('string' == typeof fn) fn = obj[fn];
19   if ('function' != typeof fn) throw new Error('bind() requires a function');
20   var args = [].slice.call(arguments, 2);
21   return function(){
22     return fn.apply(obj, args.concat(slice.call(arguments)));
23   }
24 };