Bug 2004061 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

We can add the documentation above the `locked` property for both [Setting](https://searchfox.org/firefox-main/rev/6ef3d44ec645cc393300806684d11c6de0b302b0/toolkit/content/preferences/Setting.mjs#293-295) and [Preference](https://searchfox.org/firefox-main/rev/6ef3d44ec645cc393300806684d11c6de0b302b0/toolkit/content/preferences/Preference.mjs#276-278) classes.


Looks like the closest thing we already have documented is in this [modules/libpref/nsIPrefBranch.idl](https://searchfox.org/firefox-main/rev/6ef3d44ec645cc393300806684d11c6de0b302b0/modules/libpref/nsIPrefBranch.idl#243-258) file, which we can use as a base or maybe JSDoc-inherit from. Although mstreimer says that there has been some confusion around whether or not it's totally accurate.

mstreimer on slack:

> always return the default value regardless of whether there is a user set value or not.

I thought this was the case but I'm pretty sure there's still a way to have it with a non-default value. It might be that the user value is ignored, and the main pref branch value is returned. tbh I'm not 100% sure how the default value stuff works :sweat_smile: I was looking at checking default values before with someone and we were very confused about what it was saying was default or not
We can add the documentation above the `locked` property for both [Setting](https://searchfox.org/firefox-main/rev/6ef3d44ec645cc393300806684d11c6de0b302b0/toolkit/content/preferences/Setting.mjs#293-295) and [Preference](https://searchfox.org/firefox-main/rev/6ef3d44ec645cc393300806684d11c6de0b302b0/toolkit/content/preferences/Preference.mjs#276-278) classes.


Looks like the closest thing we already have documented is in this [modules/libpref/nsIPrefBranch.idl](https://searchfox.org/firefox-main/rev/6ef3d44ec645cc393300806684d11c6de0b302b0/modules/libpref/nsIPrefBranch.idl#243-258) file, which we can use as a base or maybe JSDoc-inherit from. Although mstriemer says that there has been some confusion around whether or not it's totally accurate.

mstriemer on slack:

> always return the default value regardless of whether there is a user set value or not.

I thought this was the case but I'm pretty sure there's still a way to have it with a non-default value. It might be that the user value is ignored, and the main pref branch value is returned. tbh I'm not 100% sure how the default value stuff works :sweat_smile: I was looking at checking default values before with someone and we were very confused about what it was saying was default or not

Back to Bug 2004061 Comment 1