JS: migrate from the global window
to globalThis
As of mozjs68 (gjs-1.64) `globalThis` is recommended over `window` and it makes more sense in this context anyways. Migrate the few instances of `window` we use and adjust the eslint configuration. `window` will continue to resolve to `globalThis`, so this won't affect extensions or other downstream users. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2322 closes #2322
This commit is contained in:
@ -37,8 +37,8 @@ const LG_ANIMATION_TIME = 500;
|
||||
|
||||
function _getAutoCompleteGlobalKeywords() {
|
||||
const keywords = ['true', 'false', 'null', 'new'];
|
||||
// Don't add the private properties of window (i.e., ones starting with '_')
|
||||
const windowProperties = Object.getOwnPropertyNames(window).filter(
|
||||
// Don't add the private properties of globalThis (i.e., ones starting with '_')
|
||||
const windowProperties = Object.getOwnPropertyNames(globalThis).filter(
|
||||
a => a.charAt(0) != '_'
|
||||
);
|
||||
const headerProperties = JsParse.getDeclaredConstants(commandHeader);
|
||||
|
Reference in New Issue
Block a user