Closed Bug 1108168 Opened 10 years ago Closed 10 years ago

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

Categories

(Firefox :: Search, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 37

People

(Reporter: WeirdAl, Assigned: WeirdAl)

Details

(Whiteboard: debugging-noise)

Attachments

(1 file, 1 obsolete file)

Attached patch nsSearchService.js (obsolete) — Splinter Review
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-
Whoops, I clearly meant aDefault!  Yes, the try... catch can go away.
Attachment #8532744 - Attachment is obsolete: true
Attachment #8533306 - Flags: review?(dao)
Attachment #8533306 - Flags: review?(dao) → review+
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)
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/mozilla-central/rev/ebad1dd6ac40
Status: NEW → RESOLVED
Closed: 10 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.

Attachment

General

Created:
Updated:
Size: