Type the event and observer entry points in SessionStore.sys.mjs
Categories
(Firefox :: Session Restore, task)
Tracking
()
| 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.
| Assignee | ||
Comment 1•2 months ago
|
||
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.
Updated•2 months ago
|
Comment 3•2 months ago
|
||
| bugherder | ||
Updated•1 month ago
|
Description
•