Skip to content

standardize use of arrow functions, scoped vars and for loops where possible, content.js#41

Closed
yoroshikun wants to merge 1 commit intoalyssaxuu:masterfrom
yoroshikun:scoped-var-and-for-content
Closed

standardize use of arrow functions, scoped vars and for loops where possible, content.js#41
yoroshikun wants to merge 1 commit intoalyssaxuu:masterfrom
yoroshikun:scoped-var-and-for-content

Conversation

@yoroshikun
Copy link
Contributor

DO NOT MERGE WITHOUT CHECKING IF ALL FUNCTIONS WORK PLEASE
It is important to test this commit as there is some changes that might break things.

This commit only affects the content.js, I have done the following

  • Converted all function declarations to arrow functions where possible (some need for this var)
  • Swapped all variables with scoped ones (es6) standard, helps with reducing bugs as well
  • Converted where possible forEach loops to for (in) for readability and performance
    == to === as its safer to do a non loose equal, and we know we don't need loose

@marabesi
Copy link

I was thinking about adding some tests to the code base, this would potentially help such refactors. I can give a try on the test setup, what do you think @alyssaxuu ?

@yoroshikun yoroshikun closed this Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants