Got bitten by an odd FF phenomenon: setTimeout handler receives an optional argument #NewsToMe

7 May

… As explained here, in um 1999. https://bugzilla.mozilla.org/show_bug.cgi?id=10637 – applies to setInterval and setTimeout.

I had:

theFunc(true); // just call it once

theFunc(); // trigger it to repeat calling itself

function theFunc(initially) {
?? if (!initially) setTimeout(theFunc, 1000);
}

…. which worked fine in Chrome. But then FF it stopped repeating after some random number of iterations! And when I log "initially", I start finding initially is set to numbers like -2. Which turns out to be the lateness factor.

Advertisements

One Response to “Got bitten by an odd FF phenomenon: setTimeout handler receives an optional argument #NewsToMe”

  1. neonstalwart May 8, 2010 at 1:46 am #

    same thing happened to me a month ago http://neonstalwart.blogspot.com/2010/04/firefox-settimeout-lateness-argument.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: