我正在尝试使用 YUI Compressor 将我所有的 javascripts 缩小并放入一个文件中。
我正在使用这个 javascript 文件:https ://github.com/mmonteleone/jquery.autotype/blob/master/jquery.autotype.js
我显然有一个本地副本。但是当我通过 YUI Compressor 运行该特定文件时,我收到以下错误:
[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 com.yahoo.platform.yui.compressor.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 com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
at com.yahoo.platform.yui.compressor.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 com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:21)
我已经浏览了他们的代码,无法弄清楚为什么会出现这个错误。任何帮助将不胜感激。