From 4f3476ec1a664313c5acb1cc3335e4a720c85665 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 15 Dec 2020 05:08:06 +0300 Subject: [PATCH] made scope test optional... Signed-off-by: Alex A. Naanou --- Viewer/e.js | 15 ++++++++------- Viewer/ig.js | 15 ++++++++------- Viewer/index.html | 4 ++-- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/Viewer/e.js b/Viewer/e.js index c0d05f99..7a9c4dca 100644 --- a/Viewer/e.js +++ b/Viewer/e.js @@ -9,13 +9,14 @@ **********************************************************************/ // Global scope pollution test... -global.__global = {...global} -global.scopeDiff = function(cur=global, base=__global){ - return Object.keys(cur) - .filter(function(k){ return base[k] !== cur[k] }) - .reduce(function(res, k){ - res[k] = cur[k] - return res }, {})} +if(process.env.IMAGEGRID_DEBUG){ + global.__global = {...global} + global.scopeDiff = function(cur=global, base=__global){ + return Object.keys(cur) + .filter(function(k){ return base[k] !== cur[k] }) + .reduce(function(res, k){ + res[k] = cur[k] + return res }, {})} } /*********************************************************************/ diff --git a/Viewer/ig.js b/Viewer/ig.js index 404c07eb..80342b8f 100755 --- a/Viewer/ig.js +++ b/Viewer/ig.js @@ -9,13 +9,14 @@ //var DEBUG = DEBUG != null ? DEBUG : true // Global scope pollution test... -global.__global = global.__global || {...global} -global.scopeDiff = function(cur=global, base=__global){ - return Object.keys(cur) - .filter(function(k){ return base[k] !== cur[k] }) - .reduce(function(res, k){ - res[k] = cur[k] - return res }, {})} +if(process.env.IMAGEGRID_DEBUG){ + global.__global = global.__global || {...global} + global.scopeDiff = function(cur=global, base=__global){ + return Object.keys(cur) + .filter(function(k){ return base[k] !== cur[k] }) + .reduce(function(res, k){ + res[k] = cur[k] + return res }, {})} } /*********************************************************************/ diff --git a/Viewer/index.html b/Viewer/index.html index b484ae02..6de9e757 100755 --- a/Viewer/index.html +++ b/Viewer/index.html @@ -31,7 +31,7 @@ - +