From 6df976d1f32db34c37c2dc267b85f2edcadeb94e Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 18 Jan 2021 23:53:24 +0100 Subject: [PATCH] :bug: Fix advanced compilation of util.globals ns. --- frontend/src/app/util/globals.js | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/frontend/src/app/util/globals.js b/frontend/src/app/util/globals.js index a4f5577f3..4c66efefe 100644 --- a/frontend/src/app/util/globals.js +++ b/frontend/src/app/util/globals.js @@ -21,22 +21,20 @@ goog.provide("app.util.globals"); goog.scope(function() { - var win; - if (typeof goog.global.window !== "undefined") { - win = goog.global.window; - } else { - win = {}; - } + app.util.globals.window = (function() { + if (typeof goog.global.window !== "undefined") { + return goog.global.window; + } else { + return {}; + } + })(); - app.util.globals.window = win; - - var loc; - if (typeof goog.global.location !== "undefined") { - loc = goog.global.location; - } else { - loc = {}; - } - - app.util.globals.location = loc; + app.util.globals.location = (function() { + if (typeof goog.global.location !== "undefined") { + return goog.global.location; + } else { + return {}; + } + })(); });