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

javascript compression fails when using delete as function name on object #189

Closed
jbhamilton opened this issue Jan 28, 2015 · 2 comments
Closed
Labels

Comments

@jbhamilton
Copy link

When an object has a method named "delete" the compression fails

Ex:

SC.delete('/resource',function(){
});

Error:

[ERROR] in public/js/js.js
  805:18:missing name after . operator
[ERROR] in public/js/js.js
  806:21:syntax error
[ERROR] in public/js/js.js
  807:10:syntax error
[ERROR] in public/js/js.js
  812:1:missing ) after argument list
[ERROR] in public/js/js.js
  812:2:syntax error
[ERROR] in public/js/js.js
  1:0:Compilation produced 5 syntax errors.
org.mozilla.javascript.EvaluatorException: Compilation produced 5 syntax errors.
        at com.yahoo.platform.yui.compressor.YUICompressor$1.runtimeError(YUICompressor.java:172)
        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:147)
        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)

@tml tml added the es5 label Feb 8, 2015
@tml
Copy link
Contributor

tml commented Feb 8, 2015

Same issue as #47 - requires ES5 support in Rhino to fix.

@tml tml closed this as completed Feb 8, 2015
@onurodemis
Copy link

onurodemis commented Sep 22, 2017

SC['delete']()
It should be compiled

ahmed-musallam added a commit to ahmed-musallam/aem-selecto that referenced this issue Jan 12, 2018
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

3 participants