1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
4
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5
<meta name="Author" content="Norris Boyd">
6
<meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
7
<meta name="KeyWords" content="Rhino, JavaScript, Java">
8
<title>What's New in Rhino 1.5</title>
10
<body bgcolor="#FFFFFF">
14
What's New in Rhino 1.5 Release 1</h1></center>
17
ECMA 262 Edition 3 Conformance</h2>
18
Rhino 1.5 implements JavaScript 1.5, which conforms to ECMA 262 Edition
19
3 (sometimes referred to as "ECMAScript"). Edition 3 standardized several
20
features of JavaScript that were present in JavaScript 1.4, including:
23
regular expressions</li>
26
<tt>switch</tt> statements</li>
29
<tt>do</tt>...<tt>while</tt> loops</li>
32
statement labels and labelled <tt>break</tt> and <tt>continue</tt></li>
41
exception handling</li>
44
the <tt>instanceof</tt> operator</li>
47
the <tt>in</tt> operator</li>
49
In addition, new features were added to Edition 3 and JavaScript 1.5, including:
52
Perl 5 regular expressions, including operators like greedy quantifiers</li>
55
errors as exceptions</li>
58
number formatting (<tt>Number.prototype.toFixed</tt>, <tt>Number.prototype.toExponential</tt>,
59
and <tt>Number.prototype.toGeneral</tt>)</li>
63
Changes since Rhino 1.4 Release 3</h2>
64
Other significant changes to Rhino since the initial release to open source
65
(1.4 Release 3) are listed below. Bug fixes won't be mentioned here, just
66
API changes or significant functionality changes.
69
Rhino has two modes of execution available. Interpretive mode has an interpreter
70
loop implemented in Java. Compilation mode compiles JavaScript code to
71
Java bytecodes in class files. This compilation can be done as part of
72
script evaluation using the same APIs already available for the interpreter,
73
or in a separate compile-time step. The code for the interpreter is located
74
in the <tt>org.mozilla.javascript.optimizer</tt> package.
77
JavaScript Compiler</h3>
78
The distribution now contains an extra class that can be invoked from the
79
command line. This is <tt>jsc</tt>, the JavaScript compiler. This tool
80
can be used to create Java classes from JavaScript. Options exist to allow
81
creation of Java classes that implement arbitrary interfaces and extend
82
arbitrary base classes, allowing JavaScript scripts to implement important
83
protocols like applets and servlets. See <a href="http://www.mozilla.org/rhino/jsc.html">http://www.mozilla.org/rhino/jsc.html</a>.
87
Rhino now supports the LiveConnect 3 specification, or LC3. The most notable
88
change is support for overloaded method resolution. See <a href="http://www.mozilla.org/js/liveconnect/lc3_proposal.html">LiveConnect
89
Release 3 Goals/Features</a>.
92
JavaBeans properties reflected as Java properties</h3>
93
Java classes with getFoo/setFoo methods will have a "foo" property in the
94
JavaScript reflection. Boolean methods are also reflected.
97
Dynamic scope support</h3>
98
Rhino 1.5 implements support for dynamic scopes, which are particularly
99
useful for multithreaded environments like server embeddings.
102
New semantics for <tt>ScriptableObject.defineClass</tt></h3>
103
The old rules for defining JavaScript objects using a Java class were getting
104
baroque. Those rules are still supported, but a cleaner definition is now
105
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>
109
Support for the Java 2 <tt>-jar</tt> option</h3>
110
It's now possible to start the shell using the new <tt>-jar</tt> option
115
Two changes here: addition of the "environment" and "history" top-level
119
Java classes visible to scripts</h3>
120
An attendee at JavaOne raised the point that many embeddings may not want
121
scripts to be able to access all Java classes. This is an excellent point,
122
and I've implemented an addition to the <a href="../js/rhino/org/mozilla/javascript/SecuritySupport.html">SecuritySupport</a>
123
interface that allows embedders to choose which classes are exposed to
127
SecuritySupport and JavaAdapter</h3>
128
Andrew Wason pointed a problem with the new JavaAdapter feature (which
129
allows JavaScript objects to implement arbitrary Java interfaces by generating
130
class files). It didn't support the <a href="../js/rhino/org/mozilla/javascript/SecuritySupport.html">SecuritySupport</a>
131
interface, which allows Rhino to delegate the creation of classes from
132
byte arrays to a routine provided by the embedding. This ability is important
133
from a security standpoint because class creation is considered a privileged
135
<p>I've checked in changes that fix this problem. If a SecuritySupport
136
class is specified when a Context is created, uses of JavaAdapter will
137
will delegate class creation to the SecuritySupport class.
141
Context.exit() has been changed from an instance method to a static method.
142
This makes it match the Context.enter() method, which is also static. See
143
the <a href="http://www.mozilla.org/js/rhino/org/mozilla/javascript/Context.html#exit()">javadoc</a>
144
for more information on its operation.
147
Context.enter(Context)</h3>
148
A new overloaded form of Context.enter has been added. Without the addition
149
of this method it was not possible to attach an existing context to a thread.
150
See the <a href="http://www.mozilla.org/js/rhino/org/mozilla/javascript/Context.html#enter(org.mozilla.javascript.Context)">javadoc</a>
151
for more information on its operation.
154
Listeners for Context</h3>
155
Context now supports property change listeners for a couple of its properties.
158
<hr WIDTH="100%"><br>
159
<a href="index.html">back to top</a></h3>
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
4
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5
<meta name="Author" content="Norris Boyd">
6
<meta name="GENERATOR" content="Mozilla/4.75 [en] (Windows NT 5.0; U) [Netscape]">
7
<meta name="KeyWords" content="Rhino, JavaScript, Java">
8
<title>What's New in Rhino 1.5</title>
10
<body bgcolor="#FFFFFF">
14
What's New in Rhino 1.5 Release 1</h1></center>
17
ECMA 262 Edition 3 Conformance</h2>
18
Rhino 1.5 implements JavaScript 1.5, which conforms to ECMA 262 Edition
19
3 (sometimes referred to as "ECMAScript"). Edition 3 standardized several
20
features of JavaScript that were present in JavaScript 1.4, including:
23
regular expressions</li>
26
<tt>switch</tt> statements</li>
29
<tt>do</tt>...<tt>while</tt> loops</li>
32
statement labels and labelled <tt>break</tt> and <tt>continue</tt></li>
41
exception handling</li>
44
the <tt>instanceof</tt> operator</li>
47
the <tt>in</tt> operator</li>
49
In addition, new features were added to Edition 3 and JavaScript 1.5, including:
52
Perl 5 regular expressions, including operators like greedy quantifiers</li>
55
errors as exceptions</li>
58
number formatting (<tt>Number.prototype.toFixed</tt>, <tt>Number.prototype.toExponential</tt>,
59
and <tt>Number.prototype.toGeneral</tt>)</li>
63
Changes since Rhino 1.4 Release 3</h2>
64
Other significant changes to Rhino since the initial release to open source
65
(1.4 Release 3) are listed below. Bug fixes won't be mentioned here, just
66
API changes or significant functionality changes.
69
Rhino has two modes of execution available. Interpretive mode has an interpreter
70
loop implemented in Java. Compilation mode compiles JavaScript code to
71
Java bytecodes in class files. This compilation can be done as part of
72
script evaluation using the same APIs already available for the interpreter,
73
or in a separate compile-time step. The code for the interpreter is located
74
in the <tt>org.mozilla.javascript.optimizer</tt> package.
77
JavaScript Compiler</h3>
78
The distribution now contains an extra class that can be invoked from the
79
command line. This is <tt>jsc</tt>, the JavaScript compiler. This tool
80
can be used to create Java classes from JavaScript. Options exist to allow
81
creation of Java classes that implement arbitrary interfaces and extend
82
arbitrary base classes, allowing JavaScript scripts to implement important
83
protocols like applets and servlets. See <a href="http://www.mozilla.org/rhino/jsc.html">http://www.mozilla.org/rhino/jsc.html</a>.
87
Rhino now supports the LiveConnect 3 specification, or LC3. The most notable
88
change is support for overloaded method resolution. See <a href="http://www.mozilla.org/js/liveconnect/lc3_proposal.html">LiveConnect
89
Release 3 Goals/Features</a>.
92
JavaBeans properties reflected as Java properties</h3>
93
Java classes with getFoo/setFoo methods will have a "foo" property in the
94
JavaScript reflection. Boolean methods are also reflected.
97
Dynamic scope support</h3>
98
Rhino 1.5 implements support for dynamic scopes, which are particularly
99
useful for multithreaded environments like server embeddings.
102
New semantics for <tt>ScriptableObject.defineClass</tt></h3>
103
The old rules for defining JavaScript objects using a Java class were getting
104
baroque. Those rules are still supported, but a cleaner definition is now
105
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>
109
Support for the Java 2 <tt>-jar</tt> option</h3>
110
It's now possible to start the shell using the new <tt>-jar</tt> option
115
Two changes here: addition of the "environment" and "history" top-level
119
Java classes visible to scripts</h3>
120
An attendee at JavaOne raised the point that many embeddings may not want
121
scripts to be able to access all Java classes. This is an excellent point,
122
and I've implemented an addition to the <a href="../js/rhino/org/mozilla/javascript/SecuritySupport.html">SecuritySupport</a>
123
interface that allows embedders to choose which classes are exposed to
127
SecuritySupport and JavaAdapter</h3>
128
Andrew Wason pointed a problem with the new JavaAdapter feature (which
129
allows JavaScript objects to implement arbitrary Java interfaces by generating
130
class files). It didn't support the <a href="../js/rhino/org/mozilla/javascript/SecuritySupport.html">SecuritySupport</a>
131
interface, which allows Rhino to delegate the creation of classes from
132
byte arrays to a routine provided by the embedding. This ability is important
133
from a security standpoint because class creation is considered a privileged
135
<p>I've checked in changes that fix this problem. If a SecuritySupport
136
class is specified when a Context is created, uses of JavaAdapter will
137
will delegate class creation to the SecuritySupport class.
141
Context.exit() has been changed from an instance method to a static method.
142
This makes it match the Context.enter() method, which is also static. See
143
the <a href="http://www.mozilla.org/js/rhino/org/mozilla/javascript/Context.html#exit()">javadoc</a>
144
for more information on its operation.
147
Context.enter(Context)</h3>
148
A new overloaded form of Context.enter has been added. Without the addition
149
of this method it was not possible to attach an existing context to a thread.
150
See the <a href="http://www.mozilla.org/js/rhino/org/mozilla/javascript/Context.html#enter(org.mozilla.javascript.Context)">javadoc</a>
151
for more information on its operation.
154
Listeners for Context</h3>
155
Context now supports property change listeners for a couple of its properties.
158
<hr WIDTH="100%"><br>
159
<a href="index.html">back to top</a></h3>