Skip to content
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

Move class fields into constructor to avoid Firefox add-on errors #124

Merged
merged 2 commits into from
Mar 21, 2021

Conversation

sharon-wang
Copy link
Member

@sharon-wang sharon-wang commented Mar 21, 2021

Defining class fields is invalid in older versions of JavaScript, which Firefox seems to test for in its add-on scanning. Moving the fields into the class's constructor avoids these errors. This resolves "Errors: Declaring class properties outside of the constructor." of #65.

Some minor refactoring to the constructors and fromObject() was done for better consistency.

Testing:

  • Firefox add-on scan: errors no longer reported/seen
  • Chromium-based browsers: no regressions

@sharon-wang sharon-wang requested a review from vezwork March 21, 2021 01:23
@sharon-wang sharon-wang changed the title Move class fields into constructor to avoid Firefox add-on errors Fix Firefox-specific errors Mar 21, 2021
@sharon-wang sharon-wang changed the title Fix Firefox-specific errors Move class fields into constructor to avoid Firefox add-on errors Mar 21, 2021
Defining class fields is invalid in older versions of JavaScript,
which Firefox seems to test for in its add-on scanning. Moving the
fields into the class's constructor avoids these errors.

Signed-off-by: sharon-wang <[email protected]>
Copy link
Member

@vezwork vezwork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm, tested in firefox and chrome without regressions, and submitted to the firefox addons store validation step without any errors. Sweet 🎉!

@vezwork vezwork merged commit 8baa99a into esse-dev:master Mar 21, 2021
@sharon-wang sharon-wang deleted the fixfirefoxerrors branch April 4, 2021 18:50
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