fix a bunch of JS warnings on startup

RESOLVED FIXED in Firefox 20

Status

()

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: heycam, Assigned: heycam)

Tracking

(Blocks 1 bug)

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

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Assignee

Description

7 years ago
Posted patch patchSplinter Review
There are a "did you mean = instead of ==" and "argument/variable name redeclaration" warnings at startup.
Attachment #693237 - Flags: review?(gavin.sharp)
Comment on attachment 693237 [details] [diff] [review]
patch

>--- a/browser/components/sessionstore/src/SessionStore.jsm
>+++ b/browser/components/sessionstore/src/SessionStore.jsm
>@@ -1274,7 +1274,7 @@ let SessionStoreInternal = {
>     // we need to reset that state. If the tab was restoring, we will attempt to
>     // restore the next tab.
>     let previousState;
>-    if (previousState = browser.__SS_restoreState) {
>+    if ((previousState = browser.__SS_restoreState)) {
>       this._resetTabRestoringState(aTab);
>       if (previousState == TAB_STATE_RESTORING)
>         this.restoreNextTab();

write this instead:

let previousState = browser.__SS_restoreState;
if (previousState) {

>--- a/toolkit/mozapps/update/nsUpdateService.js
>+++ b/toolkit/mozapps/update/nsUpdateService.js
>@@ -3622,9 +3622,9 @@ Downloader.prototype = {
>         LOG("Downloader:onStopRequest - verification of patch failed, " +
>             "downloading complete update patch");
>         this._update.isCompleteUpdate = true;
>-        var status = this.downloadUpdate(this._update);
>+        var updateStatus = this.downloadUpdate(this._update);
> 
>-        if (status == STATE_NONE) {
>+        if (updateStatus == STATE_NONE) {
>           cleanupActiveUpdate();
>         } else {
>           allFailed = false;

use 'let' rather than 'var'
Attachment #693237 - Flags: review?(gavin.sharp) → review+
Assignee

Comment 2

7 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/18e8cb967f00
Assignee: nobody → cam
Status: NEW → ASSIGNED
Version: unspecified → Trunk
https://hg.mozilla.org/mozilla-central/rev/18e8cb967f00
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 20

Updated

7 years ago
Blocks: fx-noise
You need to log in before you can comment on or make changes to this bug.