MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / bind

Function bind

web/static/bower_components/angular/angular.js:1176–1194  ·  view source on GitHub ↗
(self, fn)

Source from the content-addressed store, hash-verified

1174 */
1175/* jshint +W101 */
1176function bind(self, fn) {
1177 var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
1178 if (isFunction(fn) && !(fn instanceof RegExp)) {
1179 return curryArgs.length
1180 ? function() {
1181 return arguments.length
1182 ? fn.apply(self, concat(curryArgs, arguments, 0))
1183 : fn.apply(self, curryArgs);
1184 }
1185 : function() {
1186 return arguments.length
1187 ? fn.apply(self, arguments)
1188 : fn.call(self);
1189 };
1190 } else {
1191 // in IE, native methods are not functions so they cannot be bound (note: they don't need to be)
1192 return fn;
1193 }
1194}
1195
1196
1197function toJsonReplacer(key, value) {

Callers 1

getterFunction · 0.85

Calls 3

sliceArgsFunction · 0.85
isFunctionFunction · 0.85
concatFunction · 0.85

Tested by

no test coverage detected