source: frontend/node_modules/underscore/modules/bindAll.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 602 bytes
Line 
1import restArguments from './restArguments.js';
2import flatten from './_flatten.js';
3import bind from './bind.js';
4
5// Bind a number of an object's methods to that object. Remaining arguments
6// are the method names to be bound. Useful for ensuring that all callbacks
7// defined on an object belong to it.
8export default restArguments(function(obj, keys) {
9 keys = flatten(keys, false, false);
10 var index = keys.length;
11 if (index < 1) throw new Error('bindAll must be passed function names');
12 while (index--) {
13 var key = keys[index];
14 obj[key] = bind(obj[key], obj);
15 }
16 return obj;
17});
Note: See TracBrowser for help on using the repository browser.