-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Fix random failure when JS code is executed when the whole file was not read yet #142497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix random failure when JS code is executed when the whole file was not read yet #142497
Conversation
r? @notriddle rustbot has assigned @notriddle. Use |
Some changes occurred in HTML/CSS/JS. |
isn't it only the invitation of initSearch that needs to be moved to the bottom, not the definition? i guess both can be moved just for the sake of readability, but in either case, there should be a comment saying how nothing else should happen after |
Indeed but since the function was called right after being created, I just kept them together for coherency with current code. |
I do still believe there should be some comment at the bottom of the file saying how new code must be added before the call to |
Very good point, adding it. |
technically the comment should go after the definition of |
If the comment is just just after |
I'm actually running into this when trying to debug PRs, and it seems like a trivial fix, so I think it makes sense to move forward with this. |
Very randomly (and rarely), when I arrived on a page with
?search=something
in the URL, I got this error:Moving the
initSearch
function at the bottom to ensure everything has been loaded fixes the issue.PS: Sorry for the noise. Pushed to the wrong branch and #142496 closed. ><