зеркало из https://github.com/mozilla/pjs.git
Preparations for 1.5R5
This commit is contained in:
Родитель
6789d9dad4
Коммит
765d9c1f9e
|
@ -21,52 +21,58 @@ Scripting Framework (BSF), download one of the zip files below and
|
|||
unzip it. </p>
|
||||
<ul>
|
||||
|
||||
<li> <a href="ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino15R41.zip">Rhino 1.5R4.1.</a>
|
||||
<li> <a href="ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_5R5RC1.zip">Release Candidate 1 for Rhino 1.5R5</a>
|
||||
<ul>
|
||||
<li> <i><font size="-1"><a href="rhino15R41.html">Description of changes from 1.5R4.1</a> </font></i>.</li>
|
||||
<li> <font size="-1"><a href="rhino15R5.html">Description of changes from 1.5R4.1.</a></font></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li> <a href="ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino15R4.zip">Rhino 1.5R4.</a>
|
||||
<li> <a href="ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino15R41.zip">Rhino 1.5R4.1</a>
|
||||
<ul>
|
||||
<li> <i><font size="-1"><a href="rhino15R4.html">Description of changes from 1.5R3</a> </font></i>.</li>
|
||||
<li> <font size="-1"><a href="rhino15R41.html">Description of changes from 1.5R4.</a> </font></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><a href="ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino15R3.zip">Rhino 1.5R3.</a>
|
||||
<li> <a href="ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino15R4.zip">Rhino 1.5R4</a>
|
||||
<ul>
|
||||
<li> <i><font size="-1"><a href="rhino15R3.html">Description of
|
||||
changes from 1.5R2</a> </font></i>.</li>
|
||||
<li><font size="-1"><a href="rhino15R4.html">Description of changes from 1.5R3.</a></font></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><a href="ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino15R3.zip">Rhino 1.5R3</a>
|
||||
<ul>
|
||||
<li><font size="-1"><a href="rhino15R3.html">Description of
|
||||
changes from 1.5R2.</a></font></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li> <a
|
||||
href="ftp://ftp.mozilla.org/pub/mozilla.org/js/older-packages/rhino15R2.zip">Rhino
|
||||
1.5R2.</a>
|
||||
1.5R2</a>
|
||||
<ul>
|
||||
<li> <i><font size="-1"><a href="rhino15R2.html">Description of
|
||||
changes from 1.5R1</a> </font></i>.</li>
|
||||
<li><font size="-1"><a href="rhino15R2.html">Description of
|
||||
changes from 1.5R1.</a> </font></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li><a
|
||||
href="ftp://ftp.mozilla.org/pub/mozilla.org/js/older-packages/rhino15R1.zip">Rhino
|
||||
1.5R1.</a>
|
||||
1.5R1</a>
|
||||
<ul>
|
||||
<li> <i><font size="-1"><a href="rhino15R1.html">Description of
|
||||
changes from 1.4R3</a> </font></i>.</li>
|
||||
<li><font size="-1"><a href="rhino15R1.html">Description of
|
||||
changes from 1.4R3.</a> </font></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
<li> <a
|
||||
<li><a
|
||||
href="ftp://ftp.mozilla.org/pub/mozilla.org/js/older-packages/rhino14R3.zip"> Rhino
|
||||
1.4 Release 3</a> .</li>
|
||||
1.4 Release 3</a></li>
|
||||
|
||||
<li> <a href="ftp://ftp.mozilla.org/pub/mozilla.org/js/rhinoLatest.zip">Latest
|
||||
Rhino builds</a> .
|
||||
<li><a href="ftp://ftp.mozilla.org/pub/mozilla.org/js/rhinoLatest.zip">Latest
|
||||
Rhino builds</a>
|
||||
<ul>
|
||||
<li> <i><font size="-1"><a href="rhino15R5.html">Description of
|
||||
changes that will be included in the 1.5R5 release</a> </font></i>.</li>
|
||||
<li><font size="-1"><a href="changes.html">Description of
|
||||
changes since Release Candidate 1 for Rhino 1.5R5.</a> </font></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
|
|
@ -11,36 +11,36 @@
|
|||
<h1 align="center">
|
||||
Rhino 1.5R5 Change Log</h1>
|
||||
|
||||
This is a log of significant changes since Rhino 1.5 Release 4.1.
|
||||
This is a log of significant changes in Rhino 1.5 Release 5.
|
||||
|
||||
<h3>Automatic wrapping of JavaScript functions and Java instances</h3>
|
||||
<h3>Wrapping of JavaScript functions as Java interfaces</h3>
|
||||
<p>
|
||||
It is possible now to pass JavaScript function as argument to Java method expecting an interface with single method. Rhino automatically provides glue code to call the passed function when the interface method is called. It allows to simplify code that previously had to create explicit JavaAdapter objects.
|
||||
See <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=223435">Bugzilla 223435</a>.
|
||||
Rhino allows to pass a JavaScript function to a Java method expecting an interface with a single method. The JavaScript function will be called whenever the interface's method is called from Java. It allows to simplify code that previously had to create explicit JavaAdapter objects.
|
||||
</p>
|
||||
<p>
|
||||
For example, one can write now:
|
||||
<pre>
|
||||
var button = new javax.swing.JButton("My Button");
|
||||
button.addActionListener(function() {
|
||||
java.lang.System.out.println("Button click");
|
||||
button.addActionListener(function(e) {
|
||||
java.lang.System.out.println("Button click:"+e);
|
||||
});
|
||||
</pre>
|
||||
instead of
|
||||
<pre>
|
||||
var button = new javax.swing.JButton("My Button");
|
||||
button.addActionListener(new java.awt.event.ActionListener({
|
||||
actionPerformed : function() {
|
||||
java.lang.System.out.println("Button click");
|
||||
actionPerformed : function(e) {
|
||||
java.lang.System.out.println("Button click:"+e);
|
||||
}
|
||||
});
|
||||
</pre>
|
||||
which was necessary in the previous version of Rhino.
|
||||
See <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=223435">Bugzilla 223435</a>.
|
||||
</p>
|
||||
|
||||
<h3>Support for uneval()/toSource()</h3>
|
||||
<h3>uneval() and toSource()</h3>
|
||||
<p>
|
||||
Rhino now fully supports <tt>uneval()</tt> function and <tt>toSource()</tt> method which are extensions to ECMAScript available in <a href="http://www.mozilla.org/js/">SpiderMonkey</a>. They return a string that can be passed to eval to reconstruct the original value when possible. It is guaranteed that <tt>uneval(eval(uneval(x))) == uneval(x)</tt> and in many cases more useful notion <tt>eval(uneval(x)) == deep_copy_of_x</tt> holds. See <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=225465">Bugzilla 225465</a>.
|
||||
Rhino fully supports <tt>uneval()</tt> function and <tt>toSource()</tt> method which are extensions to ECMAScript available in <a href="http://www.mozilla.org/js/">SpiderMonkey</a>. They return a string that can be passed to the <tt>eval()</tt> function to reconstruct the original value when possible. It is guaranteed that <tt>uneval(eval(uneval(x))) == uneval(x)</tt> and in many cases more useful notion <tt>eval(uneval(x)) == deep_copy_of_x</tt> holds.
|
||||
</p>
|
||||
<p>
|
||||
For example, here is an extract from a <a href="shell.html">Rhino shell</a> session:
|
||||
|
@ -54,43 +54,68 @@ js> x.toSource()
|
|||
js> uneval(x.propertyThatDoesNotExist)
|
||||
undefined
|
||||
</pre>
|
||||
|
||||
<h3>Support for seal functions and changes in semantic of sealed objects</h3>
|
||||
<p>
|
||||
Rhino now supports <tt>seal(object)</tt> function which is another ECMAScript extension from SpiderMonkey. The function makes object immune to changes as any attempt to add, modify or delete a property of such object will throw an exception. Previously sealing was only possible through Java method <tt>sealObject()</tt> method in <tt>org.mozilla.javascript.ScriptableObject</tt> and before Rhino 1.5R5 it was possible to modify existing properties of sealed objects. See <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=203013">Bugzilla 203013</a>.
|
||||
See <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=225465">Bugzilla 225465</a>.
|
||||
</p>
|
||||
|
||||
<h3>seal() and changes in semantic of sealed objects</h3>
|
||||
<p>
|
||||
Rhino supports <tt>seal(object)</tt> function which is another ECMAScript extension from SpiderMonkey. The function makes object immune to changes and any attempt to add, modify or delete a property of such object will throw an exception. Previously sealing was only possible through Java method <tt>sealObject()</tt> method in <tt>org.mozilla.javascript.ScriptableObject</tt> and before Rhino 1.5R5 it was possible to modify existing properties of sealed objects.
|
||||
</p>
|
||||
<p>
|
||||
See <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=203013">Bugzilla 203013</a>.
|
||||
</p>
|
||||
|
||||
<h3>Exception changes</h3>
|
||||
<p>
|
||||
In Rhino 1.5R5 all script-related exceptions include source name of the script and number of the line that triggered exception. The exception class <tt>org.mozilla.javascript.JavaScriptException</tt> now is used only to represent exceptions explicitly thrown by scripts by JavaScript "throw" statement, it never wraps exceptions thrown by Java methods that called by scripts. Such exceptions are always wrapped now as <tt>org.mozilla.javascript.WrappedException</tt>. See <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=217584">Bugzilla 217584</a>, <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=219055">Bugzilla 219055</a>
|
||||
In Rhino 1.5R5 all exceptions generated during execution of a script provide information about script's source name and line number that triggered the exception. The exception class <tt>org.mozilla.javascript.JavaScriptException</tt> is used now only to represent exceptions explicitly thrown by the JavaScript <b>throw</b> statement, it never wraps exceptions thrown in a Java method invoked by the script. Such exceptions are always wrapped as <tt>org.mozilla.javascript.WrappedException</tt>.
|
||||
</p>
|
||||
<p>
|
||||
See <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=217584">Bugzilla 217584</a>, <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=219055">Bugzilla 219055</a>
|
||||
and <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=225817">Bugzilla 225817</a>
|
||||
</p>
|
||||
|
||||
<h3>Compiled scripts are scope independent</h3>
|
||||
<p>
|
||||
Previously Rhino required a scope object in the <tt>compileReader</tt> method of <tt>org.mozilla.javascript.Context</tt> to compile script into <tt>org.mozilla.javascript.Script</tt> instances. Under some circumstances it was possible that this object would be stored in the resulting compiled script preventing reuse of the compiled form to execute the script against different scopes. Now all such cases are removed and <tt>compileReader</tt> and newly introduced <tt>compileString</tt> no longer take the scope argument. For compatibility the old form of <tt>compileReader</tt> is kept as a deprecated method. See <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=218440">Bugzilla 218440</a>.
|
||||
Previously Rhino required a scope object in the <tt>compileReader</tt> method of <tt>org.mozilla.javascript.Context</tt> to compile a script into <tt>org.mozilla.javascript.Script</tt> instances. Under some circumstances it was possible that the scope object would be stored in the compiled form of the script. It made impossible in such cases to reuse of the compiled form to execute the script against different scopes and lead to potential memory leaks.
|
||||
<p>
|
||||
</p>Rhino 1.5R5 fixes such misbehavior and <tt>compileReader</tt> and newly introduced <tt>compileString</tt> no longer take the scope argument. For compatibility the old form of <tt>compileReader</tt> is kept as a deprecated method.
|
||||
</p>
|
||||
<p>
|
||||
In addition the new interface <tt>org.mozilla.javascript.Callable</tt> allows to execute scripts with JavaScript <tt>this</tt> keyword pointing to arbitrary object instead of defaulting to the scope object as <tt>exec</tt> method from <tt>org.mozilla.javascript.Script</tt> does.
|
||||
See <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=218440">Bugzilla 218440</a>.
|
||||
</p>
|
||||
|
||||
<h3>Callable interface</h3>
|
||||
<p>
|
||||
All <tt>org.mozilla.javascript.Script</tt> and <tt>org.mozilla.javascript.Function</tt> instances in Rhino now implements the new interface <tt>org.mozilla.javascript.Callable</tt> which together with the new <tt>call</tt> method in <tt>org.mozilla.javascript.Context</tt> gives a simple way to call scripts and functions without explicit calls to <tt>Context.enter()</tt> and <tt>Context.exit()</tt>.
|
||||
</p>
|
||||
<p>
|
||||
The <tt>Callable</tt> interface also allows to set the value of JavaScript <b>this</b> during script execution to arbitrary <tt>org.mozilla.javascript.Scriptable</tt> instance overriding default bahaviour of using the scope object for the value of <b>this</b>.
|
||||
</p>
|
||||
|
||||
|
||||
<h3>No static caching</h3>
|
||||
<p>
|
||||
Rhino no longer caches generated classes and information about reflected Java classes in static objects. Instead such caches by default are initialized once per call to <tt>initStandardObjects</tt> of <tt>org.mozilla.javascript.Context</tt> but this can be overridden with explicit call to the <tt>associate</tt> method of <tt>org.mozilla.javascript.ClassCache</tt> if cache sharing is desired. The change allows to instantiate multiple Rhino runtime instances which would not interfere with each other and prevents memory leaks throw ever growing caches.
|
||||
Rhino no longer caches generated classes and information about reflected Java classes in static objects. Instead such caches are stored in a top scope object and initialized by default during call to <tt>initStandardObjects</tt> of <tt>org.mozilla.javascript.Context</tt>. This can be overridden with explicit call to the <tt>associate</tt> method of <tt>org.mozilla.javascript.ClassCache</tt> if cache sharing is desired. The change allows to instantiate multiple Rhino runtime instances which would not interfere with each other and prevents memory leaks throw ever growing caches.
|
||||
</p>
|
||||
|
||||
<h3>New API for compiling scripts into class files</h3>
|
||||
<p>The new class <tt>org.mozilla.javascript.optimizer.ClassCompiler</tt> provides simple API to compile JavaScript source into set of Java class files with the given set of compilation options. <a href="jsc.html">JavaScript Compiler</a> was upgraded to use new API and the old API were deprecated.
|
||||
<h3>API for compiling scripts into class files</h3>
|
||||
<p>The new class <tt>org.mozilla.javascript.optimizer.ClassCompiler</tt> provides a simple API to compile JavaScript source into set of Java class files with the given set of compilation options. <a href="jsc.html">JavaScript Compiler</a> was upgraded to use new API and the old API were deprecated.
|
||||
</p>
|
||||
|
||||
<h3>Optimizer generates only one class per script </h3>
|
||||
<p>
|
||||
In Rhino 1.5R5 the default optimization mode generates only one class per script and all its functions where previously the optimizer generated additional class for each function definition in the script. It improves loading time for scripts and decreases memory usage especially for scripts with many function definitions. See <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=198086">Bugzilla 198086</a>.
|
||||
In Rhino 1.5R5 the default optimization mode generates only one Java class for script and all its functions while previously the optimizer generated additional class for each function definition in the script. It improves loading time for scripts and decreases memory usage especially for scripts with many function definitions.
|
||||
</p>
|
||||
<p>
|
||||
See <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=198086">Bugzilla 198086</a>.
|
||||
</p>
|
||||
|
||||
<h3>Improved support for huge scripts</h3>
|
||||
<p>
|
||||
The interpreted mode contains significantly less restrictions on size and complexity of the scripts and if the remaining restrictions are not satisfied, Rhino will report an exception instead of producing corrupted internal byte code.
|
||||
The interpreted mode contains significantly less restrictions on size and complexity of the scripts and if the remaining restrictions are not satisfied, Rhino will report an exception instead of generating corrupted internal byte code for interpreting.
|
||||
</p>
|
||||
<p>
|
||||
See <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=225831">Bugzilla 225831</a>.
|
||||
</p>
|
||||
|
||||
|
@ -100,7 +125,7 @@ The full list of Bugzilla reports addressed in Rhino 1.5R5 can be obtained with
|
|||
<br>
|
||||
<a href="http://bugzilla.mozilla.org/buglist.cgi?product=Rhino&target_milestone=1.5R5&bug_status=RESOLVED&bug_status=VERIFIED">http://bugzilla.mozilla.org/buglist.cgi?product=Rhino&target_milestone=1.5R5&bug_status=RESOLVED&bug_status=VERIFIED</a>
|
||||
<br>
|
||||
which searches <a href="http://bugzilla.mozilla.org/">bugzilla.mozilla.org</a> for all resolved or verified bugs with product Rhino and target milestone 1.5R5.
|
||||
which searches <a href="http://bugzilla.mozilla.org/">bugzilla.mozilla.org</a> for all resolved or verified bugs with the product set to Rhino and the target milestone set to 1.5R5.
|
||||
</p>
|
||||
|
||||
<hr width="100%"><br>
|
||||
|
|
Загрузка…
Ссылка в новой задаче