-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Replace var with let in examples #484
Conversation
store-collected-images/webextension-plain/deps/uuidv4.js
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.
Hi @rebloor, I just took a look (to the diffs, I haven't expanded the context of all of them) and most of them looks ok, only two changes highlighted in the inline review comments below seems something that should be reverted.
@@ -41,7 +41,7 @@ module.exports = { | |||
}, | |||
plugins: [ | |||
// Since some NodeJS modules expect to be running in Node, it is helpful | |||
// to set this environment var to avoid reference errors. | |||
// to set this environment let to avoid reference errors. |
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 changed, the inline comment refers to OS environment variables.
@@ -4,7 +4,7 @@ | |||
} else if (typeof exports !== "undefined") { | |||
factory(exports); | |||
} else { | |||
var mod = { | |||
let mod = { |
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.
I think anything that is third party dependency for a webextensions-example (as in "coming from an outside repo") should be kept out of this change and left unmodified (and as a side note this part is not even part of that library, it is actually code injected automatically as part of the bundling).
@rpl thank you, I have reverted those changes. |
Summary
This change replaces the use of the
var
withlet
in the examples. This addresses the requirement identified in "Replace var with let in code snippets and examples" #11343 (which in turn was originally identified in discussions on "Use const in place of var" #11135).After completing the global search and replace, a selection of examples was loaded and tested (approximately 10). Only store-collected-images was found to have issues, which were corrected by reverting the replace of
var
withlet
in store-collected-images/webextension-plain/deps/uuidv4.js