This article is in need of a technical review.
Beginning with Rhino 1.4 Release 2, an interpretive mode is supported. When scripts are compiled in interpretive mode, an internal representation of the compiled form is created and stored rather than generating a Java class. Execution proceeds by evaluating this compiled form using support routines in Rhino.
Compilation to Java bytecodes
Types and values
||A singleton object defined by
Instead, every property accessor method in
setAttributes) has overloaded forms that take either a
String or an
int argument. It is the responsibility of the caller to invoke the appropriate overloaded form. For example, evaluating the expression
obj["3"] will invoke the
get(int, Scriptable) method even though the property name was presented in the script as a string. Similarly, values of numbers that do not fix in integers (like 1.1 and 0x100000000) must be converted to strings.
Defining host objects
Document objects are host objects.
The easiest way to define new host objects is by using
If the services provided by
defineClass() are insufficient, try other methods of
FunctionObject, such as
Contexts and threads
Context. Multiple threads (with multiple associated
Contexts) may act upon the same set of objects. Any host objects that are defined are responsible for any sychronization required to run safely from multiple threads.
Original Document Information