Open sronnlund opened 8 years ago
Unfortunately, this is part of the public API and cannot be changed at this point. Also, people still use YUI Compressor?!
I think a workaround could be to use bracket notation instead of dot notation for the goto
property. And you're right, "people" don't really use YUI Compressor nowadays. However, it's sometimes bundled with enterprise CMSs, for instance. My current client uses Adobe Experience Manager, which (unfortunately) uses YUI Compressor under the hood.
Haha, YUI Compressor seems to have some serious issues with getters and setters...
/* Source */
var foo = {
get bar() {
return 'foobar';
}
}
/* YUI Compressor output */
var foo={get barfunction(){return"foobar"}};
Yes. It renames bar
to barfunction
. Why it does this is beyond me. My brain hurts and my eyes are bleeding... :(
Seems issue with getters and setters was fixed in the latest version of YUI Compressor (2.4.8).
LOL, wow. Why not use UglifyJS which is way more updated and doesn't have such issues?
Don't shoot the messenger! Tell that to Adobe... It's really a pain when an enterprise CMS bundles and enforces tools and libraries that can't be easily replaced. AEM also bundles (and depends on) a pretty outdated version of jQuery, which can also be quite troublesome. I don't know what they are thinking, since web technologies evolve much faster than their CMS.
That sucks. I feel ya. :(
FYI: YUI Compressor (2.4.8 - including, but not limited to) breaks when using reserved words as property names. The word
goto
is a "future reserved keywords in older standards", and is therefore not allowed by YUI Compressor. Be on the safe side and avoid using reserved (or previously reserved) words.Thanks for making this awesom´ library!
Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar