Javascript warning on fennec startup (NativeWindow.menu.add)

RESOLVED FIXED in Firefox 20

Status

()

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: kats, Assigned: mfinkle)

Tracking

Trunk
Firefox 20
ARM
Android
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

12-11 18:51:43.166 E/GeckoConsole(14235): [JavaScript Warning: "TypeError: anonymous function does not always return a value" {file: "chrome://browser/content/browser.js" line: 1208 column: 6 source: "      return this._menuId - 1;

NativeWindow.menu.add has two return statements; one of which returns a value and the other does not.
Instead of returning nothing, we should throw an exception.
Posted patch patchSplinter Review
Replace the "return" with a "throw"
Assignee: nobody → mark.finkle
Attachment #691189 - Flags: review?(bugmail.mozilla)
Comment on attachment 691189 [details] [diff] [review]
patch

Review of attachment 691189 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with the typo fixed

::: mobile/android/chrome/content/browser.js
@@ +1199,5 @@
>              icon: arguments[1],
>              callback: arguments[2]
>            };
>        } else {
> +         Throw "Incorrect number of parameters";

Lowercase the 't' in throw. I believe it's case-sensitive.
Attachment #691189 - Flags: review?(bugmail.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/1b3ec53cab89
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
You need to log in before you can comment on or make changes to this bug.