nsSearchService's getBoolPref triggers exceptions (and catches them), which is noisy for debuggers

RESOLVED FIXED in Firefox 37

Status

()

Firefox
Search
RESOLVED FIXED
3 years ago
8 months ago

People

(Reporter: WeirdAl, Assigned: WeirdAl)

Tracking

Trunk
Firefox 37
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: debugging-noise)

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

3 years ago
Created attachment 8532744 [details] [diff] [review]
nsSearchService.js

Our company's XUL app, run with firefox --app, doesn't have a lot of search preferences defined.
Attachment #8532744 - Flags: review?(gavin.sharp)
Comment on attachment 8532744 [details] [diff] [review]
nsSearchService.js

> function getBoolPref(aName, aDefault) {
>+  if (Services.prefs.getPrefType(aName) != Ci.nsIPrefBranch.PREF_BOOL)
>+    return aName;
>   try {
>     return Services.prefs.getBoolPref(aName);
>   } catch (ex) {
>     return aDefault;
>   }
> }

Returning aName doesn't seem to make any sense. Also, with this check added, the try/catch can go away, right?
Attachment #8532744 - Flags: review?(gavin.sharp) → review-
(Assignee)

Comment 2

3 years ago
Whoops, I clearly meant aDefault!  Yes, the try... catch can go away.
(Assignee)

Comment 3

3 years ago
Created attachment 8533306 [details] [diff] [review]
nsSearchService.js.diff
Attachment #8532744 - Attachment is obsolete: true
Attachment #8533306 - Flags: review?(dao)

Updated

3 years ago
Attachment #8533306 - Flags: review?(dao) → review+
(Assignee)

Comment 4

3 years ago
Comment on attachment 8533306 [details] [diff] [review]
nsSearchService.js.diff

I presume the code for search is fairly well tested...
Attachment #8533306 - Flags: checkin?(dao)

Updated

3 years ago
Keywords: checkin-needed
OS: Mac OS X → All
Hardware: x86 → All
can we get a try run for this change, thanks!
Flags: needinfo?(ajvincent)
Keywords: checkin-needed
Attachment #8533306 - Flags: checkin?(dao)
https://hg.mozilla.org/integration/fx-team/rev/ebad1dd6ac40
https://hg.mozilla.org/mozilla-central/rev/ebad1dd6ac40
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 37
Flags: needinfo?(ajvincent)
You need to log in before you can comment on or make changes to this bug.