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

Unable to compress when 'char' is present #135

Closed
yurydelendik opened this issue Apr 2, 2014 · 1 comment
Closed

Unable to compress when 'char' is present #135

yurydelendik opened this issue Apr 2, 2014 · 1 comment
Labels

Comments

@yurydelendik
Copy link

The minification of the following file fails:

function ord(char) {
  return char.charCodeAt(0);
}
$ java -jar ./build/yuicompressor-2.4.8.jar t.js
[ERROR] in t.js
  1:18:missing formal parameter
[ERROR] in t.js
  1:0:Compilation produced 1 syntax errors.
org.mozilla.javascript.EvaluatorException: Compilation produced 1 syntax errors.
    at com.yahoo.platform.yui.compressor.YUICompressor$1.runtimeError(YUICompressor.java:184)
    at org.mozilla.javascript.Parser.parse(Parser.java:396)
    at org.mozilla.javascript.Parser.parse(Parser.java:340)
    at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:315)
    at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:536)
    at com.yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.java:159)
    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:606)
    at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:21)

The file is valid from the ECMAScript 5.1 point of view (see mozilla/pdf.js#4547). Could you introduce an options to take ECMAScript 5 standard into account?

/cc @mschipperheyn

@tml
Copy link
Contributor

tml commented Apr 6, 2014

Duplicate of #98

@tml tml closed this as completed Apr 6, 2014
@tml tml added the es5 label Dec 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants