aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Angular.js20
-rw-r--r--test/mocks.js2
2 files changed, 15 insertions, 7 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 28631b64..de6f2e5b 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -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;
diff --git a/test/mocks.js b/test/mocks.js
index bad6fac5..8a346bcb 100644
--- a/test/mocks.js
+++ b/test/mocks.js
@@ -64,4 +64,4 @@ function $exceptionHandlerMockFactory() {
mockHandler.errors = [];
return mockHandler;
-} \ No newline at end of file
+}