Closed Bug 1834595 Opened 1 year ago Closed 1 year ago

Improve readability, clarity, and documentation of defineLazyPreferenceGetter

Categories

(Core :: XPConnect, task)

task

Tracking

()

RESOLVED FIXED
115 Branch
Tracking Status
firefox115 --- fixed

People

(Reporter: nordzilla, Assigned: nordzilla)

Details

Attachments

(1 file)

I recently ran into an issue where I was confused about the parameter aDefaultValue in defineLazyPreferenceGetter.

I assumed this should be the default value of the overall return type from the getter, i.e. after applying aTransform.

However, this parameter should be the default value of the raw preference, before applying aTransform.

The documentation and variable names aren't really clear to me, so this patch will improve that for future users of this functionality.

Improves the clarity of defineLazyPreferenceGetter by resolving
ambiguity around the intended type of parameter aDefaultValue

Pushed by enordin@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a1a0bde11b7e
Improve clarity of defineLazyPreferenceGetter r=kmag
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 115 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: