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

Convert the BasePreferences class to use private fields #14665

Merged
merged 2 commits into from
Mar 13, 2022

Conversation

Snuffleupagus
Copy link
Collaborator

@Snuffleupagus Snuffleupagus commented Mar 12, 2022

  • Convert the BasePreferences class to use private fields

    Given that none of these fields were ever intended to be accessed directly from the outside, since that will lead to inconsistent/broken state, we can use modern ECMAScript features to ensure that they are indeed private.

  • Revert Preferences to their previous values, when writing to storage failed

    This patch fixes an old inconsistency, when using BasePreferences.{reset, set}, where the internal Preference values would be kept even if writing them to storage failed.

Given that none of these fields were ever intended to be accessed directly from the *outside*, since that will lead to inconsistent/broken state, we can use modern ECMAScript features to ensure that they are indeed private.
@mozilla mozilla deleted a comment from pdfjsbot Mar 12, 2022
@mozilla mozilla deleted a comment from pdfjsbot Mar 12, 2022
@mozilla mozilla deleted a comment from pdfjsbot Mar 12, 2022
…failed

This patch fixes an old inconsistency, when using `BasePreferences.{reset, set}`, where the internal Preference values would be kept even if writing them to storage failed.
@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/9b66a2d767ea265/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_integrationtest from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/7cd533a946d4b4b/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/9b66a2d767ea265/output.txt

Total script time: 3.89 mins

  • Integration Tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.193.163.58:8877/7cd533a946d4b4b/output.txt

Total script time: 7.20 mins

  • Integration Tests: Passed

@timvandermeij timvandermeij merged commit dd4af1c into mozilla:master Mar 13, 2022
@timvandermeij
Copy link
Contributor

Looks good!

@Snuffleupagus Snuffleupagus deleted the Preferences-private branch March 13, 2022 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants