WebGL-Inspector
WebGL-Inspector copied to clipboard
Fix race condition in embed.js
Resolve #126 race condition issue.
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