Status: New
Owner: ----

New issue 892 by [email protected]: Function.prototype.bind calls the original using it's current .apply member rather than the internal [[Call]]
http://code.google.com/p/v8/issues/detail?id=892

function foo(){return [].slice.call(arguments,0).join(',');}
foo.apply = function(self,args) { alert('gotcha'); return Function.prototype.apply.call(this, self, args); }
var b = foo.bind(33,44)
b(55,66)
44,55,66

Function.prototype.bind should call foo's internal [[Call]] member, ignoring the current value of its .apply property (whether inherited or not).

In a browser this triggers the alert, demonstrating that bind calls apply. In a v8 shell, replacing alert with print also demonstrates the bug.

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to