Closed Bug 1670972 Opened 4 years ago Closed 3 years ago

defineLazyPreferenceGetter should throw on debug builds if the type of defaultValue mismatches with the preference type

Categories

(Core :: XPConnect, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: jaws, Assigned: jaws)

References

Details

Attachments

(2 files)

I've run in to this mistake before while writing patches, providing the wrong type for the default value due to some refactoring.

In debug builds, we could throw if there is a mismatch so we can catch these types of errors before code gets to release.

Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9874086b7526
Throw an exception if the default value provided to defineLazyPreferenceGetter doesn't match the prefType. r=kmag
https://hg.mozilla.org/integration/autoland/rev/ee63d9126cd8
Fix default value preference type mismatches with calls to defineLazyPreferenceGetter. r=vbudhram,markh,tjr
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: