~ubuntu-branches/ubuntu/karmic/rhino/karmic

« back to all changes in this revision

Viewing changes to docs/rhino15R1.html

  • Committer: Bazaar Package Importer
  • Author(s): Jerry Haltom
  • Date: 2005-03-19 16:56:07 UTC
  • mto: (11.1.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20050319165607-geu3j3fnqlkpqkh1
Tags: upstream-1.6.R1
ImportĀ upstreamĀ versionĀ 1.6.R1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
2
 
<html>
3
 
<head>
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>
9
 
</head>
10
 
<body bgcolor="#FFFFFF">
11
 
 
12
 
<center>
13
 
<h1>
14
 
What's New in Rhino 1.5 Release 1</h1></center>
15
 
 
16
 
<h2>
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:
21
 
<ul>
22
 
<li>
23
 
regular expressions</li>
24
 
 
25
 
<li>
26
 
<tt>switch</tt> statements</li>
27
 
 
28
 
<li>
29
 
<tt>do</tt>...<tt>while</tt> loops</li>
30
 
 
31
 
<li>
32
 
statement labels and labelled <tt>break</tt> and <tt>continue</tt></li>
33
 
 
34
 
<li>
35
 
object literals</li>
36
 
 
37
 
<li>
38
 
nested functions</li>
39
 
 
40
 
<li>
41
 
exception handling</li>
42
 
 
43
 
<li>
44
 
the <tt>instanceof</tt> operator</li>
45
 
 
46
 
<li>
47
 
the <tt>in</tt> operator</li>
48
 
</ul>
49
 
In addition, new features were added to Edition 3 and JavaScript 1.5, including:
50
 
<ul>
51
 
<li>
52
 
Perl 5 regular expressions, including operators like greedy quantifiers</li>
53
 
 
54
 
<li>
55
 
errors as exceptions</li>
56
 
 
57
 
<li>
58
 
number formatting (<tt>Number.prototype.toFixed</tt>, <tt>Number.prototype.toExponential</tt>,
59
 
and <tt>Number.prototype.toGeneral</tt>)</li>
60
 
</ul>
61
 
 
62
 
<h2>
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.
67
 
<h3>
68
 
Compilation mode</h3>
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.
75
 
<br>&nbsp;
76
 
<h3>
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>.
84
 
<br>&nbsp;
85
 
<h3>
86
 
LiveConnect 3</h3>
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>.
90
 
<br>&nbsp;
91
 
<h3>
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.
95
 
<br>&nbsp;
96
 
<h3>
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.
100
 
<br>&nbsp;
101
 
<h3>
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>
106
 
for details.
107
 
<br>&nbsp;
108
 
<h3>
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
111
 
in Java 2.
112
 
<br>&nbsp;
113
 
<h3>
114
 
Shell changes</h3>
115
 
Two changes here: addition of the "environment" and "history" top-level
116
 
variables.
117
 
<br>&nbsp;
118
 
<h3>
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
124
 
scripts.
125
 
<br>&nbsp;
126
 
<h3>
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
134
 
action.
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.
138
 
<br>&nbsp;
139
 
<h3>
140
 
Context.exit()</h3>
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.
145
 
<br>&nbsp;
146
 
<h3>
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.
152
 
<br>&nbsp;
153
 
<h3>
154
 
Listeners for Context</h3>
155
 
Context now supports property change listeners for a couple of its properties.
156
 
<h3>
157
 
 
158
 
<hr WIDTH="100%"><br>
159
 
<a href="index.html">back to top</a></h3>
160
 
 
161
 
</body>
162
 
</html>
 
1
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
 
2
<html>
 
3
<head>
 
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>
 
9
</head>
 
10
<body bgcolor="#FFFFFF">
 
11
 
 
12
<center>
 
13
<h1>
 
14
What's New in Rhino 1.5 Release 1</h1></center>
 
15
 
 
16
<h2>
 
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:
 
21
<ul>
 
22
<li>
 
23
regular expressions</li>
 
24
 
 
25
<li>
 
26
<tt>switch</tt> statements</li>
 
27
 
 
28
<li>
 
29
<tt>do</tt>...<tt>while</tt> loops</li>
 
30
 
 
31
<li>
 
32
statement labels and labelled <tt>break</tt> and <tt>continue</tt></li>
 
33
 
 
34
<li>
 
35
object literals</li>
 
36
 
 
37
<li>
 
38
nested functions</li>
 
39
 
 
40
<li>
 
41
exception handling</li>
 
42
 
 
43
<li>
 
44
the <tt>instanceof</tt> operator</li>
 
45
 
 
46
<li>
 
47
the <tt>in</tt> operator</li>
 
48
</ul>
 
49
In addition, new features were added to Edition 3 and JavaScript 1.5, including:
 
50
<ul>
 
51
<li>
 
52
Perl 5 regular expressions, including operators like greedy quantifiers</li>
 
53
 
 
54
<li>
 
55
errors as exceptions</li>
 
56
 
 
57
<li>
 
58
number formatting (<tt>Number.prototype.toFixed</tt>, <tt>Number.prototype.toExponential</tt>,
 
59
and <tt>Number.prototype.toGeneral</tt>)</li>
 
60
</ul>
 
61
 
 
62
<h2>
 
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.
 
67
<h3>
 
68
Compilation mode</h3>
 
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.
 
75
<br>&nbsp;
 
76
<h3>
 
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>.
 
84
<br>&nbsp;
 
85
<h3>
 
86
LiveConnect 3</h3>
 
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>.
 
90
<br>&nbsp;
 
91
<h3>
 
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.
 
95
<br>&nbsp;
 
96
<h3>
 
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.
 
100
<br>&nbsp;
 
101
<h3>
 
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>
 
106
for details.
 
107
<br>&nbsp;
 
108
<h3>
 
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
 
111
in Java 2.
 
112
<br>&nbsp;
 
113
<h3>
 
114
Shell changes</h3>
 
115
Two changes here: addition of the "environment" and "history" top-level
 
116
variables.
 
117
<br>&nbsp;
 
118
<h3>
 
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
 
124
scripts.
 
125
<br>&nbsp;
 
126
<h3>
 
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
 
134
action.
 
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.
 
138
<br>&nbsp;
 
139
<h3>
 
140
Context.exit()</h3>
 
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.
 
145
<br>&nbsp;
 
146
<h3>
 
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.
 
152
<br>&nbsp;
 
153
<h3>
 
154
Listeners for Context</h3>
 
155
Context now supports property change listeners for a couple of its properties.
 
156
<h3>
 
157
 
 
158
<hr WIDTH="100%"><br>
 
159
<a href="index.html">back to top</a></h3>
 
160
 
 
161
</body>
 
162
</html>