Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Massive reconfiguration of the cvs directory structure:

mozilla/js/rhino/org is now distributed between
mozilla/js/rhino/src and mozilla/js/rhino/toolsrc.
The build.xml has been split in three.
Docs now live in the project directory.

These changes mean that the cvs directories mirror the distribution and thus a distribution
will build the same way as a cvs build.
  • Loading branch information...
commit 21edd57ff4cde7e58e59f45bcf55d8105c002490 1 parent 571c398
norrisboyd norrisboyd authored
Showing with 3,590 additions and 23,702 deletions.
  1. 0  built-on-date → build-date
  2. +25 −109 build.xml
  3. +161 −0 docs/RhinoDebugger.html
  4. +128 −0 docs/api.html
  5. +43 −0 docs/bsf.html
  6. +129 −0 docs/changes.html
  7. +98 −0 docs/debugApi.html
  8. +361 −0 docs/debugger.html
  9. +149 −0 docs/doc.html
  10. +59 −0 docs/download.html
  11. +278 −0 docs/embedding-engine.html
  12. +89 −0 docs/examples.html
  13. +81 −0 docs/faq.html
  14. +48 −0 docs/footprint.html
  15. +38 −0 docs/help.html
  16. +45 −0 docs/history.html
  17. +75 −0 docs/index.html
  18. +66 −0 docs/javaone.html
  19. +162 −0 docs/js15.html
  20. +82 −0 docs/jsc.html
  21. BIN  docs/jsdebug.jpg
  22. +86 −0 docs/limits.html
  23. BIN  docs/lookup.gif
  24. +68 −0 docs/opt.html
  25. +149 −0 docs/overview.html
  26. +3 −0  docs/owner.js
  27. +83 −0 docs/perf.html
  28. BIN  docs/rhino50.jpg
  29. +138 −0 docs/runtime.html
  30. BIN  docs/scopes.gif
  31. +174 −0 docs/scopes.html
  32. BIN  docs/scriptjava-frame.jpg
  33. +199 −0 docs/scriptjava.html
  34. BIN  docs/scriptjavaframe.jpg
  35. +128 −0 docs/shell.html
  36. +31 −0 docs/tools.html
  37. +336 −0 docs/tutorial.html
  38. +78 −0 docs/users.html
  39. +0 −1,082 org/mozilla/classfile/ByteCode.java
  40. +0 −1,465 org/mozilla/classfile/ClassFileWriter.java
  41. +0 −76 org/mozilla/classfile/ClassManager.java
  42. +0 −130 org/mozilla/javascript/Arguments.java
  43. +0 −75 org/mozilla/javascript/BinaryDigitReader.java
  44. +0 −48 org/mozilla/javascript/ClassDefinitionException.java
  45. +0 −63 org/mozilla/javascript/ClassNameHelper.java
  46. +0 −57 org/mozilla/javascript/ClassOutput.java
  47. +0 −1,952 org/mozilla/javascript/Context.java
  48. +0 −53 org/mozilla/javascript/ContextListener.java
  49. +0 −1,197 org/mozilla/javascript/DToA.java
  50. +0 −111 org/mozilla/javascript/DebuggableEngineImpl.java
  51. +0 −63 org/mozilla/javascript/DefaultErrorReporter.java
  52. +0 −250 org/mozilla/javascript/Delegator.java
  53. +0 −152 org/mozilla/javascript/EcmaError.java
  54. +0 −103 org/mozilla/javascript/ErrorReporter.java
  55. +0 −56 org/mozilla/javascript/EvaluatorException.java
  56. +0 −341 org/mozilla/javascript/FlattenedObject.java
  57. +0 −86 org/mozilla/javascript/Function.java
  58. +0 −94 org/mozilla/javascript/FunctionNode.java
  59. +0 −659 org/mozilla/javascript/FunctionObject.java
  60. +0 −1,056 org/mozilla/javascript/IRFactory.java
  61. +0 −287 org/mozilla/javascript/IdFunction.java
  62. +0 −499 org/mozilla/javascript/IdScriptable.java
  63. +0 −176 org/mozilla/javascript/ImporterTopLevel.java
  64. +0 −112 org/mozilla/javascript/InterpretedFunction.java
  65. +0 −96 org/mozilla/javascript/InterpretedScript.java
  66. +0 −2,016 org/mozilla/javascript/Interpreter.java
  67. +0 −134 org/mozilla/javascript/InterpreterData.java
  68. +0 −77 org/mozilla/javascript/InterpreterFrame.java
  69. +0 −294 org/mozilla/javascript/Invoker.java
  70. +0 −926 org/mozilla/javascript/JavaAdapter.java
  71. +0 −589 org/mozilla/javascript/JavaMembers.java
  72. +0 −109 org/mozilla/javascript/JavaScriptException.java
  73. +0 −104 org/mozilla/javascript/Label.java
  74. +0 −80 org/mozilla/javascript/LabelTable.java
  75. +0 −99 org/mozilla/javascript/LazilyLoadedCtor.java
  76. +0 −412 org/mozilla/javascript/LineBuffer.java
  77. +0 −114 org/mozilla/javascript/ListenerCollection.java
  78. +0 −79 org/mozilla/javascript/LocalVariable.java
  79. +0 −1,116 org/mozilla/javascript/NativeArray.java
  80. +0 −157 org/mozilla/javascript/NativeBoolean.java
  81. +0 −133 org/mozilla/javascript/NativeCall.java
  82. +0 −1,796 org/mozilla/javascript/NativeDate.java
  83. +0 −146 org/mozilla/javascript/NativeError.java
  84. +0 −1,030 org/mozilla/javascript/NativeFunction.java
  85. +0 −792 org/mozilla/javascript/NativeGlobal.java
  86. +0 −155 org/mozilla/javascript/NativeJavaArray.java
  87. +0 −275 org/mozilla/javascript/NativeJavaClass.java
  88. +0 −87 org/mozilla/javascript/NativeJavaConstructor.java
  89. +0 −502 org/mozilla/javascript/NativeJavaMethod.java
  90. +0 −929 org/mozilla/javascript/NativeJavaObject.java
  91. +0 −236 org/mozilla/javascript/NativeJavaPackage.java
  92. +0 −395 org/mozilla/javascript/NativeMath.java
  93. +0 −271 org/mozilla/javascript/NativeNumber.java
  94. +0 −201 org/mozilla/javascript/NativeObject.java
Sorry, we could not display the entire diff because it was too big.
0  built-on-date → build-date
View
File renamed without changes
134 build.xml
View
@@ -9,37 +9,31 @@ Requires Ant version 1.2
<target name="properties">
<property name="name" value="rhino"/>
<property name="Name" value="Rhino"/>
+ <property name="version" value="1_5R2pre"/>
<property name="rhino.jar" value="js.jar"/>
<property name="build.compiler" value="classic"/>
<property name="debug" value="off"/>
- <property name="src.dir" value="."/>
- <property name="src.examples" value="${src.dir}/examples"/>
- <property name="src.debugger"
- value="${src.dir}/org/mozilla/javascript/tools/debugger"/>
+ <property name="src.dir" value="src"/>
+ <property name="toolsrc.dir" value="toolsrc"/>
+ <property name="src.examples" value="examples"/>
<property name="build.dir" value="./build"/>
<property name="build.dest" value="${build.dir}/classes"/>
- <property name="dist.name" value="rhino15R2pre"/>
+ <property name="dist.name" value="rhino${version}"/>
<property name="dist.dir" value="${build.dir}/${dist.name}"/>
<property name="dist.src" value="${dist.dir}/src"/>
+ <property name="dist.toolsrc" value="${dist.dir}/toolsrc"/>
<property name="dist.examples" value="${dist.dir}/examples"/>
<property name="dist.docs" value="${dist.dir}/docs"/>
<property name="dist.apidocs" value="${dist.docs}/apidocs"/>
- <property name="dist.file" value="rhinoTip.zip"/>
+ <property name="dist.file" value="rhino${version}.zip"/>
<property file="apiClasses.properties"/>
- <property name="cvs.javasrc.dir" value="${src.dir}"/>
- <property name="cvs.docsrc.dir" value="../../../mozilla-org/html/rhino/"/>
- <property name="dist.javasrc.dir" value="${src.dir}/src"/>
+ <property name="docsrc.dir" value="docs"/>
<property name="dist.docsrc.dir" value="${src.dir}/docs"/>
- <available file="${cvs.javasrc.dir}/org" property="in-cvs-tree"/>
- <available file="${src.debugger}/AbstractCellEditor.java"
- property="swing-ex-available"/>
- <available classname="java.lang.reflect.Proxy"
- property="jdk1.3"/>
</target>
<target name="init" depends="properties">
@@ -50,99 +44,28 @@ Requires Ant version 1.2
<mkdir dir="${build.dest}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.src}"/>
+ <mkdir dir="${dist.toolsrc}"/>
<mkdir dir="${dist.examples}"/>
<mkdir dir="${dist.docs}"/>
<mkdir dir="${dist.apidocs}"/>
</target>
- <target name="get-swing-ex" unless="swing-ex-available">
- <!-- Download source from Sun's site, unzip it, remove
- the files we don't need, and change the package
- -->
- <get src="http://java.sun.com/products/jfc/tsc/articles/treetable2/downloads/src.zip" dest="${build.dir}/swingExSrc.zip"/>
- <unzip src="${build.dir}/swingExSrc.zip" dest="${src.debugger}"/>
- <delete file="${src.debugger}/FileSystemModel2.java" />
- <delete file="${src.debugger}/MergeSort.java" />
- <delete file="${src.debugger}/TreeTableExample2.java" />
- <replace file="${src.debugger}/AbstractCellEditor.java">
- <replacetoken>import java.awt.Component;</replacetoken>
- <replacevalue>
- package org.mozilla.javascript.tools.debugger;
- import java.awt.Component;
- </replacevalue>
- </replace>
- <replace file="${src.debugger}/AbstractTreeTableModel.java">
- <replacetoken>import javax.swing.tree.*;</replacetoken>
- <replacevalue>
- package org.mozilla.javascript.tools.debugger;
- import javax.swing.tree.*;
- </replacevalue>
- </replace>
- <replace file="${src.debugger}/JTreeTable.java">
- <replacetoken>import javax.swing.*;</replacetoken>
- <replacevalue>
- package org.mozilla.javascript.tools.debugger;
- import javax.swing.*;
- </replacevalue>
- </replace>
- <replace file="${src.debugger}/TreeTableModel.java">
- <replacetoken>import javax.swing.tree.TreeModel;</replacetoken>
- <replacevalue>
- package org.mozilla.javascript.tools.debugger;
- import javax.swing.tree.TreeModel;
- </replacevalue>
- </replace>
- <replace file="${src.debugger}/TreeTableModelAdapter.java">
- <replacetoken>import javax.swing.JTree;</replacetoken>
- <replacevalue>
- package org.mozilla.javascript.tools.debugger;
- import javax.swing.JTree;
- </replacevalue>
- </replace>
+ <target name="compile-src" depends="prepare">
+ <ant dir="${src.dir}"/>
</target>
- <target name="compile-from-cvs"
- if="in-cvs-tree"
- depends="prepare,get-swing-ex">
- <javac srcdir="${cvs.javasrc.dir}"
- destdir="${build.dest}"
- includes="org/**/*.java"
- deprecation="on"
- debug="${debug}">
- <exclude name="**/debugger/*.java" unless="jdk1.3"/>
- </javac>
+ <target name="compile-toolsrc" depends="prepare">
+ <ant dir="${toolsrc.dir}"/>
</target>
- <target name="compile-from-dist" unless="in-cvs-tree" depends="prepare">
- <javac srcdir="${dist.javasrc.dir}"
- destdir="${build.dest}"
- includes="org/**/*.java"
- deprecation="on"
- debug="${debug}" />
- </target>
-
- <target name="compile" depends="compile-from-dist,compile-from-cvs"/>
-
- <target name="copy-properties" depends="prepare">
- <copy todir="${build.dest}">
- <fileset dir="${src.dir}" includes="org/**/*.properties" />
- </copy>
- </target>
+ <target name="compile" depends="compile-src,compile-toolsrc"/>
- <target name="jar" depends="compile,copy-properties">
+ <target name="jar" depends="compile">
<jar jarfile="${dist.dir}/${rhino.jar}"
basedir="${build.dest}"
manifest="${src.dir}/manifest" />
</target>
- <target name="copy-source" depends="prepare">
- <copy todir="${dist.src}">
- <fileset dir="${src.dir}"
- includes="org/**/*.java,org/**/*.properties"
- excludes="**/AbstractCellEditor.java,**/TreeTableModel.java,**/AbstractTreeTableModel.java,**/TreeTableModelAdapter.java,**/JTreeTable.java" />
- </copy>
- </target>
-
<target name="copy-examples" depends="prepare">
<copy todir="${dist.examples}">
<fileset dir="${src.examples}" includes="*.java,*.js,*.html" />
@@ -153,35 +76,28 @@ Requires Ant version 1.2
<tstamp/>
<filter token="datestamp" value="${TODAY}"/>
<copy todir="${dist.dir}" filtering="yes">
- <fileset dir="${src.dir}">
+ <fileset dir=".">
<patternset>
<include name="build.xml"/>
<include name="apiClasses.properties"/>
- <include name="manifest"/>
- <include name="built-on-date"/>
+ <include name="build-date"/>
</patternset>
</fileset>
</copy>
</target>
- <target name="copy-all" depends="copy-source,copy-examples,copy-misc">
+ <target name="copy-all" depends="copy-examples,copy-misc">
</target>
- <target name="copy-docs-cvs" if="in-cvs-tree" depends="prepare">
- <echo message="copy from ${cvs.docsrc.dir}"/>
+ <target name="copy-docs" depends="prepare">
+ <echo message="copy from ${docsrc.dir}"/>
<copy todir="${dist.docs}">
- <fileset dir="${cvs.docsrc.dir}"
+ <fileset dir="${docsrc.dir}"
includes="**/*.html,**/*.jpg,**/*.gif" />
</copy>
</target>
- <target name="copy-docs-dist" unless="in-cvs-tree" depends="prepare">
- <echo message="Docs and source not copied on build from dist."/>
- </target>
-
- <target name="copy-docs" depends="copy-docs-dist,copy-docs-cvs"/>
-
- <target name="javadoc" if="in-cvs-tree" depends="copy-source,copy-docs">
+ <target name="javadoc" depends="compile,copy-docs">
<javadoc sourcefiles="${apiClasses}"
sourcepath="${dist.src}"
destdir="${dist.apidocs}"
@@ -192,9 +108,9 @@ Requires Ant version 1.2
windowtitle="${Name}" />
</target>
- <target name="package" depends="copy-all,jar,javadoc">
- <delete file="${src.dir}/${dist.file}" />
- <zip zipfile="${src.dir}/${dist.file}"
+ <target name="package" depends="copy-all,jar">
+ <delete file="${dist.file}" />
+ <zip zipfile="${dist.file}"
basedir="${build.dir}"
includes="**"
excludes="classes/**" />
161 docs/RhinoDebugger.html
View
@@ -0,0 +1,161 @@
+<HTML>
+<HEAD>
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
+<META NAME="Generator" CONTENT="Microsoft Word 97">
+<TITLE>1</TITLE>
+</HEAD>
+<BODY>
+
+<OL>
+
+<B><FONT FACE="Arial" SIZE=5 COLOR="#000080"><LI>Using the Rhino JavaScript Debugger</LI>
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The Mozilla Rhino JavaScript engine includes a source-level debugger for debugging JavaScript scripts. The debugger is itself a Java program which you may run as</P>
+</FONT><FONT FACE="Arial" SIZE=2><P ALIGN="JUSTIFY">java org.mozilla.javascript.tools.debugger.JSDebugger [options] [filename.js] [script-arguments]</P>
+</FONT><FONT SIZE=2><P ALIGN="JUSTIFY">where the options are the same as the shell.</P>
+<OL>
+
+<LI><A NAME="_Toc502165108"></FONT><B><FONT FACE="Arial" SIZE=4 COLOR="#000080">Features</A></LI>
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The Rhino JavaScript Debugger can debug scripts running in multiple threads and provides facilities to set and clear breakpoints, control execution, view variables, and evaluate arbitrary JavaScript code in the current scope of an executing script.</P>
+<OL>
+
+<LI><A NAME="_Toc502165109"></FONT><B><FONT FACE="Arial" COLOR="#000080">Console Window</A></LI>
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The debugger redirects the </FONT><FONT FACE="Arial" SIZE=2>System.out</FONT><FONT SIZE=2>, </FONT><FONT FACE="Arial" SIZE=2>System.in</FONT><FONT SIZE=2>, and </FONT><FONT FACE="Arial" SIZE=2>System.err</FONT><FONT SIZE=2> streams to an internal JavaScript console window which provides an editable command line for you to enter JavaScript code and view system output. The console window maintains a history of the commands you have entered. You may move backward and forward through the history list by pressing the Up/Down arrow keys on the keyboard.</P>
+<LI><A NAME="_Toc502165110"></FONT><B><FONT FACE="Arial" COLOR="#000080">Opening Scripts</A></LI>
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">You may select the <B><I>File-&gt;Open</B></I> menu item on the menu bar to load JavaScript scripts contained in files. This action will display a file-selection dialog box prompting you for the location of a script to load. The selected file will be compiled and displayed in a new window.</P>
+</FONT><B><FONT FACE="Arial" COLOR="#000080"><LI>Running Scripts</LI>
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">You may select the <B><I>File-&gt;Run</B></I> menu item on the menu bar to execute JavaScript scripts contained in files. This action will display a file-selection dialog box prompting you for the location of a script to execute. The loaded script will be run in a new thread and control will be given to the debugger on its first instruction.</P>
+<LI><A NAME="_Toc502165111"></FONT><B><FONT FACE="Arial" COLOR="#000080">Controlling Execution</A></LI>
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The debugger provides the following facilities for you to control the execution of scripts you are debugging:</P>
+<OL>
+
+</FONT><B><FONT FACE="Arial" COLOR="#000080"><LI>Step Into</LI></OL>
+</OL>
+</OL>
+</OL>
+
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">To single step entering any function calls, you may do any of the following:</P>
+
+<UL>
+<P ALIGN="JUSTIFY"><LI>Select the <B><I>Debug-&gt;Step Into </B></I>menu item on the menu bar</LI></P>
+<P ALIGN="JUSTIFY"><LI>Press the <B><I>Step Into</B></I> button on the toolbar</LI></P>
+<P ALIGN="JUSTIFY"><LI>Press the F11 key on the keyboard</LI></P></UL>
+
+<P ALIGN="JUSTIFY">Execution will resume. If the current line in the script contains a function call control will return to the debugger upon entry into the function. Otherwise control will return to the debugger at the next line in the current function.</P>
+<OL>
+<OL>
+<OL>
+<OL>
+
+</FONT><B><FONT FACE="Arial" COLOR="#000080"><LI>Step Over</LI></OL>
+</OL>
+</OL>
+</OL>
+
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">To single step to the next line in the current function, you may do any of the following:</P>
+
+<UL>
+<P ALIGN="JUSTIFY"><LI>Select the <B><I>Debug-&gt;Step Over</B></I> menu item on the menu bar</LI></P>
+<P ALIGN="JUSTIFY"><LI>Press the <B><I>Step Over</B></I> button on the toolbar</LI></P>
+<P ALIGN="JUSTIFY"><LI>Press the F7 key on the keyboard</LI></P></UL>
+
+<P ALIGN="JUSTIFY">Execution will resume but control will return to the debugger at the next line in the current function or top-level script.</P>
+<OL>
+<OL>
+<OL>
+<OL>
+
+</FONT><B><FONT FACE="Arial" COLOR="#000080"><LI>Step Out</LI></OL>
+</OL>
+</OL>
+</OL>
+
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">To continue execution until the current function returns you may do any of the following:</P>
+
+<UL>
+<P ALIGN="JUSTIFY"><LI>Select the <B><I>Debug-&gt;Step Out</B></I> menu item on the menu bar</LI></P>
+<P ALIGN="JUSTIFY"><LI>Press the <B><I>Step Out</B></I> button on the toolbar</LI></P>
+<P ALIGN="JUSTIFY"><LI>Press the F8 key on the keyboard</LI></P></UL>
+
+<P ALIGN="JUSTIFY">Execution will resume until the current function returns or a breakpoint is hit.</P>
+<OL>
+<OL>
+<OL>
+<OL>
+
+</FONT><B><FONT FACE="Arial" COLOR="#000080"><LI>Go</LI></OL>
+</OL>
+</OL>
+</OL>
+
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">To resume execution of a script you may do any of the following:</P>
+
+<UL>
+<P ALIGN="JUSTIFY"><LI>Select the <B><I>Debug-&gt;Go</B></I> menu item on the menu bar</LI></P>
+<P ALIGN="JUSTIFY"><LI>Press the <B><I>Go</B></I> button on the toolbar</LI></P>
+<P ALIGN="JUSTIFY"><LI>Press the F5 key on the keyboard</LI></P></UL>
+
+<P ALIGN="JUSTIFY">Execution will resume until a breakpoint is hit or the script completes.</P>
+<P ALIGN="JUSTIFY">&nbsp;</P>
+<OL>
+<OL>
+<OL>
+<OL>
+
+</FONT><B><FONT FACE="Arial" COLOR="#000080"><LI>Break</LI></OL>
+</OL>
+</OL>
+</OL>
+
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">To stop all running scripts and give control to the debugger you may do any of the following:</P>
+
+<UL>
+<P ALIGN="JUSTIFY"><LI>Select the <B><I>Debug-&gt;Break</B></I> menu item on the menu bar</LI></P>
+<P ALIGN="JUSTIFY"><LI>Press the <B><I>Break</B></I> button on the toolbar</LI></P>
+<P ALIGN="JUSTIFY"><LI>Press the Pause/Break key on the keyboard</LI></P></UL>
+
+<OL>
+<OL>
+<OL>
+
+<LI><A NAME="_Toc502165112"></FONT><B><FONT FACE="Arial" COLOR="#000080">Moving Up and Down the Stack</A></LI>
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The lower-left (dockable) pane in the debugger main window contains a combo-box labeled &quot;Context:&quot; which displays the current stack of the executing script. You may move up and down the stack by selecting an entry in the combo-box. When you select a stack frame the variables and watch windows are updated to reflect the names and values of the variables visible at that scope.</P>
+<LI><A NAME="_Toc502165113"></FONT><B><FONT FACE="Arial" COLOR="#000080">Setting and Clearing Breakpoints</A></LI></OL>
+</OL>
+</OL>
+
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The main desktop of the debugger contains file windows which display the contents of each script you are debugging. You may set a breakpoint in a script by doing one of the following:</P>
+
+<UL>
+<P ALIGN="JUSTIFY"><LI>Place the cursor on the line at which you want to set a breakpoint and right-click with the mouse. This action will display a pop-up menu. Select the <B><I>Set Breakpoint</B></I> menu item. </LI></P>
+<P ALIGN="JUSTIFY"><LI>Simply single-click on the line number of the line at which you want to set a breakpoint.</LI></P></UL>
+
+<P ALIGN="JUSTIFY">If the selected line contains executable code a red dot will appear next to the line number and a breakpoint will be set at that location.</P>
+<P ALIGN="JUSTIFY">You may set clear breakpoint in a script by doing one of the following:</P>
+
+<UL>
+<P ALIGN="JUSTIFY"><LI>Place the cursor on the line at which you want to clear a breakpoint and right-click with the mouse. This action will display a pop-up menu. Select the <B><I>Clear Breakpoint</B></I> menu item. </LI></P>
+<P ALIGN="JUSTIFY"><LI>Simply single-click on the red dot or the line number of the line at which you want to clear a breakpoint.</LI></P></UL>
+
+<P ALIGN="JUSTIFY">The red dot will disappear and the breakpoint at that location will be cleared.</P>
+<OL>
+<OL>
+<OL>
+
+<LI><A NAME="_Toc502165114"></FONT><B><FONT FACE="Arial" COLOR="#000080">Viewing Variables</A></LI>
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The lower-left (dockable) pane in the debugger main window contains a tab-pane with two tabs, labeled &quot;this&quot; and &quot;Locals&quot;. Each pane contains a tree-table which displays the properties of the current object and currently visible local variables, respectively. </P>
+<OL>
+
+</FONT><B><FONT FACE="Arial" COLOR="#000080"><LI>This</LI></OL>
+
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The properties of the current object are displayed in the <B><I>this</B></I> table. If a property is itself a JavaScript object the property may be expanded to show its sub-properties. The <B><I>this</B></I> table is updated each time control returns to the debugger or when you change the stack location in the <B><I>Context:</B></I> window.</P>
+<LI><A NAME="_Toc502165115"></FONT><B><FONT FACE="Arial" COLOR="#000080">Locals</A></LI>
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The local variables of the current function are displayed in the <B><I>Locals</B></I> table. If a variable is itself a JavaScript object the variable may be expanded to show its sub-properties. The <B><I>Locals</B></I> table is updated each time control returns to the debugger or when you change the stack location in the <B><I>Context:</B></I> window</P>
+<LI><A NAME="_Toc502165116"></FONT><B><FONT FACE="Arial" COLOR="#000080">Watch Window</A></LI>
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">You may enter arbitrary JavaScript expressions in the <B><I>Watch:</B></I> table located in the lower-right (dockable) pane in the debugger main window. The expressions you enter are reevaluated in the current scope and their current values displayed each time control returns to the debugger or when you change the stack location in the <B><I>Context:</B></I> window.</P>
+<LI><A NAME="_Toc502165117"></FONT><B><FONT FACE="Arial" COLOR="#000080">Evaluation Window</A></LI></OL>
+</OL>
+</OL>
+
+</B></FONT><FONT SIZE=2><P ALIGN="JUSTIFY">The <B><I>Evaluate</B></I> pane located in the lower-right (dockable) pane in the debugger main window contains an editable command line where you may enter arbitrary JavaScript code. The code is evaluated in the context of the current stack frame. The window maintains a history of the commands you have entered. You may move backward or forward through the history by pressing the Up/Down arrow keys on the keyboard. </P>
+</FONT></BODY>
+</HTML>
128 docs/api.html
View
@@ -0,0 +1,128 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Norris Boyd">
+ <meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; U) [Netscape]">
+ <title>JavaScript API</title>
+</head>
+<body bgcolor="#FFFFFF">
+
+<center>
+<h1>
+Rhino API Reference.</h1></center>
+
+<h4>
+The Control API</h4>
+These APIs provide methods for controlling the actions of JavaScript in
+a host environment.
+<ul>
+<li>
+<a href="org/mozilla/javascript/Context.html">Context</a> - Represents
+the runtime context of an executing script. Has methods to associate the
+JavaScript evaluation engine with a Java thread, set attributes of the
+engine, and compile and evaluate scripts.</li>
+
+<li>
+<a href="org/mozilla/javascript/ContextListener.html">ContextListener</a>
+- Allows embeddings to be notified of the creation, entering, exiting,
+and releasing of Contexts. </li>
+
+<li>
+<a href="org/mozilla/javascript/Script.html">Script</a> - The result of
+compiling a JavaScript script. Also encapsulates script execution.</li>
+
+<li>
+<a href="org/mozilla/javascript/ErrorReporter.html">ErrorReporter</a> -
+This interface can be implemented to control the actions the JavaScript
+engine takes when it encounters errors.</li>
+
+<li>
+<a href="org/mozilla/javascript/SecuritySupport.html">SecuritySupport</a>
+- Optional support routines that must be provided by embeddings implementing
+security controls on scripts.</li>
+
+<li>
+<a href="org/mozilla/javascript/Wrapper.html">Wrapper</a> - Interface implemented
+by objects wrapping other objects. Provides a method for recovering the
+wrapped value.</li>
+
+<li>
+<a href="org/mozilla/javascript/WrapHandler.html">WrapHandler</a> - Interface
+embedders can implement in order to control the way Java objects are wrapped
+for use by JavaScript.</li>
+
+<li>
+<a href="org/mozilla/javascript/ClassOutput.html">ClassOutput</a> - Interface
+embedders can implement in order to control the placement of generated
+class bytecodes.</li>
+</ul>
+
+<h4>
+The Host Object API</h4>
+These APIs provide support for adding objects specific to a particular
+embedding of JavaScript in a host environment. Note that if you just want
+to script existing Java classes, you should just use <a href="http://developer.netscape.com/library/documentation/communicator/jsguide4/livecon.htm">LiveConnect</a>.
+It is also helpful to understand some of the implementation of the <a href="runtime.html">runtime</a>.
+<ul>
+<li>
+<a href="org/mozilla/javascript/Scriptable.html">Scriptable</a> - All JavaScript
+objects must implement this interface. Provides methods to access properties
+and attributes of those properties, as well as other services required
+of JavaScript objects.</li>
+
+<li>
+<a href="org/mozilla/javascript/Function.html">Function</a> - All JavaScript
+functions must implement this interface. Extends Scriptable, adding methods
+to support invocation.</li>
+
+<li>
+<a href="org/mozilla/javascript/ScriptableObject.html">ScriptableObject</a>
+- A default implementation of Scriptable that may be extended. Implements
+property and attribute storage and lookup and other default JavaScript
+object behavior.</li>
+
+<li>
+<a href="org/mozilla/javascript/FunctionObject.html">FunctionObject</a>
+- An implementation of Function that allows Java methods and constructors
+to be used as JavaScript function objects.</li>
+
+<li>
+<a href="org/mozilla/javascript/ImporterTopLevel.html">ImporterTopLevel</a>
+- Allows embeddings to use the importClass and importPackage functions.</li>
+</ul>
+
+<h4>
+Exceptions</h4>
+These exceptions are thrown by JavaScript.
+<ul>
+<li>
+<a href="org/mozilla/javascript/JavaScriptException.html">JavaScriptException</a>
+- Thrown from within JavaScript by the JavaScript 'throw' statement, or
+by LiveConnect calls from JavaScript into Java. Wraps a JavaScript value.</li>
+
+<li>
+<a href="org/mozilla/javascript/ClassDefinitionException.html">ClassDefinitionException</a>
+- Thrown if errors are detected while attempting to define a host object
+from a Java class.</li>
+
+<li>
+<a href="org/mozilla/javascript/PropertyException.html">PropertyException</a>
+- Thrown if errors are detected while attempting to define a property of
+a host object from a Java class or method, or if a property is not found.</li>
+
+<li>
+<a href="org/mozilla/javascript/NotAFunctionException.html">NotAFunctionException</a>
+- Thrown when attempting to call an object that is not a function.</li>
+
+<li>
+<a href="org/mozilla/javascript/EvaluatorException.html">EvaluatorException</a>
+- An exception thrown when an error is detected during the execution of
+a script. The default error reporter will throw EvaluatorExceptions when
+an error is encountered.</li>
+</ul>
+
+<hr WIDTH="100%">
+<br><a href="overview-summary.html">back to top</a>
+</body>
+</html>
43 docs/bsf.html
View
@@ -0,0 +1,43 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Norris Boyd">
+ <meta name="GENERATOR" content="Mozilla/4.75 [en] (WinNT; U) [Netscape]">
+ <meta name="KeyWords" content="Rhino, JavaScript, Java, BSF, Apache">
+ <title>Rhino and BSF</title>
+</head>
+<body bgcolor="#FFFFFF">
+<script src="owner.js"></script>
+
+<center>
+<h1>
+Using Rhino with BSF and Apache</h1></center>
+<script>document.write(owner());</script>
+
+<br><script>
+ var d = new Date(document.lastModified);
+ document.write((d.getMonth()+1)+"/"+d.getDate()+"/"+d.getFullYear());
+ document.write('<br>');
+</script>
+
+<hr WIDTH="100%">
+<br>The <a href="http://oss.software.ibm.com/developerworks/projects/bsf">Bean
+Scripting Framework</a> (or BSF) was originally developed by IBM and now
+published as open source. It provides a framework for using a number of
+scripting languages with Java. Rhino is one of the supported languages.
+<p>This framework has been embedded in a number of open source projects,
+including the XSL processor <a href="http://xml.apache.org/xalan/index.html">Xalan</a>
+and the XML/Java build tool <a href="http://jakarta.apache.org/ant/index.html">Ant</a>.
+<p>You can download a version of <tt>bsf.jar</tt> from <a href="http://oss.software.ibm.com/developerworks/projects/bsf">http://oss.software.ibm.com/developerworks/projects/bsf</a>
+that includes the <tt>com.ibm.bsf.engines.javascript.JavaScriptEngine</tt>
+class. The current version is 2.2 release candidate at the time of this
+writing. This version thus supports JavaScript through Rhino when used
+with the <tt>js.jar</tt> file from either <tt>rhino15R1.zip</tt> or <tt>rhinoTip.zip</tt>.
+<p>See <a href="http://xml.apache.org/xalan/extensions.html#ex-basic">Xalan-Java
+Extensions</a> for more information on adding JavaScript to XSL and the
+<a href="http://jakarta.apache.org/ant/jakarta-ant/docs/#script">Script
+task</a> for using scripting in Ant build files.
+<p><a href="index.html">back to top</a>
+</body>
+</html>
129 docs/changes.html
View
@@ -0,0 +1,129 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Norris Boyd">
+ <meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; U) [Netscape]">
+ <meta name="KeyWords" content="Rhino, JavaScript, Java">
+ <title>Change Log</title>
+</head>
+<body bgcolor="#FFFFFF">
+
+<center>
+<h1>
+Change Log for Significant Rhino Changes</h1></center>
+This is a log of significant changes since the release of Rhino 1.5 Release
+1.
+<h2>
+Script Debugger</h2>
+Well, there were a couple of rainy days on my vacation last week, so
+<br>I've written the core of a debugger for the interpretive mode of Rhino.
+<br>It just uses a simple command-line interface when invoked with "-debug"
+<br>on the command line. "#" is the debugger prompt; entering "#" at the
+<br>shell prompt drops you into the debugger (rginda's idea).
+<p>For an example, consider the file test.js:
+<blockquote><tt>function f(a) {</tt>
+<br><tt>&nbsp;return g(a+1);</tt>
+<br><tt>}</tt><tt></tt>
+<p><tt>function g(a) {</tt>
+<br><tt>&nbsp;return h(a+1);</tt>
+<br><tt>}</tt><tt></tt>
+<p><tt>function h(a) {</tt>
+<br><tt>&nbsp;return a+1;</tt>
+<br><tt>}</tt><tt></tt>
+<p><tt>function t(a) {</tt>
+<br><tt>&nbsp;throw a;</tt>
+<br><tt>}</tt></blockquote>
+We can debug it as follows:
+<p><tt>[rhino] java org.mozilla.javascript.tools.shell.Main -debug</tt>
+<br><tt># c</tt>
+<br><tt>js> load("test.js")</tt>
+<br><tt>js> #</tt>
+<br><tt># b g</tt>
+<br><tt>Breakpoint placed at line 5</tt>
+<br><tt>5: function g(a) {</tt>
+<br><tt># c</tt>
+<br><tt>js> f(0)</tt>
+<br><tt>Hit breakpoint at function g ("test.js"; line 5)</tt>
+<br><tt>5: function g(a) {</tt>
+<br><tt># where</tt>
+<br><tt>function g ("test.js"; line 5)</tt>
+<br><tt>5: function g(a) {</tt>
+<br><tt>function f ("test.js"; line 2)</tt>
+<br><tt>2:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return g(a+1);</tt>
+<br><tt>script ("&lt;stdin>"; line 2)</tt>
+<br><tt># n</tt>
+<br><tt>6:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return h(a+1);</tt>
+<br><tt># s</tt>
+<br><tt>9: function h(a) {</tt>
+<br><tt>#</tt>
+<br><tt>10:&nbsp;&nbsp;&nbsp;&nbsp; return a+1;</tt>
+<br><tt># p a</tt>
+<br><tt>2</tt>
+<br><tt># c</tt>
+<br><tt>3</tt>
+<br><tt>js> t("a string")</tt>
+<br><tt>Encountered exception a string in function t ("test.js"; line 14)</tt>
+<br><tt>14:&nbsp;&nbsp;&nbsp;&nbsp; throw a;</tt><tt></tt>
+<p><tt># p a</tt>
+<br><tt>a string</tt>
+<br><tt># p typeof a</tt>
+<br><tt>string</tt>
+<br><tt># c</tt>
+<br><tt>Encountered exception a string in script ("&lt;stdin>"; line 3)</tt><tt></tt>
+<p><tt># c</tt>
+<br><tt>js: "&lt;stdin>", line 1: uncaught JavaScript exception: a string</tt>
+<br><tt>js></tt>
+<p>I'm hoping this initial work I've done will encourage others to go in
+<br>and complete it. The debugger shell itself is pretty simple-minded
+in
+<br>the way that it works: you can say "b" but not "br" or "break", for
+<br>instance. There are also missing features like removing breakpoints.
+I
+<br>hope the modifications to the core engine are sufficient, although
+I'm
+<br>not happy with the way that source is handled for printing out. And
+of
+<br>course it would be great if someone with some UI skill (i.e., not me)
+<br>could write a swing-based ui for debugging scripts.
+<br>&nbsp;
+<br>&nbsp;
+<h2>
+FlattenedObject deprecated</h2>
+I wrote FlattenedObject to provide a means for dealing with JavaScript
+<br>objects in prototype chains. Where Scriptable defines the primitive
+<br>operations, FlattenedObject defines the aggregate operations of
+<br>manipulating properties that may be defined in an object or in an object
+<br>reachable by a succession of getPrototype calls.
+<p>However, I now believe that I designed FlattenedObject poorly. Perhaps
+<br>it should have been a clue that I was never satisfied with the name:
+if
+<br>it's hard to express the name of the object it may mean the function
+the
+<br>object is supposed to fulfill is not well defined either. The problem
+is
+<br>that it is inefficient since it requires an extra object creation,
+and
+<br>balky because of that extra level of wrapping.
+<p>So I've checked in changes that deprecate FlattenedObject. I've
+<br>introduced new static methods in ScriptableObject (thanks to
+<br>beard@netscape.com for the idea) that replace the functionality. These
+<br>methods perform the get, put, and delete operations on a Scriptable
+<br>object passed in without the overhead of creating a new object.
+<h2>
+WrapHandler interface</h2>
+Embeddings that wish to provide their own custom wrappings for Java objects
+may implement this interface and
+<br>call Context.setWrapHandler. See WrapHandler javadoc.
+<br>&nbsp;
+<h2>
+ClassOutput interface</h2>
+An interface embedders can implement in order to control the placement
+of generated class bytecodes. See the javadoc.
+<h3>
+
+<hr WIDTH="100%"><br>
+<a href="index.html">back to top</a></h3>
+
+</body>
+</html>
98 docs/debugApi.html
View
@@ -0,0 +1,98 @@
+<html>
+<head>
+<title>Debugger API for Rhino</title>
+</head>
+<body bgcolor="#FFFFFF">
+<h1><center>Debugger API for Rhino</center></h1>
+<p>
+<font color="red"><center>This release of the Debugger API should be considered to be of Beta quality.</center></font>
+<p>
+The Debugger API for Rhino consists of a set of Java interfaces
+which describes a high level debugger API and a default implementation of that
+API.
+<p>
+Most of the API is in the <code>com.netscape.javascript.debug</code> package. It is built
+upon low-level support built into the core engine in <code>com.netscape.javascript</code>.
+<p>
+The <code>com.netscape.javascript.debug</code> package includes an implementation of the Debugger API
+interfaces outlined below. The class <code>com.netscape.javascript.debug.DebugManager.java</code>
+implements the <a href="com/netscape/javascript/debug/IDebugManager.html">IDebugManager</a>
+interface and <code>com.netscape.javascript.debug.SourceTextManagerImpl.java</code> implements
+the <a href="com/netscape/javascript/SourceTextManager.html">SourceTextManager</a> interface.
+<p>
+The class <code>com.netscape.javascript.tools.shell.Main.java</code> provides an
+example which invokes the Debugger API.
+<p>
+<hr>
+<p>
+The core interface of the API is <a href="com/netscape/javascript/debug/IDebugManager.html">IDebugManager</a>.
+This interface provide the central point for interacting with the debug system.
+It supports the setting of the following hooks:
+<ul>
+<li><a href="com/netscape/javascript/debug/IInterruptHook.html">IInterruptHook</a> for immediate interrupt.
+<li><a href="com/netscape/javascript/debug/IInstructionHook.html">IInstructionHook</a> for breakpoints.
+<li><a href="com/netscape/javascript/debug/IDebugBreakHook.html">IDebugBreakHook</a> for breaking on errors.
+<li><a href="com/netscape/javascript/debug/IErrorReporter.html">IErrorReporter</a> for hooking into the error reporter system.
+<li><a href="com/netscape/javascript/debug/IScriptHook.html">IScriptHook</a> for notification of script and function load and unload.
+</ul>
+Customers of the Debugger API can provide implementations of these hook
+interfaces which can be passed to the <i>IDebugManager</i> in order receive
+notification of the various events within the core JavaScript engine.
+<p>
+When hooks are called they are passed appropriate objects which are implemented
+by the Debugger API to describe such things as <i>stack frames</i>,
+<i> program counter locations</i>, etc. The interfaces for these objects are:
+<ul>
+<li><a href="com/netscape/javascript/debug/IThreadState.html">IThreadState</a> representing the state of the stopped thread.
+<li><a href="com/netscape/javascript/debug/IStackFrame.html">IStackFrame</a> representing a stack frame.
+<li><a href="com/netscape/javascript/debug/IPC.html">IPC</a> representing a program counter location.
+<li><a href="com/netscape/javascript/debug/IScript.html">IScript</a> representing a compiled JavaScript script or function.
+<li><a href="com/netscape/javascript/debug/ISourceLocation.html">ISourceLocation</a> representing a location in the souce code.
+</ul>
+<p>
+<hr>
+<p>
+<a href="com/netscape/javascript/SourceTextManager.html">SourceTextManager</a>
+is an interface used to supply a centralized location from which a debugger
+client can access JavaScript source. It supports capturing source as it is
+parsed by <i>Rhino</i>. Alternately, source can be fed to it by the
+embedding; e.g. in a browser embedding where the JavaScript code is just a
+part of the html source the browser can feed the entire source to the
+<i>SourceTextManager</i> so that a debugger can 'see' the whole source and
+not just the part that is fed to the JavaScript compiler.
+<p>
+<a href="com/netscape/javascript/SourceTextItem.html">SourceTextItem</a> is an
+interface representing a single 'block' of source code text (typically this
+is an entire source file). This may be pure JavaScript source, or may include
+JavaScript source embedded in html or whatever. The point is that this is the
+text that a debugger should show to a user while debugging the JavaScript code.
+This interface supports incrementally updated content. This is specifically
+useful in browser embeddings where text is received in blocks. In fact, in a
+browser it is possible that some of the source on a page may be compiled
+and run even before the entire content of the page has been received from a
+server.
+<p>
+<hr>
+<p>
+<a href="com/netscape/javascript/debug/ILaunchableDebugger.html">ILaunchableDebugger</a>
+is an interface that abstractly represents a debugger user interface. It is
+defined to allow an embedding to request that a debugger be launched without
+requiring that the embedding be coupled at compile time to a particular debugger
+implementation.
+<p>
+<hr>
+<h3>Limitations and unimplemented features</h3>
+<ul>
+<li>Data Watchpoints are not implemented.
+<li>Catching exceptions thrown in JavaScript code is not implemented.
+<li>Per context hooking is not implemented.
+<li>Setting the debug level to any non-zero value forces the optimization level to zero.
+<li>Tracking of calls to plain Java methods from JavaScript is not implemented.
+<li>Running at debug level >= 6 causes JIT errors with the Symantec JVM (but no other JVMs)
+<li>The Debug API has not been rigorously tested.
+</ul>
+<p>
+<hr WIDTH="100%">
+<br><A HREF="overview-summary.html">back to top</A>
+</body>
+</html>
361 docs/debugger.html
View
@@ -0,0 +1,361 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Norris Boyd">
+ <meta name="GENERATOR" content="Mozilla/4.75 [en] (WinNT; U) [Netscape]">
+ <meta name="KeyWords" content="Rhino, JavaScript, Java, Debugger">
+ <title>Rhino Debugger</title>
+</head>
+<body bgcolor="#FFFFFF">
+<script src="owner.js"></script>
+
+<center>
+<h1>
+Rhino JavaScript Debugger</h1></center>
+Christopher Oliver
+<br><script>document.write(owner());</script>
+
+<br><script>
+ var d = new Date(document.lastModified);
+ document.write((d.getMonth()+1)+"/"+d.getDate()+"/"+d.getFullYear());
+ document.write('<br>');
+</script>
+
+<center>
+<hr WIDTH="100%"></center>
+The Rhino JavaScript debugger is a GUI that allows debugging of interpreted
+JavaScript scripts run in Rhino. Note that this debugger <i>will not</i>
+work with JavaScript scripts run in the mozilla browser since Rhino is
+not the engine used in such environments.
+<p><img SRC="jsdebug.jpg" height=460 width=600>
+<p>Current limitations:
+<ul>
+<li>
+Requires JDK 1.2</li>
+
+<li>
+Requires rhinoTip.jar</li>
+
+<li>
+No breakpoint menu</li>
+</ul>
+<b><font face="Arial"><font color="#000080"><font size=+2>Using the Rhino
+JavaScript Debugger</font></font></font></b>
+<ol>&nbsp;
+<br><font size=-1>The Mozilla Rhino JavaScript engine includes a source-level
+debugger for debugging JavaScript scripts. The debugger is itself a Java
+program which you may run as</font>
+<p><font face="Arial"><font size=-1>java org.mozilla.javascript.tools.debugger.JSDebugger
+[options] [filename.js] [script-arguments]</font></font>
+<p><font size=-1>where the options are the same as the shell.</font>
+<ol>
+<li>
+<a NAME="_Toc502165108"></a><b><font face="Arial"><font color="#000080"><font size=+1>Features</font></font></font></b></li>
+
+<br>&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<p><font size=-1>The Rhino JavaScript Debugger can debug scripts running
+in multiple threads and provides facilities to set and clear breakpoints,
+control execution, view variables, and evaluate arbitrary JavaScript code
+in the current scope of an executing script.</font>
+<ol>
+<li>
+<a NAME="_Toc502165109"></a><b><font face="Arial"><font color="#000080"><font size=-1>Console
+Window</font></font></font></b></li>
+
+<br>&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<p><font size=-1>The debugger redirects the <font face="Arial">System.out</font>,
+<font face="Arial">System.in</font>,
+and <font face="Arial">System.err</font> streams to an internal JavaScript
+console window which provides an editable command line for you to enter
+JavaScript code and view system output. The console window maintains a
+history of the commands you have entered. You may move backward and forward
+through the history list by pressing the Up/Down arrow keys on the keyboard.</font>
+<li>
+<a NAME="_Toc502165110"></a><b><font face="Arial"><font color="#000080"><font size=-1>Opening
+Scripts</font></font></font></b></li>
+
+<br>&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<p><font size=-1>You may select the <b><i>File->Open</i></b> menu item
+on the menu bar to load JavaScript scripts contained in files. This action
+will display a file-selection dialog box prompting you for the location
+of a script to load. The selected file will be compiled and displayed in
+a new window.</font>
+<li>
+<b><font face="Arial"><font color="#000080">Running Scripts</font></font></b></li>
+
+<br>&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<p><font size=-1>You may select the <b><i>File->Run</i></b> menu item on
+the menu bar to execute JavaScript scripts contained in files. This action
+will display a file-selection dialog box prompting you for the location
+of a script to execute. The loaded script will be run in a new thread and
+control will be given to the debugger on its first instruction.</font>
+<li>
+<a NAME="_Toc502165111"></a><b><font face="Arial"><font color="#000080"><font size=-1>Controlling
+Execution</font></font></font></b></li>
+
+<br>&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<p><font size=-1>The debugger provides the following facilities for you
+to control the execution of scripts you are debugging:</font>
+<ol>
+<li>
+<b><font face="Arial"><font color="#000080">Step Into</font></font></b></li>
+</ol>
+</ol>
+</ol>
+</ol>
+<font size=-1>To single step entering any function calls, you may do any
+of the following:</font>
+<ul>
+<li>
+<font size=-1>Select the <b><i>Debug->Step Into </i></b>menu item on the
+menu bar</font></li>
+
+<li>
+<font size=-1>Press the <b><i>Step Into</i></b> button on the toolbar</font></li>
+
+<li>
+<font size=-1>Press the F11 key on the keyboard</font></li>
+</ul>
+<font size=-1>Execution will resume. If the current line in the script
+contains a function call control will return to the debugger upon entry
+into the function. Otherwise control will return to the debugger at the
+next line in the current function.</font>
+<ol>
+<ol>
+<ol>
+<ol>
+<li>
+<b><font face="Arial"><font color="#000080">Step Over</font></font></b></li>
+</ol>
+</ol>
+</ol>
+</ol>
+<font size=-1>To single step to the next line in the current function,
+you may do any of the following:</font>
+<ul>
+<li>
+<font size=-1>Select the <b><i>Debug->Step Over</i></b> menu item on the
+menu bar</font></li>
+
+<li>
+<font size=-1>Press the <b><i>Step Over</i></b> button on the toolbar</font></li>
+
+<li>
+<font size=-1>Press the F7 key on the keyboard</font></li>
+</ul>
+<font size=-1>Execution will resume but control will return to the debugger
+at the next line in the current function or top-level script.</font>
+<ol>
+<ol>
+<ol>
+<ol>
+<li>
+<b><font face="Arial"><font color="#000080">Step Out</font></font></b></li>
+</ol>
+</ol>
+</ol>
+</ol>
+<font size=-1>To continue execution until the current function returns
+you may do any of the following:</font>
+<ul>
+<li>
+<font size=-1>Select the <b><i>Debug->Step Out</i></b> menu item on the
+menu bar</font></li>
+
+<li>
+<font size=-1>Press the <b><i>Step Out</i></b> button on the toolbar</font></li>
+
+<li>
+<font size=-1>Press the F8 key on the keyboard</font></li>
+</ul>
+<font size=-1>Execution will resume until the current function returns
+or a breakpoint is hit.</font>
+<ol>
+<ol>
+<ol>
+<ol>
+<li>
+<b><font face="Arial"><font color="#000080">Go</font></font></b></li>
+</ol>
+</ol>
+</ol>
+</ol>
+<font size=-1>To resume execution of a script you may do any of the following:</font>
+<ul>
+<li>
+<font size=-1>Select the <b><i>Debug->Go</i></b> menu item on the menu
+bar</font></li>
+
+<li>
+<font size=-1>Press the <b><i>Go</i></b> button on the toolbar</font></li>
+
+<li>
+<font size=-1>Press the F5 key on the keyboard</font></li>
+</ul>
+<font size=-1>Execution will resume until a breakpoint is hit or the script
+completes.</font>
+<br>&nbsp;
+<br>&nbsp;
+<ol>
+<ol>
+<ol>
+<ol>
+<li>
+<b><font face="Arial"><font color="#000080">Break</font></font></b></li>
+</ol>
+</ol>
+</ol>
+</ol>
+<font size=-1>To stop all running scripts and give control to the debugger
+you may do any of the following:</font>
+<ul>
+<li>
+<font size=-1>Select the <b><i>Debug->Break</i></b> menu item on the menu
+bar</font></li>
+
+<li>
+<font size=-1>Press the <b><i>Break</i></b> button on the toolbar</font></li>
+
+<li>
+<font size=-1>Press the Pause/Break key on the keyboard</font></li>
+</ul>
+
+<ol>
+<ol>
+<ol>
+<li>
+<a NAME="_Toc502165112"></a><b><font face="Arial"><font color="#000080"><font size=-1>Moving
+Up and Down the Stack</font></font></font></b></li>
+
+<br>&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<p><font size=-1>The lower-left (dockable) pane in the debugger main window
+contains a combo-box labeled "Context:" which displays the current stack
+of the executing script. You may move up and down the stack by selecting
+an entry in the combo-box. When you select a stack frame the variables
+and watch windows are updated to reflect the names and values of the variables
+visible at that scope.</font>
+<li>
+<a NAME="_Toc502165113"></a><b><font face="Arial"><font color="#000080"><font size=-1>Setting
+and Clearing Breakpoints</font></font></font></b></li>
+</ol>
+</ol>
+</ol>
+<font size=-1>The main desktop of the debugger contains file windows which
+display the contents of each script you are debugging. You may set a breakpoint
+in a script by doing one of the following:</font>
+<ul>
+<li>
+<font size=-1>Place the cursor on the line at which you want to set a breakpoint
+and right-click with the mouse. This action will display a pop-up menu.
+Select the <b><i>Set Breakpoint</i></b> menu item.</font></li>
+
+<li>
+<font size=-1>Simply single-click on the line number of the line at which
+you want to set a breakpoint.</font></li>
+</ul>
+<font size=-1>If the selected line contains executable code a red dot will
+appear next to the line number and a breakpoint will be set at that location.</font>
+<p><font size=-1>You may set clear breakpoint in a script by doing one
+of the following:</font>
+<ul>
+<li>
+<font size=-1>Place the cursor on the line at which you want to clear a
+breakpoint and right-click with the mouse. This action will display a pop-up
+menu. Select the <b><i>Clear Breakpoint</i></b> menu item.</font></li>
+
+<li>
+<font size=-1>Simply single-click on the red dot or the line number of
+the line at which you want to clear a breakpoint.</font></li>
+</ul>
+<font size=-1>The red dot will disappear and the breakpoint at that location
+will be cleared.</font>
+<ol>
+<ol>
+<ol>
+<li>
+<a NAME="_Toc502165114"></a><b><font face="Arial"><font color="#000080"><font size=-1>Viewing
+Variables</font></font></font></b></li>
+
+<br>&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<p><font size=-1>The lower-left (dockable) pane in the debugger main window
+contains a tab-pane with two tabs, labeled "this" and "Locals". Each pane
+contains a tree-table which displays the properties of the current object
+and currently visible local variables, respectively.</font>
+<ol>
+<li>
+<b><font face="Arial"><font color="#000080">This</font></font></b></li>
+</ol>
+<font size=-1>The properties of the current object are displayed in the
+<b><i>this</i></b>
+table. If a property is itself a JavaScript object the property may be
+expanded to show its sub-properties. The <b><i>this</i></b> table is updated
+each time control returns to the debugger or when you change the stack
+location in the <b><i>Context:</i></b> window.</font>
+<li>
+<a NAME="_Toc502165115"></a><b><font face="Arial"><font color="#000080"><font size=-1>Locals</font></font></font></b></li>
+
+<br>&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<p><font size=-1>The local variables of the current function are displayed
+in the <b><i>Locals</i></b> table. If a variable is itself a JavaScript
+object the variable may be expanded to show its sub-properties. The <b><i>Locals</i></b>
+table is updated each time control returns to the debugger or when you
+change the stack location in the <b><i>Context:</i></b> window</font>
+<li>
+<a NAME="_Toc502165116"></a><b><font face="Arial"><font color="#000080"><font size=-1>Watch
+Window</font></font></font></b></li>
+
+<br>&nbsp;
+<p>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<p><font size=-1>You may enter arbitrary JavaScript expressions in the
+<b><i>Watch:</i></b>
+table located in the lower-right (dockable) pane in the debugger main window.
+The expressions you enter are reevaluated in the current scope and their
+current values displayed each time control returns to the debugger or when
+you change the stack location in the <b><i>Context:</i></b> window.</font>
+<li>
+<a NAME="_Toc502165117"></a><b><font face="Arial"><font color="#000080"><font size=-1>Evaluation
+Window</font></font></font></b></li>
+</ol>
+</ol>
+</ol>
+<font size=-1>The <b><i>Evaluate</i></b> pane located in the lower-right
+(dockable) pane in the debugger main window contains an editable command
+line where you may enter arbitrary JavaScript code. The code is evaluated
+in the context of the current stack frame. The window maintains a history
+of the commands you have entered. You may move backward or forward through
+the history by pressing the Up/Down arrow keys on the keyboard.</font>
+<br>&nbsp;
+<h3>
+
+<hr WIDTH="100%"><br>
+<a href="index.html">back to top</a></h3>
+
+</body>
+</html>
149 docs/doc.html
View
@@ -0,0 +1,149 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Norris Boyd">
+ <meta name="GENERATOR" content="Mozilla/4.75 [en] (WinNT; U) [Netscape]">
+ <meta name="KeyWords" content="Rhino, JavaScript, Java">
+ <title>Rhino Documentation</title>
+</head>
+<body bgcolor="#FFFFFF">
+
+<center>
+<h1>
+Rhino Documentation</h1></center>
+<b><i><font size=+1>General</font></i></b>
+<table WIDTH="100%" >
+<tr>
+<td><a href="overview.html">Overview</a></td>
+
+<td>An overview of the JavaScript language and of Rhino.</td>
+</tr>
+
+<tr>
+<td><a href="limits.html">Requirements and Limitations</a></td>
+
+<td>What you must have to run Rhino; what Rhino cannot do.</td>
+</tr>
+
+<tr>
+<td><a href="debugger.html">Rhino Debugger</a></td>
+
+<td>A debugger for debugging JavaScript running in Rhino.</td>
+</tr>
+
+<tr>
+<td><a href="opt.html">Optimization</a></td>
+
+<td>Details on the various optimization levels.</td>
+</tr>
+
+<tr>
+<td><a href="http://sourceforge.net/projects/jscorba">JS/CORBA Adapter</a></td>
+
+<td>Provides a mechanism for arbitrary JavaScript objects to interact with
+each other transparently in a distributed JavaScript system using CORBA.</td>
+</tr>
+
+<tr>
+<td><a href="bsf.html">Using Rhino with BSF and Apache</a></td>
+
+<td>How to use Rhino with apps that support BSF.</td>
+</tr>
+
+<tr>
+<td><a href="changes.html">Recent Changes</a></td>
+
+<td>Describes recent changes to Rhino.</td>
+</tr>
+
+<tr>
+<td><a href="faq.html">FAQ</a></td>
+
+<td>Answers to frequently asked questions about Rhino.</td>
+</tr>
+
+<tr>
+<td><a href="http://industry.java.sun.com/javaone/99/event/0,1768,629,00.html">1999
+JavaOne session on Rhino</a></td>
+
+<td>A talk on Rhino with slides. Also see the
+<a href="javaone.html">followup</a>.</td>
+</tr>
+</table>
+
+<p><b><i><font size=+1>Writing Scripts</font></i></b>
+<table WIDTH="100%" >
+<tr>
+<td><a href="scriptjava.html">Scripting Java</a></td>
+
+<td>How to use Rhino to script Java classes.</td>
+</tr>
+
+<tr>
+<td><a href="perf.html">Performance Hints</a></td>
+
+<td>Some tips on writing faster JavaScript code.</td>
+</tr>
+
+<tr>
+<td><a href="tools.html">Tools</a></td>
+
+<td>Some tools for developing JavaScript scripts.</td>
+</tr>
+</table>
+
+<p><b><i><font size=+1>Embedding Rhino</font></i></b>
+<table WIDTH="100%" >
+<tr>
+<td><a href="tutorial.html">Embedding tutorial</a></td>
+
+<td>A short tutorial on how to embed Rhino into your application.</td>
+</tr>
+
+<tr>
+<td><a href="../js/rhino/index.html">API javadoc Reference</a></td>
+
+<td>An annotated outline of the programming interface to Rhino (tip only).</td>
+</tr>
+
+<tr>
+<td><a href="scopes.html">Scopes and Contexts</a></td>
+
+<td>Describes how to use scopes and contexts for the best performance and
+flexibility, with an eye toward multithreaded environments.</td>
+</tr>
+
+<tr>
+<td><a href="runtime.html">Runtime</a></td>
+
+<td>A brief description of the JavaScript runtime.</td>
+</tr>
+
+<tr>
+<td><a href="footprint.html">Small Footprint</a></td>
+
+<td>Hints for those interested in small-footprint embeddings.</td>
+</tr>
+
+<tr>
+<td><a href="examples.html">Examples</a></td>
+
+<td>A set of examples showing how to control the JavaScript engine and
+build JavaScript host objects.</td>
+</tr>
+
+<tr>
+<td><font color="#000000"><a href="http://www.mozilla.org/js/tests/library.html">Testing
+</a></font></td>
+
+<td>How to run the JavaScript test suite.</td>
+</tr>
+</table>
+
+<h3>
+
+<hr WIDTH="100%"><a href="index.html">back to top</a></h3>
+
+</body>
+</html>
59 docs/download.html
View
@@ -0,0 +1,59 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Norris Boyd">
+ <meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; U) [Netscape]">
+ <title>Rhino Downloads</title>
+</head>
+<body>
+
+<center><b><font size=+3>Rhino Downloads</font></b></center>
+
+<p>Rhino is available for download both in source and compiled form.
+<h3>
+Binaries</h3>
+You can download binaries (JAR files) from <a href="ftp://ftp.mozilla.org/pub/js/">ftp://ftp.mozilla.org/pub/js/</a>.
+Rhino 1.5 is the last qualified release. The current Rhino tip reflects
+the latest checkins and bug fixes, but has not been fully qualified. These
+zip files also include the source.
+<p>For people looking for <tt>js.jar</tt> for XSLT or for IBM's Bean Scripting
+Framework (BSF), download one of the zip files below and unzip it.
+<ul>
+<li>
+<a href="ftp://ftp.mozilla.org/pub/js/rhino15R1.zip">Rhino 1.5.</a></li>
+
+<ul>
+<li>
+<i><font size=-1><a href="js15.html">Description of changes from 1.4R3</a></font></i>.</li>
+</ul>
+
+<li>
+<a href="ftp://ftp.mozilla.org/pub/js/rhino14R3.zip">Rhino 1.4 Release
+3</a>.</li>
+
+<li>
+<a href="ftp://ftp.mozilla.org/pub/js/rhinoTip.zip">Current Rhino tip</a>.</li>
+
+<ul>
+<li>
+<i><font size=-1><a href="changes.html">Description of changes from 1.5</a></font></i>.</li>
+</ul>
+</ul>
+
+<h3>
+Source</h3>
+The source code for Rhino is available under <a href="http://www.mozilla.org/NPL/">NPL
+1.1</a>. In addition to getting the source from the zip files above, the
+source code for Rhino can be found in the CVS tree at mozilla/js/rhino.
+See&nbsp; <a href="http://www.mozilla.org/cvs.html">source code via cvs</a>
+for details on how to set up CVS, define your CVSROOT, and login. Once
+you've done that, just execute the command
+<pre>&nbsp;&nbsp;&nbsp; cvs co mozilla/js/rhino</pre>
+to get the tip source.
+<p>The current tip can also be viewed using LXR at <a href="http://lxr.mozilla.org/mozilla/source/js/rhino/">http://lxr.mozilla.org/mozilla/source/js/rhino/</a>.
+<p>
+<hr WIDTH="100%"><a href="index.html">back to top</a>
+<br>&nbsp;
+</body>
+</html>
278 docs/embedding-engine.html
View
@@ -0,0 +1,278 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Generator" content="Microsoft Word 97">
+ <meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; U) [Netscape]">
+ <title>Embedding ‘Scripting Host’ in Business Applications</title>
+</head>
+<body link="#0000FF">
+<b><font face="Arial"><font size=-1>Embedding
+‘Scripting Host’ in Business Applications</font></font></b>
+<p><b><font face="Arial"><font size=-1>Madhukumar Seshadri, <a href="http://www.cognizant.com)/">www.cognizant.com</a></font></font></b>
+<br>&nbsp;
+<br>&nbsp;
+<p><font face="Arial"><font size=-1>With web browsers, continuing to rule
+the human interface for applications, creating value by being ubiquitous,
+few adoptions of rich technology that’s getting brewed underneath, will
+help designing business applications even though most of the current ones
+are made with bird’s eye of the underlying technologies.</font></font>
+<p><font face="Arial"><font size=-1>JavaScript is a scripting language
+invented and developed by Netscape. The language was primarily designed
+for creating lightweight programming for web browser extensions by exposing
+the Document Object Model of an HTML page to the scripts. JavaScript is
+becoming object oriented and getting adopted for server-side scripting.</font></font>
+<p><font face="Arial"><font size=-1>JavaScript is also becoming a standard
+in the scripting world as Netscape is working closely with ECMA (European
+Computer Manufacturers Association) to make it as a standard scripting
+language for the script world. The standards are published as ECMA Script.</font></font>
+<p><font face="Arial"><font size=-1>JavaScript originally designed for
+exposing the DOM (Document Object Model) standardized by World Wide Web
+consortium (W3C), to help web page designers to control and manipulate
+the pages dynamically. ‘JavaScript’ engines were embedded in the browsers
+and they execute those portions of the code embedded in the HTML pages.</font></font>
+<p><font face="Arial"><font size=-1>In short, JavaScript engine embedded
+in the browser allowed extensions or manipulations for DOM Object run time
+for the HTML page by executing the ‘scripts’ associated with them. In other
+words, browser exposes its DOM object for the page to scripts for extensions
+and dynamic manipulations of the same, using a language that the script
+interpreter understands.</font></font>
+<p><font face="Arial"><font size=-1>Can I do the same for my application
+by exposing my custom business objects written in my middle-tier? Can I
+allow user to my write JavaScript extensions for my objects and also be
+host for executing those scripts?</font></font>
+<p><font face="Arial"><font size=-1>JavaScript host runs times are available
+as binaries written in major languages. Check out <a href="http://www.mozilla.org/js">www.mozilla.org/js</a>.
+Spider Monkey and Rhino are open source JavaScripting engines available
+from mozilla.</font></font>
+<p><font face="Arial"><font size=-1>Microsoft implementation of ECMA Script
+(ECMA Script is based on core JavaScript, created by Netscape) is called
+JScript. Microsoft binaries of jscript engine can be downloaded from http://msdn.microsoft.com/scripting/.</font></font>
+<p><font face="Arial"><font size=-1>This document doesn’t explain the JavaScript
+language in detail but explains how these scripting engines can be used
+as host to expose business objects in the middle-tier and how the user
+of these applications can extend it if needed using JavaScript.</font></font>
+<p><font face="Arial"><font size=-1>The scripting engine Rhino (<a href="http://www.mozilla.org/js)">www.mozilla.org/rhino)</a>,
+a javascript engine purely written in Java is one that I am going to use
+for the testing the above.</font></font>
+<p><font face="Arial"><font size=-1>Let us set some simple goals,</font></font>
+<ul>
+<li>
+<font face="Arial"><font size=-1>Execute a plain ‘JavaScript’ code and
+use static Java object</font></font></li>
+
+<li>
+<font face="Arial"><font size=-1>Instantiate external objects (written
+in Java) from the script and use them within the script</font></font></li>
+</ul>
+
+<br>&nbsp;
+<br>&nbsp;
+<p><font face="Arial"><font size=-1>Let us write a simple Javscript to
+test the above set goals,</font></font>
+<p><font face="Arial"><font size=-1><b>Fig 1</b> – jshosttest.js</font></font>
+<p><b><i><font face="Arial"><font size=-1>/* Test 1 */</font></font></i></b>
+<br><b><i><font face="Arial"><font size=-1>/* Use a static Java Object
+in the script */</font></font></i></b>
+<p><font face="Arial"><font size=-1>function test1() {</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; var str;</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; str = '"Hello World";</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; return str;</font></font>
+<br><font face="Arial"><font size=-1>}</font></font>
+<p><font face="Arial"><font size=-1>var str = test1( );</font></font>
+<br><font face="Arial"><font size=-1>//out is expected to be Java Object
+exposed to the script scope</font></font>
+<br><font face="Arial"><font size=-1>out.println ("JavaScript - Test 1
+- " + str);</font></font>
+<p><b><i><font face="Arial"><font size=-1>/* Test 2 */</font></font></i></b>
+<p><b><i><font face="Arial"><font size=-1>/* Instantiate a Javaobject for
+this scope and use it */</font></font></i></b>
+<p><font face="Arial"><font size=-1>function test2(){</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; // create a Java
+string buffer object from JavaScript and use its java instance</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; // This uses an
+another Java object created for creating new objects within Java and</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; // brings the same
+for JavaScript execution scope</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; // Refer _create.java
+for more information</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; create.getInstance("java.lang.StringBuffer","buffer");</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; //JavaScript refers
+the java object instance as ‘buffer’</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; out.println(buffer.toString());</font></font>
+<br>&nbsp;&nbsp;&nbsp; <font face="Arial"><font size=-1>buffer.append("I
+am a javaobject dynamically created and executed in JavaScript");</font></font>
+<br>&nbsp;&nbsp;&nbsp; <font face="Arial"><font size=-1>return buffer.toString();</font></font>
+<br><font face="Arial"><font size=-1>}</font></font>
+<p><font face="Arial"><font size=-1>var str = test2();</font></font>
+<br><font face="Arial"><font size=-1>out.println("From JavaScript - Test
+2 " + str);</font></font>
+<p><font face="Arial"><font size=-1>Let us write a simple Javahost Object
+using the Rhino engine to execute the above script,</font></font>
+<p><b><font face="Arial"><font size=-1>Fig 2.1 - JSHost.java</font></font></b>
+<p><font face="Arial"><font size=-1>/**</font></font>
+<br><font face="Arial"><font size=-1>* @author Madhukumar Seshadri</font></font>
+<br><font face="Arial"><font size=-1>* @version</font></font>
+<br><font face="Arial"><font size=-1>*/</font></font>
+<p><font face="Arial"><font size=-1>import org.mozilla.javascript.*;</font></font>
+<br><font face="Arial"><font size=-1>import java.io.*;</font></font>
+<br><font face="Arial"><font size=-1>import java.lang.*;</font></font>
+<br><i><font face="Arial"><font size=-1>// import com.xxx.xxx.*;</font></font></i>
+<p><font face="Arial"><font size=-1>public class JSHost extends Object
+{</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; /** Creates new
+JSHost */</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; public JSHost()
+{</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; }</font></font>
+<p><i><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; /*** Executes
+.js file ***/</font></font></i>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; public Object executeJS
+(String jsfname){</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; //You can also
+use evaluateReader</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; File fp = new File(jsfname);</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; String str_buff
+=null;</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; try {</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+FileReader fr = new FileReader(jsfname);</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+int length = (int) fp.length();</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+char cbuff[] = new char[(char)length];</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+fr.read(cbuff);</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+str_buff = new String(cbuff);</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; } catch(Exception
+e) {</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+e.printStackTrace();</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; }</font></font>
+<p><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; //Execute the .js
+file content</font></font>
+<br><font face="Arial"><font size=-1>&nbsp;&nbsp;&nbsp; return executeJSSource(str_buff);</font></font>
+<br><font face="Arial"><font size=-1>}</font></font>
+<p><i><font face="Arial"><font size=-1>/*** Executes javascript source
+***/</font></font></i>
+<br><font face="Arial"><font size=-1>public Object executeJSSource (String
+jsbuff){</font></font>
+<br><font face="Arial"><font size=-1>Object any=null;</font></font>
+<br><font face="Arial"><font size=-1>try{</font></font>
+<br><i><font face="Arial"><font size=-1>//Enter the Context</font></font></i>
+<br><font face="Arial"><font size=-1><i>// Refer </i><u><font color="#0000FF">http://www.mozilla.org/js/rhino/tutorial.html</font></u></font></font>
+<br><font face="Arial"><font size=-1>Context context = Context.enter();</font></font>
+<br><i><font face="Arial"><font size=-1>// Get the execution scope</font></font></i>
+<br><font face="Arial"><font size=-1>Scriptable scope = context.initStandardObjects(null);</font></font>
+<p><i><font face="Arial"><font size=-1>//----------- For Test 1 - Get System.out
+in scope</font></font></i>
+<br><font face="Arial"><font size=-1>//Scriptable jObj1 = Context.toObject(System.out,
+scope);</font></font>
+<br><font face="Arial"><font size=-1>scope.put("out", scope, jObj1);</font></font>
+<p><i><font face="Arial"><font size=-1>//------------ For Test 2 - Instantiate
+Create Object and get that in scope</font></font></i>
+<br><i><font face="Arial"><font size=-1>//Allow JScript to create Java
+Objects</font></font></i>
+<br><i><font face="Arial"><font size=-1>//Bring the _create object to context</font></font></i>
+<br><font face="Arial"><font size=-1>_create create = new _create( );</font></font>
+<br><i><font face="Arial"><font size=-1>//Register this context and scope
+to this create object instance</font></font></i>
+<br><font face="Arial"><font size=-1>create.registerContext(context,scope);</font></font>
+<br><font face="Arial"><font size=-1>//Scriptable jObj2 = Context.toObject(_create,
+scope);</font></font>
+<br><font face="Arial"><font size=-1>scope.put("create",scope,create);</font></font>
+<br><i><font face="Arial"><font size=-1>//Evaluate (or execute js)</font></font></i>
+<br><font face="Arial"><font size=-1><i>//Refer </i><u><font color="#0000FF">http://www.mozilla.org/js/rhino/tutorial.html</font></u></font></font>
+<br><font face="Arial"><font size=-1>any = context.evaluateString(scope,
+jsbuff, "", 1, null);</font></font>
+<br><i><font face="Arial"><font size=-1>//Exit the Context</font></font></i>
+<br><font face="Arial"><font size=-1>context.exit( );</font></font>
+<br><font face="Arial"><font size=-1>}</font></font>
+<p><font face="Arial"><font size=-1>catch ( JavaScriptException jse) {</font></font>
+<br><font face="Arial"><font size=-1>jse.printStackTrace();</font></font>
+<br><font face="Arial"><font size=-1>}</font></font>
+<p><font face="Arial"><font size=-1>return any;</font></font>
+<p><font face="Arial"><font size=-1>}</font></font>
+<p><font face="Arial"><font size=-1>}</font></font>
+<br>&nbsp;
+<br>&nbsp;
+<p><font face="Arial"><font size=-1>Let us write a class for creating new
+Java objects and bringing them to this script execution scope,</font></font>
+<p><b><font face="Arial"><font size=-1>Fig 2.2 – _create.java</font></font></b>
+<p><i><font face="Arial"><font size=-1>/**</font></font></i>
+<p><i><font face="Arial"><font size=-1>* @author Madhukumar</font></font></i>
+<p><i><font face="Arial"><font size=-1>*/</font></font></i>
+<p><font face="Arial"><font size=-1>import java.lang.Class;</font></font>
+<p><font face="Arial"><font size=-1>import org.mozilla.javascript.*;</font></font>
+<p><font face="Arial"><font size=-1>public class _create extends Object
+{</font></font>
+<p><font face="Arial"><font size=-1>static Context ptr = null;</font></font>
+<p><font face="Arial"><font size=-1>static Scriptable scope =null;</font></font>
+<p><font face="Arial"><font size=-1>public _create () { }</font></font>
+<p><font face="Arial"><font size=-1>public void registerContext(Context
+cptr, Scriptable sc){</font></font>
+<p><font face="Arial"><font size=-1>ptr = cptr;</font></font>
+<p><font face="Arial"><font size=-1>scope = sc;</font></font>
+<p><font face="Arial"><font size=-1>}</font></font>
+<p><font face="Arial"><font size=-1>public void getInstance(String classname,String
+jsclassname) {</font></font>
+<p><font face="Arial"><font size=-1>Object any=null;</font></font>
+<p><font face="Arial"><font size=-1>try {</font></font>
+<p><font face="Arial"><font size=-1>Class thisclass = Class.forName(classname);</font></font>
+<p><font face="Arial"><font size=-1>any = thisclass.newInstance();</font></font>
+<p><font face="Arial"><font size=-1>}</font></font>
+<p><font face="Arial"><font size=-1>catch(Exception e){</font></font>
+<p><font face="Arial"><font size=-1>e.printStackTrace();</font></font>
+<p><font face="Arial"><font size=-1>}</font></font>
+<p><font face="Arial"><font size=-1>if( ptr != null) {</font></font>
+<p><font face="Arial"><font size=-1>if (scope !=null) {</font></font>
+<p><i><font face="Arial"><font size=-1>//register created object for this
+execution scope</font></font></i>
+<p><font face="Arial"><font size=-1>scope.put(jsclassname,scope,any);</font></font>
+<p><font face="Arial"><font size=-1>}</font></font>
+<p><font face="Arial"><font size=-1>}</font></font>
+<p><font face="Arial"><font size=-1>}</font></font>
+<p><font face="Arial"><font size=-1>}</font></font>
+<br>&nbsp;
+<br>&nbsp;
+<p><font face="Arial"><font size=-1>It is time to test the code, so let
+us write a small object that will use the JSHost object,</font></font>
+<p><b><font face="Arial"><font size=-1>Fig 3 - JSHosttest.java</font></font></b>
+<p><font face="Arial"><font size=-1>/**</font></font>
+<p><font face="Arial"><font size=-1>* @author Madhukumar</font></font>
+<p><font face="Arial"><font size=-1>* @version</font></font>
+<p><font face="Arial"><font size=-1>*/</font></font>
+<p><font face="Arial"><font size=-1>public class JSHosttest extends Object
+{</font></font>
+<p><font face="Arial"><font size=-1>/** Creates new JSHostTest*/</font></font>
+<p><font face="Arial"><font size=-1>public JSHosttest() {</font></font>
+<p><font face="Arial"><font size=-1>}</font></font>
+<p><font face="Arial"><font size=-1>public static void main (String args[]){</font></font>
+<p><font face="Arial"><font size=-1>if (args.length &lt; 1) {</font></font>
+<p><font face="Arial"><font size=-1>System.out.println("Usage - Java JSHosttest.class
+&lt;js source file>");</font></font>
+<p><font face="Arial"><font size=-1>return;</font></font>
+<p><font face="Arial"><font size=-1>}</font></font>
+<p><font face="Arial"><font size=-1>JSHost jsh = new JSHost();</font></font>
+<p><font face="Arial"><font size=-1>System.out.println("Executing JavaScript
+file - " + args[0]);</font></font>
+<p><font face="Arial"><font size=-1>Object result = jsh.executeJS(args[0]);</font></font>
+<p><font face="Arial"><font size=-1>if (result instanceof String){</font></font>
+<p><font face="Arial"><font size=-1>System.out.println("Results - " + result);</font></font>
+<p><font face="Arial"><font size=-1>}</font></font>
+<p><font face="Arial"><font size=-1>}</font></font>
+<p><font face="Arial"><font size=-1>}</font></font>
+<br>&nbsp;
+<br>&nbsp;
+<p><font face="Arial"><font size=-1>For more explanations on the code execution,
+please refer embedding tutorial <a href="http://www.mozilla.org/js/rhino/tutorial.html">http://www.mozilla.org/js/rhino/tutorial.html</a>
+and for all documentation and examples on Rhino visit <a href="http://www.mozilla.org/rhino/doc.html">http://www.mozilla.org/rhino/doc.html</a>.</font></font>
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+<br>&nbsp;
+</body>
+</html>
89 docs/examples.html
View
@@ -0,0 +1,89 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Norris Boyd">
+ <meta name="GENERATOR" content="Mozilla/4.75 [en] (WinNT; U) [Netscape]">
+ <title>Rhino Examples</title>
+</head>
+<body bgcolor="#FFFFFF">
+
+<center>
+<h1>
+Rhino Examples</h1></center>
+Examples have been provided that show how to control the JavaScript engine
+and to implement scriptable host objects. All the examples are in the cvs
+tree at <tt><a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/">mozilla/js/rhino/examples</a></tt>.
+<br>&nbsp;
+<h2>
+Sample Scripts</h2>
+The <tt><a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/unique.js">unique.js</a></tt>
+script allows printing unique lines from a file.
+<p>The <tt><a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/liveConnect.js">liveConnect.js</a></tt>
+script shows a sample usage of LiveConnect (Java-to-JavaScript connectivity).
+<p>The <tt><a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/jsdoc.js">jsdoc.js</a></tt>
+script is a JavaScript analog to Java's <tt>javadoc</tt>. It makes heavy
+use of regular expressions.
+<p>The <tt><a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/checkParam.js">checkParam.js</a></tt>
+script is a useful tool to check that <tt>@param</tt> tags in Java documentation
+comments match the parameters in the corresponding Java method.
+<p>The <tt><a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/enum.js">enum.js</a></tt>
+script is a good example of using a JavaAdapter to implement a Java interface
+using a JavaScript object.
+<p>The <a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/NervousText.js">NervousText.js</a>
+script is a JavaScript implementation of the famous NervousText applet
+using JavaScript compiled to Java classes using <a href="jsc.html">jsc</a>.
+It can be run in the HTML page <a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/NervousText.html">NervousText.html</a>.
+<br>&nbsp;
+<h2>
+Controlling the JavaScript Engine</h2>
+
+<h4>
+The RunScript class</h4>
+<tt><a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/RunScript.java">RunScript.java</a></tt>
+is a simple program that executes a script from the command line.
+<h4>
+The Control class</h4>
+<tt><a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/Control.java">Control.java</a></tt>
+is a program that executes a simple script and then manipulates the result.
+<h4>
+JavaScript Shell</h4>
+<tt><a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/Shell.java">Shell.java</a></tt>
+is a program that executes JavaScript programs; it is a simplified version
+of the shell in the <tt>tools</tt> package. The programs may be specified
+as files on the command line or by typing interactively while the shell
+is running.
+<h4>
+<b>Multithreaded Script Execution</b></h4>
+<tt><a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/DynamicScopes.java">DynamicScopes.java</a></tt>
+is a program that creates a single global scope object and then shares
+it across multiple threads. Sharing the global scope allows both information
+to be shared across threads, and amortizes the cost of Context.initStandardObjects
+by only performing that expensive operation once.
+<br>&nbsp;
+<h2>
+Implementing Host Objects</h2>
+First check out the <a href="http://www.mozilla.org/rhino/tutorial.html">tutorial</a>
+if you haven't already.
+<h4>
+The Foo class - Extending ScriptableObject</h4>
+<tt><a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/Foo.java">Foo.java</a></tt>
+is a simple JavaScript host object that includes a property with an associated
+action and a variable argument method.
+<br>&nbsp;
+<h4>
+The Matrix class - Implementing Scriptable</h4>
+<tt><a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/Matrix.java">Matrix.java</a></tt>
+provides a simple multidimensional array by implementing the Scriptable
+interface.
+<br>&nbsp;
+<h4>
+The File class - An advanced example</h4>
+<tt><a href="http://lxr.mozilla.org/mozilla/source/js/rhino/examples/File.java">File.java</a></tt>
+extends ScriptableObject to provide a means of reading and writing files
+from JavaScript. A more involved example of host object definition.
+<p>
+<hr WIDTH="100%">
+<br><a href="index.html">back to top</a>
+</body>
+</html>
81 docs/faq.html
View
@@ -0,0 +1,81 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Norris Boyd">
+ <meta name="GENERATOR" content="Mozilla/4.75 [en] (WinNT; U) [Netscape]">
+ <meta name="KeyWords" content="Rhino, JavaScript, Java">
+ <title>Rhino FAQ</title>
+</head>
+<body bgcolor="#FFFFFF">
+<script src="owner.js"></script>
+
+<center>
+<h1>
+Frequently Asked Questions about Rhino</h1></center>
+<script>document.write(owner());</script>
+
+<br><script>
+ var d = new Date(document.lastModified);
+ document.write((d.getMonth()+1)+"/"+d.getDate()+"/"+d.getFullYear());
+ document.write('<br>');
+</script>
+
+<center>
+<hr WIDTH="100%"></center>
+
+<p><b><font size=+2>Q</font>.</b> <i>Is it possible to make Rhino classes
+serializable?</i>
+<p><b><font size=+2>A.</font></b> A number of people have asked about making
+Rhino data serializable. It certainly seems like it would be useful for
+a variety of applications.
+<p>The reason I haven't implemented Serializiable has been that java.lang.Class
+is not Serializable, so any functions or scripts that have been compiled
+to Java bytecodes can't be serialized. One Rhino embedder suggested that
+we could get around this restriction by actually saving the bytecode in
+a byte array and then having some mechanism for loading those bytes at
+the destination. That would work, but is an extra mechanism beyond standard
+serialization and imposes a significant space overhead on all users of
+compiled scripts. I'm also curious as to whether that mechanism would be
+any faster than simply recompiling from the script source, which would
+be significantly smaller than the serialized form.
+<p>It'd be great to have some solutions to the serialization problem, and
+I'd certainly be happy to roll changes back into Rhino.
+<p>Perhaps the best solution is to implement some serialization for Rhino's
+interpretive mode and assume for Rhino's compiled mode that the class has
+also been compiled on the receiving end (which is the assumption Java makes).
+<br>&nbsp;
+<p><b><font size=+2>Q</font>.</b> <i>Every time I compile a script I seem
+to lose a bit of memory. Is this a Rhino bug?</i>
+<p><b><font size=+2>A.</font></b> The problem is that most JVMs do not
+garbage collect unused classes or the interned strings associated with
+those classes. By default Rhino will compile scripts to class files, creating
+one class for every script or function compiled. So if you sit in a loop
+and evaluate a string there will be a little bit of memory lost on each
+iteration.
+<p>There are two solutions to this problem. First, if you have a relatively
+small set of strings that you evaluate multiple times, consider first compiling
+the strings to <tt>Script</tt> objects and then executing the scripts.
+Classes will only be generated during the compilation step, not the execution
+step (unless the scripts have an <tt>eval()</tt> call). Not only will this
+fix the memory problem, but will provide faster performance since you amortize
+the cost of compilation over multiple executions.
+<p>The second solution is to use Rhino's interpretive mode. Simply call
+<tt>setOptimizationLevel(-1)</tt>
+on the current context before you compile or evaluate, and no classes will
+be generated. Instead Rhino compiles to an internal format that is later
+interpreted. All the structures that are created can later be collected.
+Interpretive mode is slower than compiled mode, but depending on your application
+the slowdown may not be noticeable.
+<p><b><font size=+2>Q</font>.</b> <i>When I try to execute a script I the
+exception </i><tt>Required security context missing</tt><i>. What's going
+on?</i>
+<p><b><font size=+2>A.</font></b> You've likely missed placing the <tt>Security.properties</tt>
+file in your class path at <tt>org.mozilla.javascript.resources</tt>.
+<h3>
+
+<hr WIDTH="100%"><br>
+<a href="index.html">back to top</a></h3>
+
+</body>
+</html>
48 docs/footprint.html
View
@@ -0,0 +1,48 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Norris Boyd">
+ <meta name="GENERATOR" content="Mozilla/4.51 [en] (WinNT; U) [Netscape]">
+ <title>Small Footprint</title>
+</head>
+<body bgcolor="#FFFFFF">
+
+<center>
+<h1>
+Small Footprint</h1></center>
+A few changes can be made to reduce the footprint of Rhino for embeddings
+where space is at a premium. On a recent build, Rhino consumed 355,883
+bytes of space for uncompressed class files. With various changes that
+number can be reduced to 281,455 bytes.
+<br>&nbsp;
+<h3>
+Tools</h3>
+Most embeddings won't need any of the classes in <tt>org.mozilla.javascript.tools</tt>
+or any of its subpackages.
+<br>&nbsp;
+<h3>
+Regular Expressions</h3>
+The package <tt>org.mozilla.javascript.regexp</tt> can be removed. Rhino
+will continue to run, although it will not be able to execute any regular
+expression matches. This change saves 37,792 bytes of class files.
+<br>&nbsp;
+<h3>
+JavaAdapter</h3>
+Implementing the JavaAdapter functionality requires the ability to generate
+classes on the fly. Removing <tt>org.mozilla.javascript.JavaAdapter</tt> and all
+the classes in package <tt>org.mozilla.classfile</tt> will disable this
+functionality, but Rhino will otherwise run correctly. These changes save
+36,636 bytes.
+<br>&nbsp;
+<h3>
+Optimizer</h3>
+It is possible to run Rhino with interpreter mode only, allowing you to remove
+classes for classfile generation. Remove the classes in packages
+<tt>org.mozilla.classfile</tt> and <tt>org.mozilla.javascript.optimizer</tt>.
+<br>&nbsp;
+<p>
+<hr WIDTH="100%">
+<br><a href="index.html">back to top</a>
+</body>
+</html>
38 docs/help.html
View
@@ -0,0 +1,38 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Norris Boyd">
+ <meta name="GENERATOR" content="Mozilla/4.72 [en]C-NSCP (WinNT; U) [Netscape]">
+ <title>Help with Rhino</title>
+</head>
+<body>
+
+<center><b><font size=+3>Help with Rhino</font></b></center>
+<script src="owner.js"></script>
+
+<p>Have a question that you can't find answer to in the <a href="../../../../doc.html">documentation</a>?
+Here are some additional resources for help:
+<br>&nbsp;
+<h3>
+<font size=+1>Newsgroup</font></h3>
+The <a href="news:netscape.public.mozilla.jseng">netscape.public.mozilla.jseng</a>
+newsgroup answers questions about both Rhino and the C implementation of
+JavaScript.
+<br>&nbsp;
+<h3>
+Bug System</h3>
+Use <a href="http://bugzilla.mozilla.org/enter_bug.cgi?product=Rhino">Bugzilla</a>
+to enter bugs against Rhino. Note that Rhino has its own product category.
+<br>&nbsp;
+<h3>
+Module Owner</h3>
+The module owner,&nbsp;<script>document.write(owner());</script>,
+can be mailed for help as well, although he may copy his response to the
+newsgroup to help others.
+<p>
+<hr WIDTH="100%"><a href="index.html">back to top</a>
+<br>&nbsp;
+<br>&nbsp;
+</body>
+</html>
45 docs/history.html
View
@@ -0,0 +1,45 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Norris Boyd">
+ <meta name="GENERATOR" content="Mozilla/4.72 [en]C-NSCP (WinNT; U) [Netscape]">
+ <title>Rhino History</title>
+</head>
+<body>
+
+<center><b><font size=+3>Rhino History</font></b></center>
+
+<p>Rhino gets its name from the animal on the cover of the <a href="http://www.ora.com/">O'Reilly</a>
+book about JavaScript.
+<p>The Rhino project was started at Netscape in Fall 1997. At the time,
+Netscape was planning to produce a version of Navigator written entirely
+in Java and so it needed an implementation of JavaScript written in Java.
+When Netscape stopped work on "Javagator", as it was called, somehow Rhino
+escaped the axe (rumor had it that the executives "forgot" it existed).
+Since then, a couple of major companies (including Sun) have licensed Rhino
+for use in their products and paid Netscape to do so, allowing us to continue
+work on it. Now Rhino is planned to be part of several server products
+from Netscape as well.
+<p>Originally, Rhino compiled all JavaScript code to Java bytecodes in
+generated classfiles. This produced the best performance (often beating
+the C implementation of JavaScript when run on a JIT), but suffered from
+two faults. First, compilation time was long since generating Java bytecodes
+and loading the generated classes was a heavyweight process. Also, the
+implementation effectively leaked memory since most JVMs don't really collect
+unused classes or the strings that are interned as a result of loading
+a class file.
+<p>So in Fall of 1998, Rhino added an interpretive mode. The classfile
+generation code was moved to an optional, dynamically-loaded package. Compilation
+is faster and when scripts are no longer in use they can be collected like
+any other Java object.
+<p>Rhino was released to mozilla.org in April of 1998. Originally Rhino
+classfile generation had been held back from release. However the licensees
+of Rhino have now agreed to release all of Rhino to open source, including
+class file generation. Since its release to open source, Rhino has found
+a variety of <a href="users.html">uses</a> and an increasing
+number of people have contributed to the code.
+<p>
+<hr WIDTH="100%"><a href="index.html">back to top</a>
+</body>
+</html>
75 docs/index.html
View
@@ -0,0 +1,75 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Norris Boyd">
+ <meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; U) [Netscape]">
+ <meta name="KeyWords" content="Rhino, JavaScript, Java, Mozilla">
+ <title>Rhino - JavaScript for Java</title>
+</head>
+<body>
+
+<center>
+<h1>
+Rhino: JavaScript for Java</h1></center>
+
+<center><img SRC="rhino50.jpg" height=200 width=398></center>
+
+<hr WIDTH="100%">Rhino is an open-source implementation of JavaScript written
+entirely in Java. It is typically embedded into Java applications to provide
+scripting to end users.
+<table WIDTH="100%" >
+<tr>
+<td>
+<div align=right><b><a href="download.html">Downloads</a></b></div>
+</td>
+
+<td>How to get source and binaries.</td>
+</tr>
+
+<tr>
+<td>
+<div align=right><b><a href="doc.html">Documentation</a></b></div>
+</td>
+
+<td>Information on Rhino for script writers and embedders.</td>
+</tr>
+
+<!--
+<tr>
+<td>
+<div align=right><b><a href="users.html">Users</a></b></div>
+</td>
+
+<td>How people are using Rhino.</td>
+</tr>
+-->
+
+<tr>
+<td>
+<div align=right><b><a href="history.html">History</a></b></div>
+</td>
+
+<td>The ancestry of the beast.</td>
+</tr>
+
+<tr>
+<td>
+<div align=right><b><a href="help.html">Help</a></b></div>
+</td>
+
+<td>Some resources if you get stuck.</td>
+</tr>
+</table>
+
+<hr WIDTH="100%"><font size=-1>Module owner&nbsp;</font><script src="owner.js"></script>
+<script>document.write(owner());</script>
+
+<br><font size=-1>Rhino image courtesy of Paul Houle.</font><!---
+Add reference to
+http://www.javaworld.com/jw-08-1999/jw-08-howto.html
+and
+http://www.javaworld.com/javaworld/jw-09-1999/jw-09-howto.html
+--->
+</body>
+</html>
66 docs/javaone.html