On Thursday 2014-03-20 13:38 -0400, Irving Reid wrote:
> In a way we're dancing around competing footguns here - do we
> protect against bad code trying to break our preferences by setting
> a value to the wrong type, or do we protect against a broken
> preference messing up our code because we can't recover from a wrong
> type?

It seems possible to fix both problems (for prefs with values in a
default preferences file) by making the pref code refuse to set a
preference to a type other than the one in the default preferences
file.  If the set were in a user preferences file, it would just be
ignored; if it were in a set*Pref call, it would throw an exception.

Whether this is worth the work or the (probably not huge, but also
nonzero) compatibility risk is another question.

[ Written on an airplane; sorry if I missed responses in the last 11
hours. ]

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Attachment: signature.asc
Description: Digital signature

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to