vscode icon indicating copy to clipboard operation
vscode copied to clipboard

`dom.ts#getFocusedWindow()` has a weird redundant check

Open bpasero opened this issue 7 months ago • 2 comments

https://github.com/microsoft/vscode/blob/496ebc4723371f29c9ffa0319dcccb2d7bee7ee0/src/vs/base/browser/dom.ts#L945-L952

Unless I am missing something: document.defaultView?.window.document === document. So whats the idea of using document.defaultView?.window in that method?

bpasero avatar May 21 '25 05:05 bpasero

Here's what I see when I make that substitution

Image

meganrogge avatar May 21 '25 19:05 meganrogge

@meganrogge I see, a suggested fix in https://github.com/microsoft/vscode/pull/249511

Next time, please feel free to just reach out to me to ask for advice, that lint rule is obviously not catching that scenario well.

bpasero avatar May 22 '25 05:05 bpasero