Skip to content
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

YUI Compressor: Doesn't like IE Detection (cc_on) #55

Open
marczych opened this issue Oct 9, 2015 · 1 comment
Open

YUI Compressor: Doesn't like IE Detection (cc_on) #55

marczych opened this issue Oct 9, 2015 · 1 comment

Comments

@marczych
Copy link

marczych commented Oct 9, 2015

I'm having problems compressing filedrop.js using YUI Compressor:

[I]> java -jar yuicompressor-2.4.8.jar --type js --charset utf-8 filedrop.js
[ERROR] in filedrop.js
  568:66:missing } after property list
[ERROR] in filedrop.js
  569:11:syntax error
[ERROR] in filedrop.js
  573:14:syntax error
[ERROR] in filedrop.js
  577:12:syntax error
[ERROR] in filedrop.js
  578:4:syntax error
[ERROR] in filedrop.js
  603:10:syntax error
[ERROR] in filedrop.js
  1385:9:missing ) after argument list
[ERROR] in filedrop.js
  1385:10:syntax error
[ERROR] in filedrop.js
  1579:3:syntax error
[ERROR] in filedrop.js
  1590:10:syntax error
[ERROR] in filedrop.js
  1831:3:syntax error
[ERROR] in filedrop.js
  1834:10:syntax error
[ERROR] in filedrop.js
  1835:10:syntax error
[ERROR] in filedrop.js
  1849:10:syntax error
[ERROR] in filedrop.js
  2375:3:syntax error
[ERROR] in filedrop.js
  2385:10:syntax error
[ERROR] in filedrop.js
  2389:11:invalid return
[ERROR] in filedrop.js
  2390:3:syntax error
[ERROR] in filedrop.js
  2466:10:syntax error
[ERROR] in filedrop.js
  2467:8:syntax error
[ERROR] in filedrop.js
  2468:13:missing ; before statement
[ERROR] in filedrop.js
  2470:7:syntax error
[ERROR] in filedrop.js
  2471:44:missing ; before statement
[ERROR] in filedrop.js
  2476:7:syntax error
[ERROR] in filedrop.js
  2489:19:invalid return
[ERROR] in filedrop.js
  2491:19:invalid return
[ERROR] in filedrop.js
  2506:17:invalid return
[ERROR] in filedrop.js
  2515:13:invalid return
[ERROR] in filedrop.js
  2516:5:syntax error
[ERROR] in filedrop.js
  2521:1:syntax error
[ERROR] in filedrop.js
  1:0:Compilation produced 30 syntax errors.
org.mozilla.javascript.EvaluatorException: Compilation produced 30 syntax errors.
    at com.yahoo.platform.yui.compressor.YUICompressor$1.runtimeError(YUICompressor.java:172)
    at org.mozilla.javascript.Parser.parse(Parser.java:396)
    at org.mozilla.javascript.Parser.parse(Parser.java:340)
    at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:315)
    at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:536)
    at com.yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.java:147)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:21)

It fails on these lines:

    isIE6: /*@cc_on/*@if(@_jscript_version<=5.7)true@else@*/false/*@end@*/,
    isIE9: /*@cc_on/*@if(@_jscript_version<=9)true@else@*/false/*@end@*/,

I commented on an existing YUI Compressor issue but I don't expect them to do anything about it soon: yui/yuicompressor#119 (comment)

Is there any workaround for this? Perhaps another method of IE detection?

marczych added a commit to iFixit/FileDrop that referenced this issue Oct 14, 2015
This changes the IE detection to use UserAgent sniffing rather than
conditional compilation because YUICompressor 2.4.8 had problems with
it.

See ProgerXP#55
@marczych
Copy link
Author

My workaround was just to use UserAgent sniffing rather than conditional compilation which can be found at iFixit#1. Feel free to cherry-pick the commit in this repo if you'd like.

marczych added a commit to iFixit/FileDrop that referenced this issue Oct 14, 2015
IE Detection: Use UserAgent

This changes the IE detection to use UserAgent sniffing rather than
conditional compilation because YUICompressor 2.4.8 had problems with
it.

See ProgerXP#55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant