-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[BUGFIX beta] Add back mainContext to loader #14859 #14860
Conversation
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.
Thanks for working on this! We need to bring back the line that was removed in the loader. If you can update then I'm happy to land this...
@@ -14,5 +14,4 @@ function checkElementIdShadowing(value) { | |||
export default checkGlobal(checkElementIdShadowing(typeof global === 'object' && global)) || | |||
checkGlobal(typeof self === 'object' && self) || | |||
checkGlobal(typeof window === 'object' && window) || | |||
mainContext || // set before strict mode in Ember loader/wrapper |
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.
Can you bring this back, and add it back to the correct location in loader.js
? The ESLint cleanup PR should not have removed it (and I missed that it did when I reviewed).
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.
Sorry about that. Can we add a comment to it this time describing what the unused variable does?
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.
And also add a // eslint-disable-next-line no-unused-vars
line before the mainContext definition in packages/loader/lib/index.js (even though no-unused-vars is globally off for now)
Still, i'm a bit puzzled by the global.js code... If mainContext is defined nowhere, the code will still fail. And if it is, the next line new Function('return this')()
will never run.
Would it make sense to replace mainContext
with (typeof mainContext === 'object' && mainContext)
?
Thank you! |
Fixing #14859
After the ESLint warning cleanup the
mainContext
is undefined and brake the ember-template-compiler.js compilation in grunt environment.This PR removes the rest of the
mainContext
reference from theglobal.js
.Previous conversation about this issue:
e24e403#diff-5b2ea89606fd2097e9e17d66ae54ed51L2
Opened issue in grunt-ember-templates repo: dgeb/grunt-ember-templates#94
cc @Turbo87 @andyhot