W3C home > Mailing lists > Public > public-html@w3.org > March 2008

Re: Comments on Timers

From: liorean <liorean@gmail.com>
Date: Mon, 10 Mar 2008 20:37:25 +0100
Message-ID: <cee13aa30803101237g73ce28c9xf7c6d88aacd94476@mail.gmail.com>
To: "HTML WG" <public-html@w3.org>

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

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:53 UTC