Re: Comments on Timers

On 10/03/2008, Anne van Kesteren <annevk@opera.com> wrote:
>  * It should say whether the arguments... should be passed at the timeout
>  instantiation or in their current state. Consider the following example
>  for instance:
>
>    baz = 1;
>    setTimeout(foo,10,baz);
>    baz = 5;

Actually, ECMAScript makes the behaviour of that quite clear.
ECMAScript always sends values, never references, which means the
arguments to setTimeout will be whatever foo evaluates to, 10, and 1.
-- 
David "liorean" Andersson

Received on Monday, 10 March 2008 19:37:34 UTC