Closed Bug 816551 Opened 12 years ago Closed 12 years ago

PluginHelper._getBindingType doesn't always return a value

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 20

People

(Reporter: kats, Assigned: kats)

References

Details

Attachments

(1 file)

Seen in logcat on Fennec startup:

11-29 19:18:17.028 E/GeckoConsole( 1697): [JavaScript Warning: "TypeError: anonymous function does not always return a value" {file: "chrome://browser/content/browser.js" line: 5920 column: 8 source: "        return "PluginNotFound";
11-29 19:18:17.028 E/GeckoConsole( 1697): "}]
11-29 19:18:17.028 E/GeckoConsole( 1697): [JavaScript Warning: "TypeError: anonymous function does not always return a value" {file: "chrome://browser/content/browser.js" line: 5922 column: 8 source: "        return "PluginClickToPlay";
11-29 19:18:17.028 E/GeckoConsole( 1697): "}]
11-29 19:18:17.036 E/GeckoConsole( 1697): [JavaScript Warning: "TypeError: anonymous function does not always return a value" {file: "chrome://browser/content/browser.js" line: 5924 column: 8 source: "        return "PluginPlayPreview";
11-29 19:18:17.036 E/GeckoConsole( 1697): "}]
11-29 19:18:17.036 E/GeckoConsole( 1697): [JavaScript Warning: "TypeError: anonymous function does not always return a value" {file: "chrome://browser/content/browser.js" line: 5927 column: 8 source: "        return;
11-29 19:18:17.036 E/GeckoConsole( 1697): "}]
We can change _getBindingType to return an empty string where it currently returns nothing:
http://mxr.mozilla.org/mozilla-central/source/mobile/android/chrome/content/browser.js#5934

Also, the warnings mention that this is an anonymous function. kats, I thought you said that the JS engine is smart enough now to give more useful messages for anonymous functions that are properties of objects. Is that just true for a different case?
Whiteboard: [mentor=margaret][lang=js]
(In reply to Margaret Leibovic [:margaret] from comment #1)
> Also, the warnings mention that this is an anonymous function. kats, I
> thought you said that the JS engine is smart enough now to give more useful
> messages for anonymous functions that are properties of objects. Is that
> just true for a different case?

According to bug 805904, the JS engine can only infer names in some cases, unfortunately.
FWIW the desktop fix for this was to return null (see bug 814383). We should really factor this code out into a JS module reusable by both fennec and firefox...
Sorry, this is annoying me too much, and makes it harder to spot any other warnings that might crop up on startup.
Assignee: nobody → bugmail.mozilla
Whiteboard: [mentor=margaret][lang=js]
Attached patch PatchSplinter Review
Attachment #691976 - Flags: review?(margaret.leibovic)
Attachment #691976 - Flags: review?(margaret.leibovic) → review+
https://hg.mozilla.org/mozilla-central/rev/fb65298e7117
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: