Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#12158 closed bug (fixed)

jQuery 1.8rc1 does not work with YUICompressor 1.4.7

Reported by: [email protected] Owned by:
Priority: blocker Milestone: 1.8
Component: build Version: 1.8rc1
Keywords: Cc:
Blocked by: Blocking:


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 9 years ago by Timmy Willison

Resolution: fixed
Status: newclosed

Quote reserved keyword 'throws' to satisfy yui compressor. Fixes #12158.

Changeset: beeab4d126b303b194899adf579d8f43e3fd5e69

comment:2 Changed 9 years ago by timmywil

Component: unfiledbuild
Milestone: None1.8
Priority: undecidedblocker

comment:3 Changed 9 years ago by mikesherov

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 9 years ago by dmethvin

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 9 years ago by jaubourg


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 9 years ago by dmethvin

Discussed in the weekly core meeting.

  • throws is not a keyword in any JavaScript implementation jQuery supports.
  • We'll leave this quoted fix in for 1.8 but will remove it in the next minor/major release.

comment:7 Changed 9 years ago by timmywil

#12202 is a duplicate of this ticket.

comment:8 Changed 9 years ago by sindresorhus

#12187 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.