I have private function createSomething():
function Player(id) {
/**
* Creates stuff
* @private
*/
this.createSomething = function() {
// do something good
};
}
and I want to see the renamed function "createSomething()" after compiling the source with Google Closure Compiler. Yes, I know about ADVANCED_OPTIMIZATIONS but it is incompatible with jQuery and other libraries.
Just use without this
The solution is to use a string literal to refer to the property.
This works because the compiler never renames string literals. But be careful.
You can compile your code with ADVANCED_OPTIMIZATIONS and still have you compatibility with other libraries. You'll need to read about externs and exports in the library documentation: