mozilla/rhino ? reverse-engineered prompt
Reverse engineered prompt
Build me a Java library that lets me run JavaScript inside a Java app.
I want it to work as a small JavaScript engine, with a simple command line shell I can run from the project root, plus a way to embed scripts in other Java code. It should support modern JavaScript features as much as possible, and include the extra pieces for the shell, debugger, and optional XML support if needed.
Please make the project easy to build and test from the command line, and keep it organized so the core engine is separate from the extras. If there are current compatibility or API details I should match, look them up online and follow the existing Rhino behavior as closely as possible.
Also include a few examples so I can see how to run scripts and call Java from JavaScript, and make sure the tests can be run cleanly.
Are you gonna build this?
make sure you review the code using coderabbit