cujojs / poly

Small, fast, awesome. The only ES5-ish set of polyfills (shims) you can mix-and-match because they're individual modules.
Other
139 stars 18 forks source link

remove setTimeout from poly/setImmediate's tasks.runIfPresent #24

Open unscriptable opened 11 years ago

unscriptable commented 11 years ago

This code seems to need a general makeover. The requirement is to ensure the queue isn't processed while new tasks are being added. There has to be a better way to do this than a currentlyProcessing flag and a setTimeout().