MCPcopy
hub / github.com/angular-ui/ui-grid / bind

Function bind

lib/test/angular/1.4.3/angular.js:1155–1173  ·  view source on GitHub ↗
(self, fn)

Source from the content-addressed store, hash-verified

1153 */
1154/* jshint +W101 */
1155function bind(self, fn) {
1156 var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
1157 if (isFunction(fn) && !(fn instanceof RegExp)) {
1158 return curryArgs.length
1159 ? function() {
1160 return arguments.length
1161 ? fn.apply(self, concat(curryArgs, arguments, 0))
1162 : fn.apply(self, curryArgs);
1163 }
1164 : function() {
1165 return arguments.length
1166 ? fn.apply(self, arguments)
1167 : fn.call(self);
1168 };
1169 } else {
1170 // in IE, native methods are not functions so they cannot be bound (note: they don't need to be)
1171 return fn;
1172 }
1173}
1174
1175
1176function toJsonReplacer(key, value) {

Callers 1

getterFunction · 0.70

Calls 3

sliceArgsFunction · 0.70
isFunctionFunction · 0.70
concatFunction · 0.70

Tested by

no test coverage detected