Side navigation
#12158 closed bug (fixed)
Opened July 29, 2012 11:44AM UTC
Closed July 30, 2012 02:45PM UTC
Last modified August 14, 2012 11:33AM UTC
jQuery 1.8rc1 does not work with YUICompressor 1.4.7
Reported by: | sebastian.goettschkes@googlemail.com | 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.throwsat line 7917 results in yuicompressor not throwing any errors.
Attachments (0)
Change History (8)
Changed July 30, 2012 02:45PM UTC by comment:1
resolution: | → fixed |
---|---|
status: | new → closed |
Changed July 30, 2012 02:45PM UTC by comment:2
component: | unfiled → build |
---|---|
milestone: | None → 1.8 |
priority: | undecided → blocker |
Changed July 30, 2012 03:00PM UTC by comment:3
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.
Changed July 30, 2012 03:04PM UTC by comment:4
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.
Changed July 30, 2012 03:12PM UTC by comment:5
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.
Changed July 30, 2012 04:51PM UTC by comment:6
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.
Changeset: beeab4d126b303b194899adf579d8f43e3fd5e69