Below, you can see the output from these two logs. The first clearly shows the full object with the property I\'m trying to access, but on the very next line of code, I can\
I had the same issue today. Problem was caused by uglify-js. After I executed same non-uglified code problem was solved. Removing of
--mangle-props
from uglify-js was enough to have working uglified code.
Perhaps, the best practice is to use some prefix for properties that has to be mangled with regex rule for uglify-js.
Here is the source:
var data = JSON.parse( content);
...
this.pageIndex = parseInt(data.index);
this.pageTotal = parseInt(data.total);
this.pageLimit = parseInt(data.limit);
and here is how it was uglified:
var n = JSON.parse( t);
...
this._ = parseInt(n.index), this.g = parseInt(n.total), this.D = parseInt(n.C)