[polari] cleanup: Migrate from global 'window' to 'globalThis'



commit 5c275175c9bc804f28e7c32e0057ec4538a2a725
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Nov 14 02:14:51 2020 +0100

    cleanup: Migrate from global 'window' to 'globalThis'
    
    As of mozjs68, 'globalThis' is recommended over 'window', so
    switch to that.
    
    https://gitlab.gnome.org/GNOME/polari/-/merge_requests/167

 src/main.js | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/main.js b/src/main.js
index 28f845ca..b903ded6 100755
--- a/src/main.js
+++ b/src/main.js
@@ -2,7 +2,7 @@
 
 pkg.initFormat();
 pkg.initGettext();
-window.ngettext = imports.gettext.ngettext;
+globalThis.ngettext = imports.gettext.ngettext;
 
 pkg.require({
     'GdkPixbuf': '2.0',
@@ -45,12 +45,12 @@ function _makeLogFunction(level) {
     };
 }
 
-window.log      = _makeLogFunction(GLib.LogLevelFlags.LEVEL_MESSAGE);
-window.debug    = _makeLogFunction(GLib.LogLevelFlags.LEVEL_DEBUG);
-window.info     = _makeLogFunction(GLib.LogLevelFlags.LEVEL_INFO);
-window.warning  = _makeLogFunction(GLib.LogLevelFlags.LEVEL_WARNING);
-window.critical = _makeLogFunction(GLib.LogLevelFlags.LEVEL_CRITICAL);
-window.error    = _makeLogFunction(GLib.LogLevelFlags.LEVEL_ERROR);
+globalThis.log      = _makeLogFunction(GLib.LogLevelFlags.LEVEL_MESSAGE);
+globalThis.debug    = _makeLogFunction(GLib.LogLevelFlags.LEVEL_DEBUG);
+globalThis.info     = _makeLogFunction(GLib.LogLevelFlags.LEVEL_INFO);
+globalThis.warning  = _makeLogFunction(GLib.LogLevelFlags.LEVEL_WARNING);
+globalThis.critical = _makeLogFunction(GLib.LogLevelFlags.LEVEL_CRITICAL);
+globalThis.error    = _makeLogFunction(GLib.LogLevelFlags.LEVEL_ERROR);
 
 function main(args) {
     // Log all messages when connected to the journal


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]