Skip to content
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

Fix race condition in embed.js #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

daoshengmu
Copy link

Resolve #126 race condition issue.

@greggman
Copy link
Contributor

greggman commented Jan 6, 2017

It might depend on the browser? I'm not sure what exactly that race is. There's another race in loader.js . These 2 lines

injectScript("dependencies/syntaxhighlighter_3.0.83/shCore.js", injectState);
injectScript("dependencies/syntaxhighlighter_3.0.83/shBrushGLSL.js", injectState);

Since the scripts load async and the second one requires the first to already be loaded if they happen to load in the opposite order then it fails. That is fixed by the AMD loader since dependencies can be more explicit.

There's also a few circular dependencies which AFAICT are most ok (the aren't used until both loaded) but it would probably be good to remove the circles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants