MCPcopy Create free account
hub / github.com/OpenReservation/OpenReservation / bind

Function bind

OpenReservation/wwwroot/Scripts/angular.js:1186–1204  ·  view source on GitHub ↗
(self, fn)

Source from the content-addressed store, hash-verified

1184 */
1185 /* jshint +W101 */
1186 function bind(self, fn) {
1187 var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
1188 if (isFunction(fn) && !(fn instanceof RegExp)) {
1189 return curryArgs.length
1190 ? function () {
1191 return arguments.length
1192 ? fn.apply(self, concat(curryArgs, arguments, 0))
1193 : fn.apply(self, curryArgs);
1194 }
1195 : function () {
1196 return arguments.length
1197 ? fn.apply(self, arguments)
1198 : fn.call(self);
1199 };
1200 } else {
1201 // in IE, native methods are not functions so they cannot be bound (note: they don't need to be)
1202 return fn;
1203 }
1204 }
1205
1206 function toJsonReplacer(key, value) {
1207 var val = value;

Callers 1

getterFunction · 0.85

Calls 3

sliceArgsFunction · 0.85
isFunctionFunction · 0.85
concatFunction · 0.85

Tested by

no test coverage detected