code cleanup: missing ; and indentation

This commit is contained in:
Misko Hevery 2011-03-23 09:29:20 -07:00
parent fab4ada3c8
commit ec6d106d4a
2 changed files with 15 additions and 7 deletions

View file

@ -751,13 +751,21 @@ function concat(array1, array2, index) {
* @returns {function()} Function that wraps the `fn` with all the specified bindings.
*/
function bind(self, fn) {
var curryArgs = arguments.length > 2 ? slice.call(arguments, 2, arguments.length) : [];
var curryArgs = arguments.length > 2
? slice.call(arguments, 2, arguments.length)
: [];
if (typeof fn == $function && !(fn instanceof RegExp)) {
return curryArgs.length ? function() {
return arguments.length ? fn.apply(self, curryArgs.concat(slice.call(arguments, 0, arguments.length))) : fn.apply(self, curryArgs);
}: function() {
return arguments.length ? fn.apply(self, arguments) : fn.call(self);
};
return curryArgs.length
? function() {
return arguments.length
? fn.apply(self, curryArgs.concat(slice.call(arguments, 0, arguments.length)))
: fn.apply(self, curryArgs);
}
: function() {
return arguments.length
? fn.apply(self, arguments)
: fn.call(self);
};
} else {
// in IE, native methods are not functions and so they can not be bound (but they don't need to be)
return fn;

View file

@ -64,4 +64,4 @@ function $exceptionHandlerMockFactory() {
mockHandler.errors = [];
return mockHandler;
}
}