yahoo/express-yui — pull request #41 by clarle (2013-12-04 07:31:39+00:00)
Title: Fix early `flush()` issue, resolves #26

This problem was caused by two issues:

- The `pending` requests being set to 0 once `load()` was called again

- `decrementRequestPending` firing on every `onreadystatechange`
@scottschiller was correct - this was decremented on every request
as well as on every completion.

These two issues caused situations where `flush()` was called early,
since `pending` would drop to 0 or below even when there were still
pending requests that did not finish.

This issue actually was a bug in all other browsers as well, but did not
cause an error in browsers other than IE because they had the opportunity
to load YUI as the first script (since the `decrementRequestPending` bug
was a non-issue there).