blob: 8a159ae843191bc2b01201640934cc31afd2d6c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
---
title: Rhino requirements and limitations
slug: Mozilla/Projects/Rhino/Requirements_and_Limitations
translation_of: Mozilla/Projects/Rhino/Requirements_and_Limitations
---
<h2 id="Requirements" name="Requirements">Requirements</h2>
<p>Recent versions of Rhino have only been tested with JDK 1.4 and greater. Older versions support JDKs as early as 1.1.</p>
<p>To use the JavaAdapter feature or an optimization level of 0 or greater, Rhino must be running under a security manager that allows the definition of class loaders.</p>
<h2 id="Limitations" name="Limitations">Limitations</h2>
<h3 id="LiveConnect" name="LiveConnect">LiveConnect</h3>
<p>If a JavaObject's field's name collides with that of a method, the value of that field is retrieved lazily, and can be counter-intuitively affected by later assignments:</p>
<pre>javaObj.fieldAndMethod = 5;
var field = javaObj.fieldAndMethod;
javaObj.fieldAndMethod = 7;
// now, field == 7
</pre>
<p>You can work around this by forcing the field value to be converted to a JavaScript type when you take its value:</p>
<pre>javaObj.fieldAndMethod = 5;
var field = javaObj.fieldAndMethod + 0; // force conversion now
javaObj.fieldAndMethod = 7;
// now, field == 5
</pre>
<h3 id="JSObject" name="JSObject">JSObject</h3>
<p>Rhino does <strong>NOT</strong> support the <code class="filename">netscape.javascript.JSObject</code> class.</p>
|