Closed guybedford closed 10 years ago
Closing this, as it isn't a primary issue.
All the same I'd like to track down the bug, so I'm reopening.
I doubled checked the cause of this and I can confirm it is actually not related at all to #85.
It turns out I had a bad loop in addLoadToLinkSet, which was actually causing this.
I corrected this along with the other changes, so had to recheck to see this was the underlying cause.
I don't know how to track this down, but it seems like the implementation of loadingCount in this sample implementation ends up being incorrect in some scenarios.
Specifically when two modules are imported at the same time, with shared dependencies:
This seems to have something to do with the
loadingCount
value not being reduced for the duplicated dependency at the right time.It's difficult to know if this is just my code, or the algorithm itself, so I apologise in advance if it turns out this is something I'm missing.
Changing the detection to loop through the loads checking their
loaded
status as in the specification completely fixes the problem though.