Properly instantiate inline module scripts #2604
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This moves the latter half of the "internal module script graph fetching
procedure" into "fetch the descendants of a module script", which is
then renamed "fetch the descendants of and instantiate a module script".
Then, the inline script code can properly call this new algorithm to
take care of everything once it has an initial module script prepared
from the inline script source.
Fixes #2544.
This is on top of #2595 so shouldn't be merged until that is.
Tests for this exist all over https://github.com/w3c/web-platform-tests/tree/master/html/semantics/scripting-1/the-script-element/module, since without it inline module scripts just don't work at all.
If you want to review this, review only the second commit. Also be aware that a lot of the diff is just moving text around, so it's not as big of a change as it seems.
A preview of this, along with #2595 and #2625, is at https://dl.dropboxusercontent.com/u/20140634/modules-all-better/index.html