Closed Bug 2074387 Opened 2 months ago Closed 2 months ago

Type the event and observer entry points in SessionStore.sys.mjs

Categories

(Firefox :: Session Restore, task)

task

Tracking

()

RESOLVED FIXED
159 Branch
Tracking Status
firefox159 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

handleEvent and observe read properties off the base Event, EventTarget and nsISupports types without narrowing to the event, tab, browser or window the branch handles, and pass the untyped target on to methods taking a MozTabbrowserTab or MozBrowser. Narrowing at the entry point, per event name or with a cast to the type the branch handles, lets the checker follow the branch bodies against the tab strip's element declarations. Roughly a quarter of the errors the module raises when it is put on the sessionstore TypeScript project.

The module stays on the exclude list in browser/components/sessionstore/tsconfig.json until the last of the bugs splitting this work up takes it off.

Blocks: 2074388

The cast back to nsISupports at notifyObservers is there because the generated DOM element typings declare no QueryInterface, so a typed browser fails the observer service's weak-type check.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED
Pushed by dgottwald@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/426c779d57e8 https://hg.mozilla.org/integration/autoland/rev/b47fce3dae28 Type the event and observer entry points in SessionStore.sys.mjs. r=sthompson,sessionstore-reviewers
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 159 Branch
QA Whiteboard: [qa-triage-done-c160/b159]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: