Quantcast
Channel: ajaxmin Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 683

Reopened Issue: Problem with if and var definition within { } [18619]

$
0
0
I have the following code
 
if(typeof(MYVAR)==='undefined'){ var MYVAR= {};}
MYVAR.Something = -1;
var browName = navigator.appName;
var SiteID = 1;
var ZoneID = 1;
var browDateTime = (new Date()).getTime();
 
This code get minified into this
 
var MYVAR;typeof MYVAR=="undefined"&&(MYVAR={});MYVAR.Something=-1;var browName=navigator.appName,SiteID=1,ZoneID=799856,browDateTime=+new Date
 
Which is completely wrong the original if is used to create the variable when it does not exist, but the minifier is changing that behavior completely
Comments: ** Comment from web user: ronlo ** apparently I can't read dates very well.

Viewing all articles
Browse latest Browse all 683

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>