You are not passing an array but a string instead. You can't use apply
with anything that is not an array or arguments object. Use
fn.apply(this, Array.from(object)) - in your example the expected
behavior is to call the function with "dir" as first argument, so you
might as well wanna use fn.call(this, dir);

Anyone can edit the upgrading guide and add more information.

On Oct 13, 12:10 am, Oskar Krawczyk <[email protected]> wrote:
> I stand corrected.
>
> On 2010-10-13, at 00:05, Sean McArthur wrote:
>
>
>
>
>
>
>
> > I think cause `arguments` is (and was?) supposed to be an array. when 
> > switch to pass an array in your fiddle, it worked.
>
> > On Tue, Oct 12, 2010 at 3:02 PM, Oskar Krawczyk <[email protected]> 
> > wrote:
> > The docs state:
>
> > Replacement example
>
> > fn.apply(thisArg, arguments); // Old API: fn.run(arguments, thisArg);
> > I'm trying this, here:http://www.jsfiddle.net/oskar/KWvA3/
>
> > But all I get is the following error: "Uncaught TypeError: 
> > Function.prototype.apply: Arguments list has wrong type"
>
> > Can someone shed some light on this situation, please?

Reply via email to