JsUnit
Project Developer Home doxygen

Rhino

Mozilla.org's Rhino

Rhino is the name of the JavaScript engine from mozilla.org written completely in Java. Depending on the configuration, the engine is even capable of translating the code to Java and compile it automatically. Since it is Open Source and especially designed for usage in other products, you can find nowadays a lot of applications using Rhino as easy scripting environment. The engine is shipped in the file js.jar. A shell and a transpiler to convert JavaScript into Java code is available.

The version 1.5RC3 (and possibly earlier versions) has a bug and will throw a TypeError if the method toString is called for a class derived from Error. JsUnit is able to compensate this bug, although it is fixed for 1.5RC4.

Examples

The distribution of Rhino includes a shell, that can be used as command line version to execute standalone JavaScript sources. This shell implements some commands not available in the JavaScript standard. Concerning JsUnit this is print to write to the console and load to load other JavaScript files. Call the engine with

java org.mozilla.javascript.tools.shell.Main <filename>.js

You can run the examples or the JsUnit's TestSuite giving AllTests.js as argument running the shell.

Additionally the engine will also throw a TypeError running JsUnit if optimization is enabled (greater 0). I have not investigated on this further.

Debugger

A basic debugger is also part of the distribution. Call

java org.mozilla.javascript.tools.debugger.Main <filename>.js
rhinodebugger.png

JsUnit © 1999, 2000, 2001, 2002, 2003, 2006, 2007 by Jörg Schaible
Generated on Wed Apr 15 2015 02:33:06 for JsUnit by doxygen 1.8.5