aboutsummaryrefslogtreecommitdiffstats
path: root/src/Angular.js
diff options
context:
space:
mode:
authorMisko Hevery2010-08-11 11:44:12 -0700
committerMisko Hevery2010-08-11 11:44:12 -0700
commit3d5719cd44868f89352ebbedd0e1b1f2575520cb (patch)
tree3947d275110c464b8b40d8cd9d0446983e419256 /src/Angular.js
parentab2213e80e09c763782bebc5e0ff7509056e828a (diff)
downloadangular.js-3d5719cd44868f89352ebbedd0e1b1f2575520cb.tar.bz2
removed undocumented/unneeded methods from Array API
Diffstat (limited to 'src/Angular.js')
-rw-r--r--src/Angular.js20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 902ae013..3970f762 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -291,19 +291,17 @@ function escapeAttr(html) {
'"');
}
-function bind(_this, _function) {
- var curryArgs = slice.call(arguments, 2, arguments.length);
- if (typeof _function == 'function') {
- return curryArgs.length == 0 ?
- function() {
- return _function.apply(_this, arguments);
- } :
- function() {
- return _function.apply(_this, curryArgs.concat(slice.call(arguments, 0, arguments.length)));
- };
+function bind(self, fn) {
+ var curryArgs = arguments.length > 2 ? slice.call(arguments, 2, arguments.length) : [];
+ if (typeof fn == 'function') {
+ 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 ore not functions and so they can not be bound (but they don't need to be)
- return _function;
+ return fn;
}
}