Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qunit makes yuicompressor choke (yui treats 'throws' as a reserved keyword) #286

Closed
cberzan opened this issue Jul 18, 2012 · 2 comments
Closed

Comments

@cberzan
Copy link

cberzan commented Jul 18, 2012

The qunit API defines a function throws (http://api.qunitjs.com/throws/), but throws is a reserved keyword in JavaScript (http://bclary.com/2004/11/07/#a-7.5.3). One side effect is that qunit cannot be passed through yuicompressor:

> java -jar .../yuicompressor-2.4.6.jar .../qunit/qunit-1.9.0.js 

[ERROR] 490:8:invalid property id

[ERROR] 490:9:syntax error

[ERROR] 528:1:missing ) in parenthetical

[ERROR] 540:35:missing name after . operator

[ERROR] 1932:1:syntax error

[ERROR] 1932:29:syntax error

[ERROR] 1:0:Compilation produced 6 syntax errors.
org.mozilla.javascript.EvaluatorException: Compilation produced 6 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:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:21)
@cberzan
Copy link
Author

cberzan commented Jul 18, 2012

Just found this #267. I guess you made the decision to use throws because it is no longer a reserved keyword in the latest ECMAScript. I updated the relevant bug report in YUICompressor (http://yuilibrary.com/projects/yuicompressor/ticket/2528028) instead.

@jzaefferer
Copy link
Member

Okay, here's hoping yuicompressor will fix this upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants