Closed
Bug 758288
Opened 13 years ago
Closed 12 years ago
"Warning: function onKeyPress does not always return a value" for autocomplete.xml
Categories
(Firefox :: Address Bar, defect)
Firefox
Address Bar
Tracking
()
RESOLVED
FIXED
Firefox 21
People
(Reporter: dholbert, Assigned: florian)
References
()
Details
Attachments
(1 file)
908 bytes,
patch
|
enndeakin
:
review+
|
Details | Diff | Splinter Review |
Just noticed an 2 warning messages (for one underlying issue) in my error console that looked worth filing.
The errors are:
{
> Timestamp: 05/24/2012 10:29:26 AM
> Warning: function onKeyPress does not always return a value
> Source File: chrome://global/content/bindings/autocomplete.xml
> Line: 439, Column: 12
> Source Code:
> return false;
}
...and...
{
> Timestamp: 05/24/2012 10:29:26 AM
> Warning: function onKeyPress does not always return a value
> Source File: chrome://global/content/bindings/autocomplete.xml
> Line: 503, Column: 10
> Source Code:
> return true;
}
It looks like "onKeyPress" has both a naked "return;" statement as well as "return false" / "return true", which is why we're warning.
e.g: line 439 vs 443 here, from MXR:
> 433 <!-- ::::::::::::: key handling ::::::::::::: -->
> 434
> 435 <method name="onKeyPress">
> 436 <parameter name="aEvent"/>
> 437 <body><![CDATA[
> 438 if (aEvent.target.localName != "textbox")
> 439 return; // Let child buttons of autocomplete take input
> 440
> 441 //XXXpch this is so bogus...
> 442 if (aEvent.defaultPrevented)
> 443 return false;
https://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/autocomplete.xml#433
I'm setting this as blocking bug 407359, which added the naked "return" statement.
I don't know this code at all, but I'm guessing we want "return false" instead of "return"?
Assignee | ||
Comment 1•12 years ago
|
||
This warning also annoys me, and I don't know this code either. The patch I'm attaching follows the suggestion in comment 0, and I hope Neil will confirm if it's the right thing to do :).
Attachment #711350 -
Flags: review?(enndeakin)
Updated•12 years ago
|
Attachment #711350 -
Flags: review?(enndeakin) → review+
Assignee | ||
Comment 2•12 years ago
|
||
Comment 3•12 years ago
|
||
Assignee: nobody → florian
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 21
You need to log in
before you can comment on or make changes to this bug.
Description
•