Closed Bug 1508175 Opened 6 years ago Closed 6 years ago

ReferenceError: assignment to undeclared variable windowToInheritFrom mailTabs.js:76

Categories

(Thunderbird :: Toolbars and Tabs, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 65.0

People

(Reporter: aceman, Assigned: darktrojan)

References

Details

Attachments

(1 file)

Today I suddenly get "ReferenceError: assignment to undeclared variable windowToInheritFrom mailTabs.js:76" just by starting TB.

Looks like this hunk in the patch from bug 1498041 is the culprit:
https://hg.mozilla.org/comm-central/rev/c680423af71f9cc93a50876c0218967b85a8995b

-      openFirstTab: function(aTab) {
+      openFirstTab(aTab) {
         this.openTab(aTab, true, new MessagePaneDisplayWidget(), true);
         // persistence and restoreTab wants to know if we are the magic first tab
         aTab.firstTab = true;
         // Inherit the search mode from a window
-        let windowToInheritFrom = null;
         if (window.opener &&
             (window.opener.document.documentElement.getAttribute("windowtype") ==
              "mail:3pane"))
           windowToInheritFrom = window.opener;
         else
           windowToInheritFrom = FindOther3PaneWindow();

Why is the declaration removed? It seems the variable isn't used anywhere, so the whole block setting it could be removed. But this needs verification in the code history.
Why didn't the linter find this? Assignment to a now undeclared variable?
I've got that rule turned off in this folder for now, because there's still 1600 errors to fix for it, almost all stuff that's included from another file.

I've got a fix for this, I'm just checking why the use of the variable went away.
Okay, it was intentionally removed in https://hg.mozilla.org/comm-central/diff/1e333d47863d/mail/base/content/mailTabs.js . If only we'd had linting in 2010…
Attached patch 1508175-1.diffSplinter Review
Attachment #9025963 - Flags: review?(acelists)
Comment on attachment 9025963 [details] [diff] [review]
1508175-1.diff

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

Thanks.
Attachment #9025963 - Flags: review?(acelists) → review+
Pushed by acelists@atlas.sk:
https://hg.mozilla.org/comm-central/rev/2dd62f4bcac3
Stop assigning to undeclared, unused variable windowToInheritFrom. r=aceman
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 65.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: