made scope test optional...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-12-15 05:08:06 +03:00
parent cdbdf130de
commit 4f3476ec1a
3 changed files with 18 additions and 16 deletions

View File

@ -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 }, {})} }
/*********************************************************************/

View File

@ -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 }, {})} }
/*********************************************************************/

View File

@ -31,7 +31,7 @@
<!-- Scripts -->
<!-- Global scope pollution test -->
<script>
<!--script>
var __window = {...window}
function scopeDiff(cur=window, base=__window){
return Object.keys(cur)
@ -40,7 +40,7 @@ function scopeDiff(cur=window, base=__window){
.reduce(function(res, k){
res[k] = cur[k]
return res }, {})}
</script>
</script-->
<!-- DevTools fail-safe for electron/nw... -->
<script>