-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Set __moduleName from context.id argument #6688
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
Conversation
Hi @guybedford, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
@guybedford, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
👍, looks like we have two unit tests that need to be updated. |
I think this variable has to be injected after the prologue directive "use strict" |
writeLine(); | ||
increaseIndent(); | ||
write(`var __moduleName = ${contextObjectForFile}.id;`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be var __moduleName = ${contextObjectForFile} && ${contextObjectForFile}.id;
to avoid breaking users of older JSPM versions.
7d11859
to
793da33
Compare
Thanks, I've made these corrections. |
@guybedford can you please fix two remaining failing tests so we can pull in this PR? |
793da33
to
16c4fa3
Compare
16c4fa3
to
94fe3e0
Compare
@vladima sure I've got them passing now. |
Set __moduleName from context.id argument
thanks! |
@vladima can you merge this in release-1.8 as well. |
Set __moduleName from context.id argument
👍 Thanks for all the help getting this in. |
This resolves #6359 using the method suggested by @vladima as the replacement to the original PR at #6098.
This context object is described at https://github.com/ModuleLoader/es6-module-loader/wiki/System.register-Explained#how-it-works, and was considered more extensible for future spec changes than a string second argument directly.