Open hrj opened 9 years ago
I was able to invoke the script from the browser (with both Nashorn and Rhino). I even optimised it by compiling the JS to bytecode (though it still requires Rhino engine to execute).
However, it is a little slow (couple of seconds for large files such as jquery). A pure Java version would be very desireable.
It is easier to debug the browser when the JS is beautified. Stack traces are easier to analyse.
We can integrate a beautifier into the browser and perform the beautification automatically.
This beautifier works fine. It is written in Javascript, and I was able to run it with Nashorn easily with this script:
Slight modification to
beautify.js
is required: the scope wrapping the code had to be commented out.invoked using:
The next steps would be: