[Home] setTimeout() fires function twice? Firefox Bug?

After 7+ hours of listening to Crockford on JavaScript and some other lectures, I've decided to write my own JS Framework for a current project. As I'm working through various bits I discovered what appears to be a bug in Firefox 3.6.

This fires twice, unexpectedly:

function all(){

var promise = make_promise();
// Simulate async call from some source
setTimeout(function(){
promise.fulfill(fixture);
}, 3000);
return promise;
}

This fires just once, as expected:

function all(){

var promise = make_promise();
// Simulate async call from some source
function fulfill(){
promise.fulfill(fixture);
}
setTimeout(fulfill, 3000);
return promise;
}
blog comments powered by Disqus Updated at