Added option for mangling privates in code gen (all members prefixed with a single underscore)
Potentially unsafe, but was an easy add and I know a lot of people who want this, not only does it make the code even smaller (20% in my non-trivial use case) but it's also a nice to have feature if you want to make sure that nobody calls / accesses the stuff :)
Let me know what you think about it.
Best Ivo
I do a lot of code with Google Analytics functions, and these functions all start with an underscore. And while I'd like to have this feature I can't use this because that would mangle these methods as well.
Maybe add an option to mangle double underscores only ?
Some pitfalls in dbf2df3a45fbafaec7326eda060ee72dd7c8695e:
var foo = {}, bar = '_baz';
foo._baz = 42;
console.log('number' === typeof foo[bar]);
console.log(foo.hasOwnProperty('_baz'));
console.log(-1 !== Object.keys(foo).indexOf('_baz'));
with (foo) {
console.log('number' === typeof _baz);
}
Duplicate of issue #219.