Todd Ross wrote:
> Function.prototype.bind = function() {
>   var __method = this, args = $A(arguments), object = args.shift();
>   return function() {
>     return __method.apply(object, args.concat($A(arguments)));
>   }
> }
...
> The arguments aren't duplicated.

Oh, I see.  (oops)

When 'args= $A(arguments),' is evaluated, 'arguments' is a list 
which has only one element (the function in question).

In other words, it's equivalent to:

Function.prototype.bind = function(object) {
  var __method = this;
  return function() {
    return __method.apply(object, arguments);
  }
}

Or is there some reason this simpler version would not work?

Thanks,

-- 
Raul
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to