-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yuicompressor spits out 76 errors when minfying pdf.js #710
Comments
Working with some other compression tools, it turns out that the Could this be the case here as well? |
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 Note: the first hunk is not needed. i.e removing double vim modeline and 'use strict' |
@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 |
about [1], private is mentionned as a reserved future keyword though 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." 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. |
ES3 had a longer list of FutureReservedWords |
I go t "Compilation produced 88 syntax errors." from yuicompressor-2.4.7.jar and commit 7859ef0 |
@nateklaiber, Google Closure Compiler actually works if you add the argument |
- Fixed build so that all files are compressed using yuicompressor, except pdf.js that needs to use jsmin due to pdf.js issue mozilla/pdf.js#710 - Moved from Alfresco namespace to ShareExtras namespace where apporiate - Added copyright headers and js doc comments - Moved pdf.js external library client side components to its own subdirectory
- Fixed build so that all files are compressed using yuicompressor, except pdf.js that needs to use jsmin due to pdf.js issue mozilla/pdf.js#710 - Moved from Alfresco namespace to ShareExtras namespace where apporiate - Added copyright headers and js doc comments - Moved pdf.js external library client side components to its own subdirectory
- Fixed build so that all files are compressed using yuicompressor, except pdf.js that needs to use jsmin due to pdf.js issue mozilla/pdf.js#710 - Moved from Alfresco namespace to ShareExtras namespace where apporiate - Added copyright headers and js doc comments - Moved pdf.js external library client side components to its own subdirectory
The YUI compressor depends on a modified version of Mozilla’s old Rhino JavaScript runtime, which only supports ES3, and |
Well, I tried to minified the pdf.js with yuicompressor (2.4.6) and it fails with reporting like 76 syntax errors.
What else could I use that does not throw erros like this ?
may be you could fix pdf.js so that it please a little bit more yuicompressor ?
The text was updated successfully, but these errors were encountered: