Bug Tracker

Ticket #12158 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

jQuery 1.8rc1 does not work with YUICompressor 1.4.7

Reported by: sebastian.goettschkes@… Owned by:
Priority: blocker Milestone: 1.8
Component: build Version: 1.8rc1
Keywords: Cc:
Blocking: Blocked by:

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

comment:1 Changed 2 years ago by Timmy Willison

  • Status changed from new to closed
  • Resolution set to fixed

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

Changeset: beeab4d126b303b194899adf579d8f43e3fd5e69

comment:2 Changed 2 years ago by timmywil

  • Priority changed from undecided to blocker
  • Component changed from unfiled to build
  • Milestone changed from None to 1.8

comment:3 Changed 2 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 2 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 2 years ago by jaubourg

 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 2 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 2 years ago by timmywil

#12202 is a duplicate of this ticket.

comment:8 Changed 2 years ago by sindresorhus

#12187 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.