The install.js script causes silly strict warnings

RESOLVED FIXED

Status

addons.mozilla.org Graveyard
Public Pages
--
trivial
RESOLVED FIXED
12 years ago
2 years ago

People

(Reporter: Gijs, Assigned: Gijs)

Tracking

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

12 years ago
As in summary. 1.8 branch build reports:

Warning: function install does not always return a value
Source File: https://addons.mozilla.org/js/install.js
Line: 64

Warning: assignment to undeclared variable aPlatform
Source File: https://addons.mozilla.org/js/install.js
Line: 24
(Assignee)

Comment 1

12 years ago
Created attachment 233349 [details] [diff] [review]
Patch

Shut up silly warnings.
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Attachment #233349 - Flags: first-review?(morgamic)
(Assignee)

Comment 2

12 years ago
Mike, how swamped are you, and/or is there anyone else I could ask review from? :-)
Attachment #233349 - Flags: first-review?(morgamic) → first-review+
Comment on attachment 233349 [details] [diff] [review]
Patch

Actually, bad idea.  I don't think it should return true by default.

Shouldn't the return false;  get taken out of the if() statement instead?
Attachment #233349 - Flags: first-review+ → first-review-
The install link is an href to the actual xpi file with an onClick to the install function. So, if they have JS disabled, it will still work.

Taking the return false; out of the if statement would cause the file not to be downloaded at all if for some reason the if() was not true.
Comment on attachment 233349 [details] [diff] [review]
Patch

Roger roger -- that's right ; it works.
Attachment #233349 - Flags: first-review- → first-review+
This has been checked in.  Will push with next update.  Thanks for submitting the patch.
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.