You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
yuicompressor spits out 76 errors when minfying pdf.js #710
Working with some other compression tools, it turns out that the get foo() and set foo() syntax, that we use for some properties, can't get minified/handled by compressors.
Note: the first hunk is not needed. i.e removing double vim modeline and 'use strict'
yuicompressor choke on line 13972 and I replaced all instances of private, I don't know if it's needed/correct.
Just double check before applying, please :-)
I'm wondering why things like 'private', 'char', 'byte' cause problems with yuicompressor. They aren't JS reserved words [1], so it should be all fine to use them.
My feeling is we shouldn't change our code due to some software, that doesn't seem to do what it should do.
@solsticedhiver, have you tried other compressors? Does they have problems as well? Is there a particular reason to use yuicompressor or is it just your flavor compressor?
about [1], private is mentionned as a reserved future keyword though
But even in that case properties.private is stil legal if I understand correctly the last paragraph on "Reserved Word usage"
yuicompressor is the one I have installed here. I was not going to use an online one with a 1MB file, was I ?
"My feeling is we shouldn't change our code due to some software, that doesn't seem to do what it should do."
Yes, I agree.
But that's not a big change either. Just some basic refactoring.
yuicompressor might have thought it's better to flag those words because they might be reserved in some implementations, From what I read http://javascript.about.com/od/reference/g/rbyte.htm I don't know what standards they talk about. but not a recent one I think...
May be one need to open a bug report against yuicompresor ??
For what it's worth, Google Closure Compiler fails when trying to minify, and I received an exception when using YUI compressor. I haven't found anything that will work to minify pdf.js, even though it's recommended.
@nateklaiber, Google Closure Compiler actually works if you add the argument --language_in=ECMASCRIPT5 (and results in excellent compression: 737856 (min) / 1248019 (orig) = 0.591)
Activity
jviereck commentedon Oct 28, 2011
Working with some other compression tools, it turns out that the
get foo()andset foo()syntax, that we use for some properties, can't get minified/handled by compressors.Could this be the case here as well?
solsticedhiver commentedon Oct 28, 2011
No. It does not seem to like the variable called 'char' or 'byte' and some property named 'private'
the patch remove the "syntax errors" found by yuicompressor
https://gist.github.com/1322918
Note: the first hunk is not needed. i.e removing double vim modeline and 'use strict'
yuicompressor choke on line 13972 and I replaced all instances of private, I don't know if it's needed/correct.
Just double check before applying, please :-)
jviereck commentedon Oct 28, 2011
@solsticedhiver, thanks for providing this!
I'm wondering why things like 'private', 'char', 'byte' cause problems with yuicompressor. They aren't JS reserved words [1], so it should be all fine to use them.
My feeling is we shouldn't change our code due to some software, that doesn't seem to do what it should do.
@solsticedhiver, have you tried other compressors? Does they have problems as well? Is there a particular reason to use yuicompressor or is it just your flavor compressor?
[1] https://developer.mozilla.org/en/JavaScript/Reference/Reserved_Words
solsticedhiver commentedon Oct 28, 2011
about [1], private is mentionned as a reserved future keyword though
But even in that case properties.private is stil legal if I understand correctly the last paragraph on "Reserved Word usage"
yuicompressor is the one I have installed here. I was not going to use an online one with a 1MB file, was I ?
"My feeling is we shouldn't change our code due to some software, that doesn't seem to do what it should do."
Yes, I agree.
But that's not a big change either. Just some basic refactoring.
yuicompressor might have thought it's better to flag those words because they might be reserved in some implementations, From what I read http://javascript.about.com/od/reference/g/rbyte.htm I don't know what standards they talk about. but not a recent one I think...
May be one need to open a bug report against yuicompresor ??
nateklaiber commentedon Dec 22, 2011
For what it's worth, Google Closure Compiler fails when trying to minify, and I received an exception when using YUI compressor. I haven't found anything that will work to minify pdf.js, even though it's recommended.
sayrer commentedon Dec 22, 2011
ES3 had a longer list of FutureReservedWords
shenzhuxi commentedon Feb 9, 2012
I go t "Compilation produced 88 syntax errors." from yuicompressor-2.4.7.jar and commit 7859ef0
jcheng5 commentedon Feb 21, 2012
@nateklaiber, Google Closure Compiler actually works if you add the argument
--language_in=ECMASCRIPT5(and results in excellent compression: 737856 (min) / 1248019 (orig) = 0.591)Preparing for merge with Media Previews project
Preparing for merge with Media Previews project
Preparing for merge with Media Previews project
ExE-Boss commentedon Jun 17, 2024
The YUI compressor depends on a modified version of Mozillaâs old Rhino JavaScript runtime, which only supports ES3, andÂ
char,byte,private, and others are reserved keywords in ES3.