yui / yuicompressor

YUI Compressor
http://yui.github.com/yuicompressor/
Other
3.01k stars 664 forks source link

Getter and Setter function names changing incorrectly #206

Open ghost opened 9 years ago

ghost commented 9 years ago

Currently debugging an issue in the minified Eclipse Paho Javascript library: http://download.eclipse.org/paho/1.0/paho.javascript-1.0.1.zip

In the original code we have some getters and setters i.e.

get payloadBytes() { return this._getPayloadBytes(); },

When put through the yuicompressor it results in:

get payloadBytesfunction() {
            return this._getPayloadBytes()
        },

However when using this object the function names have not been changed:

var F = this.payloadMessage.payloadBytes;
                K += F.byteLength;

I checked the same script with closure and JSmin and they seem to give the correct output:

Closure Compressed:

get payloadBytes() { 
            return this._getPayloadBytes() 
}, 

JSmin Compressed:

get payloadBytes() { 
            return this._getPayloadBytes(); 
}, 

Any ideas why YUICompressor breaks it?

pratickchokhani commented 8 years ago

Facing the same issue. Can someone help. Urgent.

ChrisWiGit commented 8 years ago

Also having the same problem on my pages. I'm using a lot of read only properties (getters).

znap026 commented 8 years ago

Also having this issue!