STR: Launch LazyLoader.load for a set of script files. Launch LazyLoader.lad for the same set of files The second call will immediately return even if the scripts have not been loaded. The problem is in line https://github.com/mozilla-b2g/gaia/blob/master/shared/js/lazy_loader.js#L56 document.querySelector will return truthy even the file has not been loaded. As there is a variable _loading that maintains the scripts currently in loading, the querySelector is not really needed.
Comment on attachment 715157 [details] Pointer to GH PR This patch is fine until we do it in the proper way. I would like to see a patch for this use case though, so please add one or assign to me to add. Perhaps we will need to play with setTimeouts to test this? E.g., delay the first script from being loaded but not the second, then ensure that the second one loads after the first? Please either add a test - or assign to me and I will be more than happy to work on it if you are busy. Thanks!
with tests passing and updated as requested https://github.com/mozilla-b2g/gaia/commit/91c265fc9b1442c67c3abc3e39497c292412a09c
We need this bug to land in v1.0.1 and v1-train as it blocks bug 852036 which is tef+
Unable to run Launch LazyLoader.load for a set of script files. Launch LazyLoader.lad for the same set of files Tagging QARegressExclude
Can we get the tools to test this? Or can someone on TEF side verify this?