Skip to main content

Bug Tracker

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.throws
at line 7917 results in yuicompressor not throwing any errors.

Attachments (0)
Change History (8)

Changed July 30, 2012 02:45PM UTC by Timmy Willison comment:1

resolution: → fixed
status: newclosed

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

Changeset: beeab4d126b303b194899adf579d8f43e3fd5e69

Changed July 30, 2012 02:45PM UTC by timmywil comment:2

component: unfiledbuild
milestone: None1.8
priority: undecidedblocker

Changed July 30, 2012 03:00PM UTC by mikesherov 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 dmethvin 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 jaubourg 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 dmethvin comment:6

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.

Changed August 06, 2012 07:28PM UTC by timmywil comment:7

#12202 is a duplicate of this ticket.

Changed August 14, 2012 11:33AM UTC by sindresorhus comment:8

#12187 is a duplicate of this ticket.