#12158 closed bug (fixed)
jQuery 1.8rc1 does not work with YUICompressor 1.4.7
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | blocker | Milestone: | 1.8 |
Component: | build | Version: | 1.8rc1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I don't know if this is a problem with jQuery or YUICompressor. If this should be reported to YUICompressor, please let me know.
Trying to compress the new jQuery 1.8rc1 with YUICompressor 1.4.7 throws several errors. To reproduce this bug, you need the YUICompressor and run the following command:
java -jar yuicompressor-2.4.7.jar -o jquery-1.8rc1.min.js jquery-1.8rc1.js
The output is as followed:
[ERROR] 5795:15:invalid property id [ERROR] 5795:16:syntax error [ERROR] 5796:9:syntax error [ERROR] 7917:27:missing name after . operator [ERROR] 7918:17:syntax error [ERROR] 7936:4:missing ) in parenthetical [ERROR] 9222:1:syntax error [ERROR] 1:0:Compilation produced 7 syntax errors. org.mozilla.javascript.EvaluatorException: Compilation produced 7 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:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:21)
The problem seems to be with throws in line 5795 and 7917. Removing the line 5795 (and removing the ending , at line 5794) and && s.throws
at line 7917 results in yuicompressor not throwing any errors.
Change History (8)
comment:1 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 11 years ago by
Component: | unfiled → build |
---|---|
Milestone: | None → 1.8 |
Priority: | undecided → blocker |
comment:3 Changed 11 years ago by
We just created this option in 1.8. It's not to late to change it so that we don't have to quote it.
comment:4 Changed 11 years ago by
Yeah, requiring a quote is probably going to result in a lot of tickets, kind of like what happens with class
. Lets discuss at the meeting today.
comment:5 Changed 11 years ago by
https://developer.mozilla.org/en/JavaScript/Reference/Reserved_Words
throws is not a reserved keyword. I say we don't change anything and let the YUI compressor team fix their bugs.
comment:6 Changed 11 years ago by
Discussed in the weekly core meeting.
throws
is not a keyword in any JavaScript implementation jQuery supports.
- YUI Compressor should have an option to disable its aggressive ES3 keyword messages, and timmywil already created a ticket on their tracker for this: http://yuilibrary.com/projects/yuicompressor/ticket/2528161
- We'll leave this quoted fix in for 1.8 but will remove it in the next minor/major release.
Quote reserved keyword 'throws' to satisfy yui compressor. Fixes #12158.