Граф коммитов

110 Коммитов

Автор SHA1 Сообщение Дата
norris%netscape.com abc0613496 Fix the following problem:
Subject:
        ImporterTopLevel problem
   Date:
        Fri, 6 Aug 1999 15:42:50 -0400
   From:
        "\"Howard\" Xuhua Lin" <howard@softcom.com>
     To:
        "Norris Boyd" <norris@netscape.com>
    CC:
        "Andrew Wason" <aw@softcom.com>




Hi, The following script will cause an EvaluatorException: Ambiguous import: [JavaPackage java.awt.JButton] and [JavaPackage
java.awt.Packages.javax.swing.JButton] in the js shell:

js>importPackage(java.awt);
js>importPackage(Packages.javax.swing);
js>new JButton();.

The current JS shell will not print this exception message, even though the comment says "// Already printed message, so just fall
through". I add System.err.println(ee.getMessage()); for this exception.

The problem is that in NativeJavaPackage.get(String, Scriptable) method, if a ClassNotFoundException is caught, a
NativeJavaPackage object is created and passed back to ImporterTopLevel.get Method. So in ImporterTopLevel.get method, object v
is always not NOT_FOUND and the ambiguous exception will be thrown. Object v is supposed to be a Class object but it actually is
a Package object.

The fix can be either (1) in NativeJavaPackage.get(String, Scriptable) method, if a ClassNotFoundException is caught, return a
NOT_FOUND object (you may still create a Package object) or (2) in ImporterTopLevel.get method, make sure the returned object
from NativeJavaPackage.get method is of NativeJavaClass type.

Howard
1999-08-12 16:59:29 +00:00
norris%netscape.com aadce49c83 A bunch of changes, some experimental.
Support for jsGet_ and jsSet_ prefixes to methods for explicit getter
and setter definition.
Addition of "importClass" and "importPackage" top-level functions.
The beginnings of a history object accessible from the shell.
1999-06-18 17:37:20 +00:00
norris%netscape.com d8c389dd95 Small reduction in code size. 1999-06-08 20:57:19 +00:00
norris%netscape.com 156c620890 Clean up formatting. 1999-06-07 18:14:15 +00:00
beard%netscape.com 37684b46df added top-level "environment" associative array - which provides JavaScript access to Java System properties. 1999-06-04 18:06:25 +00:00
beard%netscape.com 27c457e6a1 First Checked In. 1999-06-04 18:03:06 +00:00
norris%netscape.com cd2bce09ff Fix bug 6313 'Rhino: "new Function" doesn't work properly with superglobal'
Also clean up Context.exit() to be more consistent with Context.enter(),
and make SecuritySupport work with JavaAdapter.
1999-05-18 23:10:20 +00:00
norris%netscape.com 2cd15ff9fe Help message should indicate that -1 is an acceptible optimizer value. 1999-04-29 17:22:20 +00:00
norris%netscape.com ade142a34c Forgot to add Messages.properties. 1999-04-20 20:21:55 +00:00
norris%netscape.com 3a188e59ad Publish Rhino as open source. 1999-04-19 20:43:53 +00:00