Closed Bug 820623 Opened 12 years ago Closed 12 years ago

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

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 20

People

(Reporter: kats, Assigned: mfinkle)

References

Details

Attachments

(1 file)

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.
Attached 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: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: