Skip to content

Commit

Permalink
Update for 1.5R2.
Browse files Browse the repository at this point in the history
  • Loading branch information
norrisboyd committed Jul 27, 2001
1 parent cc17948 commit 74cb29b
Show file tree
Hide file tree
Showing 5 changed files with 275 additions and 120 deletions.
111 changes: 3 additions & 108 deletions docs/changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<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="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
<meta name="KeyWords" content="Rhino, JavaScript, Java">
<title>Change Log</title>
</head>
Expand All @@ -13,113 +13,8 @@
<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>[email protected] 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.
2.
<p><i>None yet!</i>
<h3>

<hr WIDTH="100%"><br>
Expand Down
11 changes: 8 additions & 3 deletions docs/doc.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<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="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
<meta name="KeyWords" content="Rhino, JavaScript, Java">
<title>Rhino Documentation</title>
</head>
Expand All @@ -26,6 +26,12 @@ <h1>
<td>What you must have to run Rhino; what Rhino cannot do.</td>
</tr>

<tr>
<td><a href="rhino15R2.html">What's new in 1.5R2</a></td>

<td>Changes since 1.5R1.</td>
</tr>

<tr>
<td><a href="debugger.html">Rhino Debugger</a></td>

Expand Down Expand Up @@ -134,8 +140,7 @@ <h1>
</tr>

<tr>
<td><font color="#000000"><a href="http://www.mozilla.org/js/tests/library.html">Testing
</a></font></td>
<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>
Expand Down
27 changes: 18 additions & 9 deletions docs/download.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<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="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
<title>Rhino Downloads</title>
</head>
<body>
Expand All @@ -14,30 +14,39 @@
<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
Rhino 1.5 Release 2 is the last qualified release. It is also possible
to download the latest rhino build that reflects newer features and bug
fixes, but has not been fully qualified. These zip files also include the
source.
<p>If you are 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>
<a href="ftp://ftp.mozilla.org/pub/js/rhino15R2.zip">Rhino 1.5R2.</a></li>

<ul>
<li>
<i><font size=-1><a href="js15.html">Description of changes from 1.4R3</a></font></i>.</li>
<i><font size=-1><a href="rhino15R2.html">Description of changes from 1.5R1</a></font></i>.</li>
</ul>

<li>
<a href="ftp://ftp.mozilla.org/pub/js/rhino15R1.zip">Rhino 1.5R1.</a></li>

<ul>
<li>
<i><font size=-1><a href="rhino15R1.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>
<a href="ftp://ftp.mozilla.org/pub/js/rhinoLatest.zip">Latest Rhino builds</a>.</li>

<ul>
<li>
<i><font size=-1><a href="changes.html">Description of changes from 1.5</a></font></i>.</li>
<i><font size=-1><a href="changes.html">Description of changes from 1.5R2</a></font></i>.</li>
</ul>
</ul>

Expand Down
162 changes: 162 additions & 0 deletions docs/rhino15R1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
<!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] (Windows NT 5.0; U) [Netscape]">
<meta name="KeyWords" content="Rhino, JavaScript, Java">
<title>What's New in Rhino 1.5</title>
</head>
<body bgcolor="#FFFFFF">

<center>
<h1>
What's New in Rhino 1.5 Release 1</h1></center>

<h2>
ECMA 262 Edition 3 Conformance</h2>
Rhino 1.5 implements JavaScript 1.5, which conforms to ECMA 262 Edition
3 (sometimes referred to as "ECMAScript"). Edition 3 standardized several
features of JavaScript that were present in JavaScript 1.4, including:
<ul>
<li>
regular expressions</li>

<li>
<tt>switch</tt> statements</li>

<li>
<tt>do</tt>...<tt>while</tt> loops</li>

<li>
statement labels and labelled <tt>break</tt> and <tt>continue</tt></li>

<li>
object literals</li>

<li>
nested functions</li>

<li>
exception handling</li>

<li>
the <tt>instanceof</tt> operator</li>

<li>
the <tt>in</tt> operator</li>
</ul>
In addition, new features were added to Edition 3 and JavaScript 1.5, including:
<ul>
<li>
Perl 5 regular expressions, including operators like greedy quantifiers</li>

<li>
errors as exceptions</li>

<li>
number formatting (<tt>Number.prototype.toFixed</tt>, <tt>Number.prototype.toExponential</tt>,
and <tt>Number.prototype.toGeneral</tt>)</li>
</ul>

<h2>
Changes since Rhino 1.4 Release 3</h2>
Other significant changes to Rhino since the initial release to open source
(1.4 Release 3) are listed below. Bug fixes won't be mentioned here, just
API changes or significant functionality changes.
<h3>
Compilation mode</h3>
Rhino has two modes of execution available. Interpretive mode has an interpreter
loop implemented in Java. Compilation mode compiles JavaScript code to
Java bytecodes in class files. This compilation can be done as part of
script evaluation using the same APIs already available for the interpreter,
or in a separate compile-time step. The code for the interpreter is located
in the <tt>org.mozilla.javascript.optimizer</tt> package.
<br>&nbsp;
<h3>
JavaScript Compiler</h3>
The distribution now contains an extra class that can be invoked from the
command line. This is <tt>jsc</tt>, the JavaScript compiler. This tool
can be used to create Java classes from JavaScript. Options exist to allow
creation of Java classes that implement arbitrary interfaces and extend
arbitrary base classes, allowing JavaScript scripts to implement important
protocols like applets and servlets. See <a href="http://www.mozilla.org/rhino/jsc.html">http://www.mozilla.org/rhino/jsc.html</a>.
<br>&nbsp;
<h3>
LiveConnect 3</h3>
Rhino now supports the LiveConnect 3 specification, or LC3. The most notable
change is support for overloaded method resolution. See <a href="http://www.mozilla.org/js/liveconnect/lc3_proposal.html">LiveConnect
Release 3 Goals/Features</a>.
<br>&nbsp;
<h3>
JavaBeans properties reflected as Java properties</h3>
Java classes with getFoo/setFoo methods will have a "foo" property in the
JavaScript reflection. Boolean methods are also reflected.
<br>&nbsp;
<h3>
Dynamic scope support</h3>
Rhino 1.5 implements support for dynamic scopes, which are particularly
useful for multithreaded environments like server embeddings.
<br>&nbsp;
<h3>
New semantics for <tt>ScriptableObject.defineClass</tt></h3>
The old rules for defining JavaScript objects using a Java class were getting
baroque. Those rules are still supported, but a cleaner definition is now
supported. See the <a href="http://www.mozilla.org/js/rhino/org/mozilla/javascript/ScriptableObject.html#defineClass(org.mozilla.javascript.Scriptable, java.lang.Class)">javadoc</a>
for details.
<br>&nbsp;
<h3>
Support for the Java 2 <tt>-jar</tt> option</h3>
It's now possible to start the shell using the new <tt>-jar</tt> option
in Java 2.
<br>&nbsp;
<h3>
Shell changes</h3>
Two changes here: addition of the "environment" and "history" top-level
variables.
<br>&nbsp;
<h3>
Java classes visible to scripts</h3>
An attendee at JavaOne raised the point that many embeddings may not want
scripts to be able to access all Java classes. This is an excellent point,
and I've implemented an addition to the <a href="../js/rhino/org/mozilla/javascript/SecuritySupport.html">SecuritySupport</a>
interface that allows embedders to choose which classes are exposed to
scripts.
<br>&nbsp;
<h3>
SecuritySupport and JavaAdapter</h3>
Andrew Wason pointed a problem with the new JavaAdapter feature (which
allows JavaScript objects to implement arbitrary Java interfaces by generating
class files). It didn't support the <a href="../js/rhino/org/mozilla/javascript/SecuritySupport.html">SecuritySupport</a>
interface, which allows Rhino to delegate the creation of classes from
byte arrays to a routine provided by the embedding. This ability is important
from a security standpoint because class creation is considered a privileged
action.
<p>I've checked in changes that fix this problem. If a SecuritySupport
class is specified when a Context is created, uses of JavaAdapter will
will delegate class creation to the SecuritySupport class.
<br>&nbsp;
<h3>
Context.exit()</h3>
Context.exit() has been changed from an instance method to a static method.
This makes it match the Context.enter() method, which is also static. See
the <a href="http://www.mozilla.org/js/rhino/org/mozilla/javascript/Context.html#exit()">javadoc</a>
for more information on its operation.
<br>&nbsp;
<h3>
Context.enter(Context)</h3>
A new overloaded form of Context.enter has been added. Without the addition
of this method it was not possible to attach an existing context to a thread.
See the <a href="http://www.mozilla.org/js/rhino/org/mozilla/javascript/Context.html#enter(org.mozilla.javascript.Context)">javadoc</a>
for more information on its operation.
<br>&nbsp;
<h3>
Listeners for Context</h3>
Context now supports property change listeners for a couple of its properties.
<h3>

<hr WIDTH="100%"><br>
<a href="index.html">back to top</a></h3>

</body>
</html>
Loading

0 comments on commit 74cb29b

Please sign in to comment.