Code Monkey home page Code Monkey logo

uglifyjs-java's People

Contributors

yuanyan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

uglifyjs-java's Issues

Where is uglifyjs-java.jar? How do I compile it?

Hi. Thanks for sharing this code, but can you explain how to compile the source into uglifyjs-java.jar? I don't see a pom.xml, and the build.xml seems to be for running the task, rather then compiling the .java files into a jar.
Thanks in advance.

it seems UglifyJS-java can't read non-ASCII characters in UTF8 files

"~/Sites/uglifyjs/test.js" is an UTF8 file and have non-ASCII characters. When I try to use UglifyJS-java like this:
java -jar uglifyjs-java.jar -nm -nc -o tmp/test.js ~/Sites/uglifyjs/test.js

It output error as:
Unexpected token name, expected punc | 5008 | 39 | 189814
javax.script.ScriptException: sun.org.mozilla.javascript.internal.JavaScriptException: [object Object](Unknown source>#274) in at line number 274
at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:153)
at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:167)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
at uglify.UglifyJS.exec(UglifyJS.java:53)
at uglify.UglifyJS.main(UglifyJS.java:16)

After I convert "~/Sites/uglifyjs/test.js" to GB18030, UglifyJS-java works well.

Not compatible with Java8 Nashorn engine

I couldn't make this run using JDK 8.0_131 (x64).
Here is the stack trace :

Exception in thread "main" java.lang.ArrayStoreException: jdk.nashorn.internal.runtime.Undefined
at jdk.nashorn.internal.runtime.arrays.ObjectArrayData.setEmpty(ObjectArrayData.java:161)
at jdk.nashorn.internal.runtime.arrays.ObjectArrayData.delete(ObjectArrayData.java:228)
at jdk.nashorn.internal.runtime.ScriptObject.delete(ScriptObject.java:3309)
at jdk.nashorn.internal.objects.NativeArray.shift(NativeArray.java:1170)
at jdk.nashorn.internal.scripts.Script$13$^eval_.:program(:32)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:449)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402)
at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:150)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249)
at uglify.UglifyJS.run(UglifyJS.java:75)
at uglify.UglifyJS.exec(UglifyJS.java:50)
at uglify.ant.UglifyTask.execute(UglifyTask.java:237)
at uglify.ant.UglifyTask.main(UglifyTask.java:37)

I tried with an old JDK6u45 (x64) -> too old

I tried with JDK 7.0.40:

  • Ok if I run from main

  • Nok if I run from ant task (uglify is not defined):

    [uglify] javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorException: Cannot modify a property of a sealed object: remove. (#12) in at line number 12
    [uglify] Caused by: sun.org.mozilla.javascript.internal.EvaluatorException: Cannot modify a property of a sealed object: remove. (#12)

    [uglify] javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "uglify" n'est pas défini (#1) in at line number 1
    [uglify] Caused by: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "uglify" n'est pas défini (#1)

ES6 compatibility

Does this supports ES6 or any plan to support it in near future ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.