I'm trying to use the YUI Compressor to get all my javascripts minified and into a single file.
I'm using this javascript file: .autotype/blob/master/jquery.autotype.js
I have a local copy obviously. But when I run that particular file through the YUI Compressor I get the following errors:
[INFO] Using charset UTF-8
[ERROR] 20:32:missing formal parameter
[ERROR] 21:32:missing formal parameter
[ERROR] 21:71:syntax error
[ERROR] 22:30:syntax error
[ERROR] 25:13:syntax error
[ERROR] 26:22:syntax error
[ERROR] 27:36:identifier is a reserved word
[ERROR] 28:13:syntax error
[ERROR] 29:21:syntax error
[ERROR] 53:29:invalid property id
[ERROR] 53:30:syntax error
[ERROR] 54:30:syntax error
[ERROR] 55:22:syntax error
[ERROR] 62:29:invalid property id
[ERROR] 62:30:syntax error
[ERROR] 63:30:syntax error
[ERROR] 64:22:syntax error
[ERROR] 106:33:invalid property id
[ERROR] 106:34:syntax error
[ERROR] 107:34:syntax error
[ERROR] 108:44:syntax error
[ERROR] 109:26:syntax error
[ERROR] 151:29:invalid property id
[ERROR] 151:30:syntax error
[ERROR] 152:30:syntax error
[ERROR] 160:34:missing name after . operator
[ERROR] 163:33:missing name after . operator
[ERROR] 165:13:syntax error
[ERROR] 167:9:syntax error
[ERROR] 168:29:syntax error
[ERROR] 209:54:missing name after . operator
[ERROR] 218:9:syntax error
[ERROR] 219:30:syntax error
[ERROR] 220:27:missing ; before statement
[ERROR] 221:24:syntax error
[ERROR] 230:13:syntax error
[ERROR] 231:19:syntax error
[ERROR] 233:17:syntax error
[ERROR] 235:13:syntax error
[ERROR] 283:1:syntax error
[ERROR] 1:0:Compilation produced 40 syntax errors.
org.mozilla.javascript.EvaluatorException: Compilation produced 40 syntax errors.
at .yahoo.platform.yuipressor.YUICompressor$1.runtimeError(YUICompressor.java:154)
at org.mozilla.javascript.Parser.parse(Parser.java:392)
at org.mozilla.javascript.Parser.parse(Parser.java:337)
at .yahoo.platform.yuipressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312)
at .yahoo.platform.yuipressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
at .yahoo.platform.yuipressor.YUICompressor.main(YUICompressor.java:131)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at .yahoo.platform.yuipressor.Bootstrap.main(Bootstrap.java:21)
I've looked through their code a bit and can't figure out why it's getting this error. Any help would be greatly appreciated.
I'm trying to use the YUI Compressor to get all my javascripts minified and into a single file.
I'm using this javascript file: https://github./mmonteleone/jquery.autotype/blob/master/jquery.autotype.js
I have a local copy obviously. But when I run that particular file through the YUI Compressor I get the following errors:
[INFO] Using charset UTF-8
[ERROR] 20:32:missing formal parameter
[ERROR] 21:32:missing formal parameter
[ERROR] 21:71:syntax error
[ERROR] 22:30:syntax error
[ERROR] 25:13:syntax error
[ERROR] 26:22:syntax error
[ERROR] 27:36:identifier is a reserved word
[ERROR] 28:13:syntax error
[ERROR] 29:21:syntax error
[ERROR] 53:29:invalid property id
[ERROR] 53:30:syntax error
[ERROR] 54:30:syntax error
[ERROR] 55:22:syntax error
[ERROR] 62:29:invalid property id
[ERROR] 62:30:syntax error
[ERROR] 63:30:syntax error
[ERROR] 64:22:syntax error
[ERROR] 106:33:invalid property id
[ERROR] 106:34:syntax error
[ERROR] 107:34:syntax error
[ERROR] 108:44:syntax error
[ERROR] 109:26:syntax error
[ERROR] 151:29:invalid property id
[ERROR] 151:30:syntax error
[ERROR] 152:30:syntax error
[ERROR] 160:34:missing name after . operator
[ERROR] 163:33:missing name after . operator
[ERROR] 165:13:syntax error
[ERROR] 167:9:syntax error
[ERROR] 168:29:syntax error
[ERROR] 209:54:missing name after . operator
[ERROR] 218:9:syntax error
[ERROR] 219:30:syntax error
[ERROR] 220:27:missing ; before statement
[ERROR] 221:24:syntax error
[ERROR] 230:13:syntax error
[ERROR] 231:19:syntax error
[ERROR] 233:17:syntax error
[ERROR] 235:13:syntax error
[ERROR] 283:1:syntax error
[ERROR] 1:0:Compilation produced 40 syntax errors.
org.mozilla.javascript.EvaluatorException: Compilation produced 40 syntax errors.
at .yahoo.platform.yui.pressor.YUICompressor$1.runtimeError(YUICompressor.java:154)
at org.mozilla.javascript.Parser.parse(Parser.java:392)
at org.mozilla.javascript.Parser.parse(Parser.java:337)
at .yahoo.platform.yui.pressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312)
at .yahoo.platform.yui.pressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
at .yahoo.platform.yui.pressor.YUICompressor.main(YUICompressor.java:131)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at .yahoo.platform.yui.pressor.Bootstrap.main(Bootstrap.java:21)
I've looked through their code a bit and can't figure out why it's getting this error. Any help would be greatly appreciated.
Share Improve this question asked May 24, 2012 at 20:37 PeterPeter 3,18412 gold badges38 silver badges57 bronze badges 1- I just tried out Google Closure and it throws the same errors. – Peter Commented May 24, 2012 at 21:02
1 Answer
Reset to default 5I figured it out. I used http://closure-piler.appspot./home which is a web based Google Closure tool, which from what I've seen essentially does the same thing as YUI only their web tool gave MUCH more verbose errors than the YUI error log, and I was able to determine that it had failed because the author of the script often uses the reserved variable name of char. Modifying my local version every instance of char to 'chara' (lame I know) it worked just fine.