Closed Bug 2064159 Opened 6 days ago Closed 1 day ago

Drop the indentation-preserving block from Tabbrowser.sys.mjs

Categories

(Firefox :: Tabbed Browser, task)

task

Tracking

()

RESOLVED FIXED
156 Branch
Tracking Status
firefox156 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Tabbrowser.sys.mjs wraps almost its whole body in a bare block:

let Tabbrowser;
{
  ...
} // end of the indentation-preserving block
export { Tabbrowser };

A module's top level is private already, so the block provides no scope. It exists only to hold the indentation the file had as a window script, which is what let bug 2049770 land the move as a detectable rename with blame intact. Now that the move has landed, the level of nesting is pure cost: lines wrap two columns earlier than they need to.

Removing it is not a whitespace-only change. Two fewer spaces let prettier re-join lines that now fit in 80 columns: 52 hunks survive git diff -w, collapsing 169 lines into 60, and git blame -w cannot see through those. The remaining ~9000 lines are pure re-indentation and blame follows them.

The commit's SHA goes into .git-blame-ignore-revs and .hg-annotate-ignore-revs afterwards, since a commit can't carry its own SHA -- the same treatment bug 1128203's "Reduce indentation from 4 to 2 spaces" got.

With the block gone, let Tabbrowser; + Tabbrowser = class {...}; + export { Tabbrowser }; collapses into export class Tabbrowser {...}, and the module-private consts and TabProgressListener become plain module-scope declarations.

Not whitespace-only: two fewer columns let prettier re-join lines that now fit
in 80 columns. git diff -w isolates those as 49 hunks collapsing 180 lines
into 62; the rest is re-indentation that git blame -w follows.

The SHA goes into .git-blame-ignore-revs and .hg-annotate-ignore-revs in a
follow-up, since a commit can't carry its own SHA.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Blocks: 2064136
Keywords: leave-open
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/560af3c0b95a https://hg.mozilla.org/integration/autoland/rev/ad8a77424e8f Drop the indentation-preserving block from Tabbrowser.sys.mjs. r=tabbrowser-reviewers,jsudiaman
Keywords: leave-open
Status: ASSIGNED → RESOLVED
Closed: 1 day ago
Resolution: --- → FIXED
Target Milestone: --- → 156 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: