aboutsummaryrefslogtreecommitdiffstats
path: root/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/index.js
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2015-03-14 20:45:20 +0100
committerlookshe <github@lookshe.org>2015-03-14 20:45:20 +0100
commitb60df56157ee1fd0bd4938799bac05a62fda91a1 (patch)
tree2bc906c45ff9ec940e07f9676f5ed34ddd4ae022 /signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/index.js
initial commit from working version
Diffstat (limited to 'signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/index.js')
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/index.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/index.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/index.js
new file mode 100644
index 0000000..9808fc0
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/index.js
@@ -0,0 +1,24 @@
+
+/**
+ * Slice reference.
+ */
+
+var slice = [].slice;
+
+/**
+ * Bind `obj` to `fn`.
+ *
+ * @param {Object} obj
+ * @param {Function|String} fn or string
+ * @return {Function}
+ * @api public
+ */
+
+module.exports = function(obj, fn){
+ if ('string' == typeof fn) fn = obj[fn];
+ if ('function' != typeof fn) throw new Error('bind() requires a function');
+ var args = [].slice.call(arguments, 2);
+ return function(){
+ return fn.apply(obj, args.concat(slice.call(arguments)));
+ }
+};