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

296 Коммитов

Автор SHA1 Сообщение Дата
rogerl%netscape.com 3da3ea5d84 ECMA 3 array length error handling. 1999-09-27 17:44:30 +00:00
rogerl%netscape.com 836156934b Execute exec in the global scope. 1999-09-27 17:43:40 +00:00
rogerl%netscape.com 00f4d796de New tokens to support better error messages from Interpreter. 1999-09-27 17:43:07 +00:00
beard%netscape.com c8a74166b5 Fixed looking up 'length' property in Function objects: needed to look up prototype chain for zero arguments. Cleaned up some more, always storing Boolean.TRUE in local hash tables, rather than the method, methodKey or methodName. 1999-09-25 09:24:23 +00:00
beard%netscape.com d9a9d82316 Added ClassSignature, a key for caching generated adapter classes. Now passing superName, rather than superClass to constructor generation methods. 1999-09-25 08:11:24 +00:00
beard%netscape.com 82ff8f1cea Fixed generateSuper when override has void return type. 1999-09-25 01:37:32 +00:00
norris%netscape.com a600a94fa3 Shorten name to make Mac developers happy. 1999-09-24 21:05:41 +00:00
norris%netscape.com 9dbb033545 Patches from Kurt Westerfeld for JavaScript property access to JavaBeans.
Subject:
        Re: [Fwd: [Bug 13658] Changed - Rhino: null pointer exception on class with duplicate field/method]
   Date:
        Mon, 13 Sep 1999 20:57:32 -0400
   From:
        "Kurt Westerfeld" <kurt@westerfeld.com>
     To:
        "Norris Boyd" <norris@netscape.com>




I do have a patch for this, but it is intermixed with some other changes
that I have implemented for the get/set on Java instances (per my LC3
proposal).  The bug requires changes that are a little involved actually;
basically it seems that when getting the default value for a "field and
methods" (which combines the same-named entities), the prototype of the
parent scope is deref-ed, and the parent scope is null.  Hence, the scope
must be passed into the the cloned field and method values.

Also, the NativeJavaClass implementation passed "false" for isStatic on the
constructor of the FieldAndMethods Hashtable, which results in classes
having instance methods.  Bad.  I haven't filed a bug on that yet.
Additionally, I fixed a couple other NullPointerException nigglies thrown in
when exceptions are propagated in the same area.  Finally, when getting the
default value for the field, it is helpful to convert a Scriptable to string
when that is requested (as when typing in the console).

I am attaching the changed files.  The LC3++ code can be removed if you
want, which I can do for you but it will take a little longer.  What is your
preference?

-----Original Message-----
From: Norris Boyd <norris@netscape.com>
To: Kurt Westerfeld <kurt@westerfeld.com>
Date: Monday, September 13, 1999 4:54 PM
Subject: [Fwd: [Bug 13658] Changed - Rhino: null pointer exception on class
with duplicate field/method]


>Kurt,
>
>Is this the bug that your patch fixes?
>
>Thanks,
>Norris
>
1999-09-24 20:41:43 +00:00
norris%netscape.com e3ce18cbc8 Propagate files from old netscape code. 1999-09-24 20:05:59 +00:00
norris%netscape.com 4c9c27afaa Implement the "cast" of java class objects so that js objects in java adapters can
use 'this' for the implemented java interface.
1999-09-24 18:20:08 +00:00
beard%netscape.com 45eaa0a35f Added "generateSuper" which generates a method called "super$method()" which when called calls "super.method()." This is provided to support full sub-classing of Java classes from JavaScript. 1999-09-24 18:17:05 +00:00
beard%netscape.com 6c69fd36dc added a prototype field, so that a wrapped JavaAdapter can preserve the delegate object's original prototype chain. 1999-09-24 16:52:23 +00:00
beard%netscape.com d06b137123 setAdapterProto: now splices in wrapper's prototype, rather than replacing object's original prototype chain. seems to work fine. 1999-09-24 16:51:25 +00:00
rogerl%netscape.com 8cb72034b7 New error for wacky array lengths, ECMA 3 1999-09-23 23:19:00 +00:00
norris%netscape.com 3d5cdd4959 Fix some Array tests in the ecma suite. 1999-09-23 20:37:56 +00:00
rogerl%netscape.com 84e2dbf549 Can't assume object in reportConversionError is scriptable, so call more
generic java.object.toString instead.
1999-09-22 22:06:14 +00:00
norris%netscape.com b21d1d574c Allow a java.lang.String to be converted to a primitive string in getDefaultValue 1999-09-22 16:30:49 +00:00
norris%netscape.com e798fcce86 Fix "wapper". 1999-09-22 16:25:21 +00:00
beard%netscape.com b4d5f900ca JavaAdapter no longer uses FlattenedObject, since the prototype is simply the LiveConnect wrapper. 1999-09-22 08:22:53 +00:00
beard%netscape.com ec3b77cdbb JavaAdapter no longer uses FlattenedObject, since the prototype is simply the LiveConnect wrapper. Simplified callMethod to only call Context.enter() if methodId property is defined in Scriptable object. 1999-09-22 08:22:47 +00:00
beard%netscape.com fee310a6a7 renamed "name" parameter "adapterName", removed explicit StringBuffer in favor of "adapter" + serial++ for clarity. 1999-09-22 03:54:00 +00:00
beard%netscape.com 6aa5fe5fe6 changed createAdapterClass() to only generate methods for properties defined in the wrapped object itself, not for properties defined in prototypes. This makes sense, as the prototype for the wrapped object becomes the LiveConnect wrapper, thus prototype properties become inaccessible anyway. 1999-09-22 01:32:05 +00:00
rogerl%netscape.com 53952765f6 (Bug #13416)
Turned off 'super' keyword - was letting through some cut'n'pasted java
code quietly and blowing big chunks out of the codegen/interpreter later.
Anybody know why 'super' had an interesting value here? - there was no
support for it on any path that I could see.
1999-09-20 22:21:24 +00:00
norris%netscape.com d66f23fafa Changes necessary to generate adapter classes to files with associated optimizer package. 1999-09-20 21:16:45 +00:00
norris%netscape.com 08c1752616 Fix comments. 1999-09-17 16:38:51 +00:00
norris%netscape.com e3ec2e1782 fix comment 1999-09-17 16:37:35 +00:00
norris%netscape.com 14eadb66ef Clearer example. 1999-09-17 06:12:45 +00:00
norris%netscape.com 60c5cbcb99 Tutorial examples. 1999-09-17 05:54:27 +00:00
norris%netscape.com aca2a22c7a Fix potential NullPointerException. 1999-09-10 18:39:04 +00:00
norris%netscape.com 34c9c62f33 Two submissions from Kurt Westerfield <kurt@westerfield.com>:
Subject:
        Embedding the shell
   Date:
        Wed, 8 Sep 1999 16:01:44 -0400
   From:
        "Kurt Westerfeld" <kurt@westerfeld.com>
     To:
        "Norris Boyd" <norris@netscape.com>




Norris, please find the attached zip file containing the (minor)
modifications to the Rhino shell module that enables the shell to be
embedded in a host application.

There are two areas of change to be concerned about:

    1. Any and all references to System.in/out/err have been modified to use
Main.in/out/err, which default to System.in/out/err.  Methods to do a setIn,
setOut, and setErr were added.   Note that in/out/err on Main were made
static public, so that the jikes compiler wouldn't complain (I had them as
static protected, but when accessed outside of the package, a warning was
issued).

    2.  The global and sharedGlobal static variables were made protected so
that my app can make use of them (to add extensions after an initial pass
through main()).

That's it.

I have successfully used the facility to drop a remote telnet server into
the shell interpreter, effectively giving our server a remote shell
interpreter.  It's quite nice, as we have a lot of extensions to Rhino
written that blend into our server already.

PS, I am still working on the array issues, but made a lot of progress
today.  I just wanted to get this stuff off my desk.

Thanks!

________________________________________________________________________
  Kurt Westerfeld
  Managed Object Solutions
  2722 Merrilee Drive
  Suite 350
  Fairfax, VA 22031
  Phone: 703.208.3330 x225
  Fax: 703.208.3331
  http://www.mosol.com
  mailto:kurt@mosol.com



   shell.zip

             Name:
                   shell.zip
             Type:
                   Zip Compressed Data (application/x-zip-compressed)
          Encoding:
                   base64


==============================================================================

Subject:
        Rhino Array Source (Fixed)
   Date:
        Thu, 9 Sep 1999 14:12:03 -0400
   From:
        "Kurt Westerfeld" <kurt@mosol.com>
     To:
        "Norris Boyd" <norris@netscape.com>




Attached is NativeJavaObject.java, which seems to now pass the tests supplied to me by you and Scott.  Not a lot of change, but a lot of
testing and thinking was involved. <g>

PS. I also fixed a bug in reportConversionError() which was throwing an IllegalArgumentException inside of the MessageFormat class at times.
It also looks a little nicer (uses formatting from NativeJavaMethod) and closer to the C implementation.




   NativeJavaObject.java

                        Name:
                              NativeJavaObject.java
                         Type:
                              Java Source File (text/java)
                     Encoding:
                              quoted-printable
1999-09-09 18:49:58 +00:00
norris%netscape.com 5e46da0224 Long not supported here. Fix up comments so that is clear. 1999-09-02 16:48:20 +00:00
rogerl%netscape.com a498530aa5 Fixes for ecma 2 regexp - adding context to init 1999-08-25 01:05:42 +00:00
rogerl%netscape.com e089e6f867 Fixes for ecma 2 regexp - adding context to init. 1999-08-25 01:03:06 +00:00
rogerl%netscape.com 60f4c56d75 New errors for ecma 2 regexp. 1999-08-25 01:01:19 +00:00
rogerl%netscape.com 03a9476464 Fixes for ecma 2 - add context to regexp init. 1999-08-25 01:00:09 +00:00
rogerl%netscape.com 8c0f28df90 Fixed \<digits> interpretation for ecma 2 compliance. 1999-08-25 00:59:21 +00:00
norris%netscape.com 179e277ffe Add a comment. 1999-08-16 18:54:47 +00:00
beard%netscape.com 2fdb417734 js now propagates ThreadDeath exceptions 1999-08-14 02:32:20 +00:00
beard%netscape.com dcae8601b3 added mozilla/js/rhino/org/mozilla/javascript/tools/shell/SharedGlobal.java 1999-08-14 02:01:00 +00:00
norris%netscape.com f317859421 Fix more importerTopLevel problems. 1999-08-13 20:44:46 +00:00
norris%netscape.com 4ae628be8d Fix problem:
The fix sort of works. But there are some new problems. I enclosed two JavaScript files, button.js and image.js.

If I load button.js first and then image.js, I got the following:

js> load("button.js");
js> load("image.js");
Ambiguous import: [JavaClass javax.swing.ImageIcon] and [JavaClass javax.swing.ImageIcon]
js> load("image.js");
Ambiguous import: [JavaClass java.net.URL] and [JavaClass java.net.URL]
js> load("image.js");
Ambiguous import: [JavaClass java.lang.System] and [JavaClass java.lang.System]
js> load("image.js");
loadImage for 0
Ambiguous import: [JavaClass java.awt.Toolkit] and [JavaClass java.awt.Toolkit]
js> load("image.js");
loadImage for 0
js>

If I load imag.js first and then button.js, I got the following:

js> load("image.js");
loadImage for 0
js: [JavaPackage java.lang.URL] is not a function.
[JavaPackage java.lang.URL] is not a function.
js> load("image.js");
js: [JavaPackage java.lang.ImageIcon] is not a function.
[JavaPackage java.lang.ImageIcon] is not a function.
js> load("image.js");
js: [JavaPackage java.lang.ImageIcon] is not a function.
[JavaPackage java.lang.ImageIcon] is not a function.
js> load("image.js");
js: [JavaPackage java.lang.ImageIcon] is not a function.
[JavaPackage java.lang.ImageIcon] is not a function.
js> load("button.js");
js: [JavaPackage java.lang.JButton] is not a function.
[JavaPackage java.lang.JButton] is not a function.
js> load("button.js");
js: [JavaPackage java.lang.JButton] is not a function.
[JavaPackage java.lang.JButton] is not a function.
js> load("image.js");
js: [JavaPackage java.lang.ImageIcon] is not a function.
[JavaPackage java.lang.ImageIcon] is not a function.
js>

It looks like something wrong in the image.js file but this should not interfere with button.js. It looks like some arbitary package objects are created, like java.lang.URL. This happened in NativeJavaPackage.get method. If a class of java.lang.URL is not found, a package object is then created. So next time the interpreter encounters URL, it somehow uses the object java.lang.URL instead of the correct class object java.net.URL.. This is one problem. The interference between button.js and jmage.js is another problem.

Howard
  ----- Original Message -----
  From: Norris Boyd
  To: \ Howard\\ Xuhua Lin
  Sent: Thursday, August 12, 1999 12:58 PM
  Subject: Re: ImporterTopLevel problem


  Sorry I've been slow. I finished up the fix this morning and have posted it on the ftp site and checked into cvs.
  Let me know if it works for you.

  --Norris

  \"Howard\" Xuhua Lin wrote:

    Hi, Norris, what's the status of the ImporterTopeLevel problem (i.e if you use importPackage twice, you will get an "Ambiguous import" exception)? Are you still working on it? Howard
1999-08-13 17:25:14 +00:00
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
rogerl%netscape.com 0fb847d2e5 Converting value type for setter method to match declared type. 1999-08-11 18:33:48 +00:00
rogerl%netscape.com f7d87ad41d Factored out convertArg so that it can be called from ScriptableObject
for setter methods.
1999-08-11 18:31:34 +00:00
rogerl%netscape.com 1d17ab4d1f Undo captures from failed OPT child 1999-08-11 04:34:52 +00:00
rogerl%netscape.com 6c61f8bdb0 Tentative fix for allowing call to 'exec' on RegExp objects. 1999-08-11 04:34:05 +00:00
rogerl%netscape.com 949625b502 Fix 'zero' & 'one' to use byte instead of Double 1999-08-11 04:33:08 +00:00
rogerl%netscape.com d7aeb2cd5a Fixed limit parameter interpretation to match ecma_2 spec. 1999-08-10 23:36:23 +00:00
norris%netscape.com 00f712e786 Fix problem found by Andrew Wason <aw@softcom.com>:
Subject:
        reflection and illegal package access
   Date:
        Wed, 04 Aug 1999 21:56:20 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com (Norris Boyd)
    CC:
        Howard Lin <howard@softcom.com>




If you run Rhino under JDK1.2 with a security manager:

java -Djava.security.manager=java.lang.SecurityManager
org.mozilla.javascript.tools.shell.Main

Then reflection fails for objects that are in a restricted access package
(e.g. sun.*).  Rhino is reflecting based on the dynamic type of the object
instead of the declared static return type.

In this example, createImage is declared to return java.awt.Image, but it
returns sun.awt.image.OffScreenImage.  Attempting to reflect this class
results in a java.security.AccessControlException for
java.lang.RuntimePermission accessClassInPackage.sun.awt.image.

Here is the script.  You will need to type it in because you won't be able
to load it from a file due to the security manager.

var f = new java.awt.Frame();
f.setVisible(true);
var i = f.createImage(10,10);
1999-08-05 16:49:20 +00:00
norris%netscape.com 7c5ca20070 Fix problem found by Andrew Wason <aw@softcom.com>:
Subject:
        null arguments
   Date:
        Wed, 04 Aug 1999 13:22:35 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com
    CC:
        Howard Lin <howard@softcom.com>




When I try to pass a null argument to an interface implemented in JS, I get:

js: Cannot convert null to an object.
js: uncaught JavaScript exception:
org.mozilla.javascript.EvaluatorException: Cannot convert null to an object.


var b = new Packages.javax.swing.border.Border() {
        getBorderInsets : function(c) {
                return new Insets(0,0,0,0);
        }
};
b.getBorderInsets(null);


Here is the stack trace where the exception is happening:

java.lang.reflect.InvocationTargetException:
org.mozilla.javascript.EvaluatorException: Cannot convert null to an object.
         at
org.mozilla.javascript.tools.ToolErrorReporter.runtimeError(ToolErrorReporte
r.java:106)
         at org.mozilla.javascript.Context.reportRuntimeError(Context.java:484)
         at org.mozilla.javascript.Context.reportRuntimeError(Context.java:500)
         at
org.mozilla.javascript.ScriptRuntime.toObject(ScriptRuntime.java:529)
         at org.mozilla.javascript.Context.toObject(Context.java:1107)
         at adapter0.getBorderInsets(<adapter>)
         at java.lang.reflect.Method.invoke(Native Method)
         at
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java,
Compiled Code)
         at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1256)
         at org.mozilla.javascript.Interpreter.interpret(Interpreter.java,
Compiled Code)
         at
org.mozilla.javascript.InterpretedScript.call(InterpretedScript.java:49)
         at
org.mozilla.javascript.InterpretedScript.exec(InterpretedScript.java:37)
         at org.mozilla.javascript.Context.evaluateReader(Context.java:691)
         at
org.mozilla.javascript.tools.shell.Main.processSource(Main.java, Compiled Code)
         at org.mozilla.javascript.tools.shell.Main.main(Main.java:146)


Context.toObject does not allow wrapping nulls.
JavaAdapter.generateOverride should generate bytecode to check if an
argument is null and if it is not call Context.toObject.

I'll take a look at fixing this after the other JavaAdapter patches get
checked in so we don't get out of sync.

Andrew
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com
1999-08-04 23:14:57 +00:00
norris%netscape.com 452bf1af92 Fix bug 11077 "ScriptableObject.defineFunctionProperties() uses invalid signature check."
The check was actually okay, but the error message didn't state the error correctly.
1999-08-04 19:37:51 +00:00
norris%netscape.com b8ad6df8ca * Take advantage of the new semantics of Context.enter & exit to save codesize.
* Accept patch from Andrew Wason <aw@softcom.com>:

Subject:
        Re: partial interface problem
   Date:
        Wed, 04 Aug 1999 13:04:37 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com
    CC:
        Howard Lin <howard@softcom.com>




>I'm having a problem implementing a Java interface in JS where I don't
>implement all the methods, and one of the methods I don't define returns
>non-void.

I have a patch for this.  I generate bytecode in
JavaAdapter.generateReturnResult to check the return type on the stack from
JavaAdapter.callMethod.  If it is Undefined, return null.

I'm not positive this is the right way to fix this - maybe it should be
fixed closer to the source (e.g. prevent callMethod from returning
Undefined to begin with)

Andrew

--
Andrew Wason
SoftCom, Inc.
aw@softcom.com
1999-08-04 17:43:18 +00:00
norris%netscape.com 94b8197903 Accept patch (with modifications) from Andrew Wason <aw@softcom.com>:
Subject:
        default JavaAdapter patch
   Date:
        Tue, 20 Jul 1999 15:35:01 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com
    CC:
        mccabe@netscape.com, rogerl@netscape.com




Attached is a patch to the patch I sent a while ago for the JavaAdapter stuff.

If a SecurityManager is installed, attempting to access the
"org.mozilla.javascript.JavaAdapter" system property can throw a
SecurityException.  This should not prevent the default JavaAdapter
implementation from being used.

Andrew
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com
1999-08-04 16:56:18 +00:00
mccabe%netscape.com 6618e19762 Added missing ImporterTopLevel.java and ListenerCollection.java files to the source list.
Thanks to Andrew Wason <aw@softcom.com> for noticing this problem.
1999-08-04 02:50:47 +00:00
rogerl%netscape.com 5e4cc01584 Updated internal name of exec function to match new naming rules. 1999-08-03 22:41:57 +00:00
mccabe%netscape.com 56ac346458 - Added OS_TARGET-switched definition of CLASSPATHSEP, to support building under Windows NT with GNU make. Thanks to Andew Wason <aw@softcom.com> for this fix.
- Removed outdated references to JSDEBUG_JAR.
1999-08-03 22:15:02 +00:00
norris%netscape.com 14d89e5bff Adding patch (with slight modifications for javadoc) from Andrew Wason <aw@softcom.com>:
Subject:
        Rhino reflection patch
   Date:
        Wed, 28 Jul 1999 18:14:52 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com
    CC:
        mccabe@netscape.com, rogerl@netscape.com, Howard Lin <howard@softcom.com>




When JavaAdapter generates an adapter class, it does not take into account
the types of method parameters when wrapping the generated methods arguments.

This means that if a non-public class implements a public interface the
non-public class type will be wrapped instead of the declared public
interface - and methods cannot be invoked via the wrapper.

I have attached sample code (reflect-demo.zip) which shows this.  The
JavaScript caller.js generates an adapter implementing the CallerInterface
interface.  CallerInterface has a method (doSomething) which takes an
argument of type pkg.Interface.  pkg.Target is a non-public class that
implements pkg.Interface.  If an instance of pkg.Target is passed to the
CallerInterface adapter doSomething method, an Error is thrown because
pkg.Target.doSomething is called (instead of pkg.Interface.doSomething) and
pkg.Target is not public.

I have attached a patch to Context.java, ScriptRuntime.java and
JavaAdapter.java.  I overloaded toObject in Context and ScriptRuntime to
take a 3rd argument which is the declared type of the object being
wrapped.  This is passed to NativeJavaObject.wrap so that it generates the
correct wrapper. I changed JavaAdapter.generateOverride to generate
bytecode calling Context.toObject passing the declared Class type of the
argument.

Context.java also includes my previously submitted patch for dealing with
SecurityExceptions and the JavaAdapter property (because this patch has not
been checked into CVS yet).

Andrew

--
Andrew Wason
SoftCom, Inc.
aw@softcom.com



   reflect-patch.txt

                Name:
                      reflect-patch.txt
                 Type:
                      Plain Text (text/plain)




   reflect-demo.zip

                   Name:
                         reflect-demo.zip
                    Type:
                         Zip Compressed Data (application/x-zip-compressed)
                Encoding:
                         base64
1999-08-03 21:24:39 +00:00
norris%netscape.com e48746d3bd Remove unused clone() method. 1999-08-03 20:40:25 +00:00
mccabe%netscape.com 71d9e10c3c Further fix to properly include classes from the org.mozilla.classfile package in the generated .jar file.
Thanks to Andrew Wason <aw@softcom.com> for his continued work on the Rhino make system.
1999-08-03 00:25:30 +00:00
mccabe%netscape.com 3824e4ce66 Add the classes defined in org/mozilla/classfile to js.jar. 1999-08-02 09:01:19 +00:00
mccabe%netscape.com 01f06bc645 Fix code to invoke Wrapper interfaces using INVOKEINTERFACE rather than INVOKEVIRTUAL.
Thanks go to Andrew Wason <aw@softcom.com> for finding this problem and providing the patch:



If we implement a Java interface in JavaScript, and a method in that interface returns a Java object, we get a java.lang.IncompatibleClassChangeError: org/mozilla/javascript/Wrapper  exception.

We have attached a sample JavaScript file which duplicates the error.

The problem is JavaAdapter is generating an INVOKEVIRTUAL bytecode to call Wrapper.unwrap, but Wrapper is an interface and so INVOKEINTERFACE should be used instead.  As a result of this change, the IFEQ bytecode generated needs to jump more bytes.  We have attached a patch that fixes the problem.

Andrew
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com
1999-07-26 10:45:38 +00:00
mccabe%netscape.com 05ad44c9f8 Added NPL. 1999-07-26 10:41:46 +00:00
mccabe%netscape.com 4ebeecff4e Comment fixes.
- normalized initial MPL comment to match the format of others in the tree, including an initial -*- Mode line.

- removed RCS $log$, etc. comments.  We use CVS, and they just make spurious changes...
1999-07-26 10:40:53 +00:00
norris%netscape.com 1eb0a9e85e Add new example. 1999-07-16 03:03:20 +00:00
norris%netscape.com d1249dd430 Report errors for incorrect usages of varargs forms. 1999-07-08 16:32:51 +00:00
norris%netscape.com 67d7d2b31e Fix javadoc bug. 1999-07-08 00:37:12 +00:00
norris%netscape.com d44417769f Fix bug in ScriptableObject that make classes with jsGet_ but not jsFunction_ work improperly.
Also update Foo example to conform to new defineClass API.
1999-07-06 17:13:33 +00:00
beard%netscape.com df4127f63c added ImporterTopLevel.java 1999-06-19 23:38:35 +00:00
norris%netscape.com 3797e07208 Add support for selectively filtering Java classes' visibility to JS 1999-06-18 21:35:35 +00:00
norris%netscape.com e9b22cde54 Reduce need for a current context. 1999-06-18 21:32:18 +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
frankm%eng.sun.com c15f5fed6c Add "fast" make target, to compile only changed files. 1999-06-14 21:51:52 +00:00
frankm%eng.sun.com 02111815df Revamp NativeJavaObject.coerceType and associated methods to make code
more maintainable, and to pass lc3/JSObject/ToChar-001.js.
1999-06-12 01:41:20 +00:00
frankm%eng.sun.com 0ec049218f Fixes for LC3 regression tests, including:
- check static members of instances in JavaMembers.put

- do not unwrap Wrappers before calling NativeJavaMethod.findFunction
     or NativeJavaObject.coerceType; both methods may need extra information
     provided by the wrapper.

- separate Java signatures for resolving overloaded methods and script
     signatures for error messages, so we can distinguish primitive types
     from classes.

- separate Java signatures for resolving overloaded methods and script
     signatures for error messages, so we can distinguish primitive types
     from classes.

- prevent a NativeJavaClass from being treated as a wrapped instance of
     java.lang.Class

- correct bug which preferred the *less* specific of two classes in
     NativeJavaMethod.preferSignature

- add new LC3 conversion rules to  NativeJavaObject.coerceTypes.

- coerce JS numbers to Java numbers or chars only if the JS number is in
     range.
1999-06-11 01:24:40 +00:00
rogerl%netscape.com 5542344a17 Added base to ScriptRuntime.numberToString, NativeNumber.toString()
Bug #7625
1999-06-10 01:54:28 +00:00
norris%netscape.com d8c389dd95 Small reduction in code size. 1999-06-08 20:57:19 +00:00
rogerl%netscape.com 0051b03950 Fixed bug #7703, typeof<var> wasn't referencing activation frame vars
correctly.
1999-06-07 22:29:41 +00:00
norris%netscape.com 156c620890 Clean up formatting. 1999-06-07 18:14:15 +00:00
norris%netscape.com b3091ef631 Optimization: avoid allocating a Vector object for every LiveConnect call. 1999-06-07 18:13:15 +00:00
beard%netscape.com f2e26e1672 added NativeJavaConstructor.java 1999-06-05 08:20:54 +00:00
frankm%eng.sun.com 1d94646a5d Replace *.class with ScriptRuntime.*Class; added ScriptRuntime.ClassClass 1999-06-05 01:48:24 +00:00
mccabe%netscape.com bed5574ac7 Backing out demo cvs checkin. 1999-06-04 22:27:50 +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
beard%netscape.com 1f8aa1d994 File Removed. 1999-06-04 17:43:35 +00:00
beard%netscape.com 4f5a2326f6 added Environment.java 1999-06-04 17:43:17 +00:00
norris%netscape.com 26673d9939 Subject:
Re: netscape.javascript.JSObject ?
        Date:
             Thu, 03 Jun 1999 17:52:42 -0700
       From:
             Frank Mitchell <frankm@eng.Sun.COM>
 Organization:
             Java Products Engineering
         To:
             Norris Boyd <norris@netscape.com>
  References:
             1 , 2 , 3 , 4 , 5 , 6 , 7 , 8




Norris Boyd wrote:
>
> Sorry--missed the checkin of a new file. It's there now.
>
> I'd also added a small change for the "inheritance" of JavaScript array methods.

Actually, I've already done that (and for String as well).  It still
fails some LC3 regression tests, though.

I'm including a tarfile that includes the previous changes and the new
ones.

Frank
1999-06-04 16:25:41 +00:00
norris%netscape.com 1756dcf1a9 Add NativeJavaConstructor.java 1999-06-04 16:06:14 +00:00
mang%subcarrier.org 2d4bb78638 Added doc comment 1999-06-03 23:39:57 +00:00
norris%netscape.com 45e66dd4d3 LC3 support: make Java arrays have Array.prototype as a prototype. 1999-06-03 23:38:47 +00:00
norris%netscape.com 099c73edaa Subject:
Re: Rhino LiveConnect: need help?
        Date:
             Wed, 02 Jun 1999 19:33:37 -0700
       From:
             Frank Mitchell <frankm@eng.Sun.COM>
 Organization:
             Java Products Engineering
         To:
             Scott Furman <fur@netscape.com>, Norris Boyd <norris@netscape.com>
         CC:
             mallen@eng.Sun.COM
  References:
             1 , 2 , 3 , 4




Scott Furman wrote:
> In order to bring Rhino LiveConnect support up to the level of the
> C-engine, the features of LiveConnect version 2 and version 3 would
> need to be added.  You can see some details of LC2 and LC3 features
> here.  I would guess that 80% of the time would be spent implementing
> one feature: LC3's new method overload resolution scheme.


OK, I think I have something that implements the new overloaded method
resolution scheme ... I'm still working on getting the regression tests
running smoothly, but from command-line testing it seems to work.  It's
not the *cleanest* code I've ever done, though: in particular, it has
too many static methods and type-checking code for my tastes.  (Hey,
should we spin the type coercion and comparison stuff to some other
module entirely?  Right now it's mostly in JavaNativeObject, with the
preference stuff in JavaNativeMethod.)  I'm also not sure why some of
this stuff is public, and whether there might be backward-compatibility
problems with what I've done, particularly in repurposing the
COMPARISON_* constants.

Would you guys be kind enough to review this for me?  I'm hoping to
check it in once I get an ID, but it wouldn't hurt to have another pair
of eyes or three (pairs, I mean).  I've attached a tar/gzip of the
source files I've changed (or added), plus a diff.

Thanks,
Frank
1999-06-03 23:38:00 +00:00
norris%netscape.com ad3fb5ff8c Subject:
Re: Rhino LiveConnect: need help?
        Date:
             Wed, 02 Jun 1999 19:33:37 -0700
       From:
             Frank Mitchell <frankm@eng.Sun.COM>
 Organization:
             Java Products Engineering
         To:
             Scott Furman <fur@netscape.com>, Norris Boyd <norris@netscape.com>
         CC:
             mallen@eng.Sun.COM
  References:
             1 , 2 , 3 , 4




Scott Furman wrote:
> In order to bring Rhino LiveConnect support up to the level of the
> C-engine, the features of LiveConnect version 2 and version 3 would
> need to be added.  You can see some details of LC2 and LC3 features
> here.  I would guess that 80% of the time would be spent implementing
> one feature: LC3's new method overload resolution scheme.


OK, I think I have something that implements the new overloaded method
resolution scheme ... I'm still working on getting the regression tests
running smoothly, but from command-line testing it seems to work.  It's
not the *cleanest* code I've ever done, though: in particular, it has
too many static methods and type-checking code for my tastes.  (Hey,
should we spin the type coercion and comparison stuff to some other
module entirely?  Right now it's mostly in JavaNativeObject, with the
preference stuff in JavaNativeMethod.)  I'm also not sure why some of
this stuff is public, and whether there might be backward-compatibility
problems with what I've done, particularly in repurposing the
COMPARISON_* constants.

Would you guys be kind enough to review this for me?  I'm hoping to
check it in once I get an ID, but it wouldn't hurt to have another pair
of eyes or three (pairs, I mean).  I've attached a tar/gzip of the
source files I've changed (or added), plus a diff.

Thanks,
Frank
1999-06-03 23:22:27 +00:00
rogerl%netscape.com 2928c8a438 Changed behaviour of Script.exec so that it gains access to the current
scope when invoked, rather than grabbing the topmost. Prevented exec from
being called indirectly.
1999-06-03 00:08:00 +00:00
rogerl%netscape.com aa6634762d blowing off commented out junk 1999-06-02 18:07:40 +00:00
norris%netscape.com c4a8882517 Fix NullPointerException for "abc".match("a\"); 1999-06-02 16:12:19 +00:00
rogerl%netscape.com 87b0695b45 Bug #6359 and other changes motivated by Waldemar's specification. 1999-05-26 22:28:32 +00:00
norris%netscape.com d2409b9e5b Fix bug 6705. 1999-05-26 19:55:51 +00:00
norris%netscape.com 925eb75371 Remove class path for merging into a single JAR file. 1999-05-26 19:52:40 +00:00
norris%netscape.com 1816055731 fix node property printing 1999-05-26 19:48:45 +00:00
norris%netscape.com dbcd8dbb66 clean up formatting 1999-05-26 19:48:02 +00:00
beard%netscape.com 4415dbcda7 First Checked In. 1999-05-24 20:48:58 +00:00
beard%netscape.com 20540e64d7 added mozilla/js/rhino/org/mozilla/javascript/ListenerCollection.java 1999-05-23 20:07:05 +00:00
norris%netscape.com f138298617 Manifest for jstools.jar to enable use of 1.2 -jar option. 1999-05-21 06:13:37 +00:00
norris%netscape.com e2b6e5bcc0 Add methods for getting and setting key-value pairs. 1999-05-20 23:54:53 +00:00
norris%netscape.com 1fa0abf6f3 Remove Java 2 dependency. 1999-05-19 23:58:37 +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 da040c8847 Fix formatting. 1999-05-18 22:55:11 +00:00
norris%netscape.com d2be04fb36 Clearer formatting. 1999-05-18 22:54:15 +00:00
norris%netscape.com ad7bde6769 Add submission:
Subject:
            Re: Modified Context.java
       Date:
            Sat, 15 May 1999 08:01:37 +0000
      From:
            "Ian D. Stewart" <idstewart@softhome.net>
        To:
            Norris Boyd <norris@netscape.com>
 References:
            1 , 2 , 3 , 4 , 5




Ian D. Stewart wrote:

  Norris Boyd wrote:




    Can I help with EventListener collector?

  Actually, I have a working implementation complete (attatched), but by all means, feel free to add any functionality you feel
  may be missing, or to tweak the code .

Norris,

After I sent I my last e-mail, I noticed some potential issues using Object[] in ListenerCollection.getListeners(Class iface).
I'm attatching a new version, which uses a Vector object.  This should resolve those issues.


Ian
1999-05-18 22:32:25 +00:00
norris%netscape.com 481172ae0b Subject:
Rhino SecurityException patch
   Date:
        Tue, 11 May 1999 12:25:50 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        Norris Boyd <norris@netscape.com>




Sorry if you aren't the right person to submit Rhino patches to.

I couldn't get Rhino to run under JDK1.2 with a SecurityManager installed
(e.g. java -Djava.security.manager=java.lang.SecurityManager).  I
understand the JavaAdapter stuff won't work - but I would still like to use
Rhino without that piece.

I've attached a small patch which catches and ignores the
SecurityExceptions so that Rhino can run with a SecurityManager but without
JavaAdapter.


Andrew
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com
1999-05-11 16:46:30 +00:00
norris%netscape.com 70e2ddfa1f A statement like "var java;" was hiding the java package defined in the
shared global since we weren't looking up the prototype chain.
1999-05-10 18:09:49 +00:00
mccabe%netscape.com a47510f99d Added references to the JavaAdapter and classfile classes. 1999-05-06 23:49:10 +00:00
norris%netscape.com b912fb1d8e Marginal performance tweak. 1999-05-06 23:17:12 +00:00
mccabe%netscape.com 9e675bb870 Initial checkin of distribution makefile system for our brandfangled free source Rhino. 1999-05-06 07:51:15 +00:00
norris%netscape.com 3b4d810964 Update release string. 1999-05-05 23:29:06 +00:00
norris%netscape.com 3bc469d6ab Handle the case where f is null in "new f". 1999-05-04 17:23:13 +00:00
norris%netscape.com 7d8669fc9e Fix spelling, don't claim uniqueness. 1999-05-03 17:56:07 +00:00
norris%netscape.com 3d522b3a69 Make it purdy. 1999-05-03 17:55:21 +00:00
norris%netscape.com e43d1ea1e1 Add README with support for LXR. 1999-05-03 17:53:10 +00:00
norris%netscape.com 93c85436e2 Add new example. 1999-04-30 19:49:34 +00:00
norris%netscape.com c999e3e6be Better (?) error when initializing and the security resource isn't found. 1999-04-30 16:56:43 +00:00
norris%netscape.com 2d389423af Fall through to number case only after considering character and boolean
independently.
1999-04-29 20:51:50 +00:00
norris%netscape.com 02d3b99592 Fix bug where conversions of numbers to booleans in calls to Java methods were producing
IllegalArgumentExceptions.
1999-04-29 17:53:05 +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
rogerl%netscape.com 18f533575b Clean-up some bytecode leftovers.
Added assertions, non-greedy opt.
1999-04-28 23:08:14 +00:00
rogerl%netscape.com a862d28b3d Added method to construct a new RegExp. 1999-04-28 23:07:14 +00:00
rogerl%netscape.com df9f1aa1c8 Added interface method to construct a new RegExp. 1999-04-28 23:06:26 +00:00
rogerl%netscape.com d982b7fd64 Using regExpProxy to construct regexp literals 1999-04-28 23:05:43 +00:00
beard%netscape.com 53e790fef3 added JavaAdapter.java 1999-04-27 19:56:20 +00:00
beard%netscape.com bdf94c7535 Using the property "org.mozilla.javascript.JavaAdapter" to allow the JavaAdapter class to come from another package. 1999-04-27 19:55:53 +00:00
beard%netscape.com 1a72358ec1 added classes in org.mozilla.classfile 1999-04-27 19:43:56 +00:00
norris%netscape.com 83a8060991 Better javadoc. 1999-04-27 16:55:44 +00:00
norris%netscape.com 3ec3e8c70a Clean up, add javadoc. 1999-04-27 03:56:23 +00:00
norris%netscape.com 92847bcfca Make JavaAdapter work on mozilla-only. 1999-04-26 20:41:57 +00:00
beard%netscape.com 1bfb6db3b0 made the class to use for the JavaAdapter selectable via the Java property "org.mozilla.javascript.JavaAdapter" 1999-04-24 06:28:17 +00:00
norris%netscape.com fb18c81dfe If the security resource isn't present, catch the exception and proceed. 1999-04-23 19:54:28 +00:00
norris%netscape.com a2b9800d35 Clean up javadoc. 1999-04-23 17:31:59 +00:00
norris%netscape.com be56635558 Clean up javadocs; make Context creation faster. 1999-04-23 17:31:09 +00:00
norris%netscape.com aaf0996351 Clean up formatting. 1999-04-23 17:30:31 +00:00
norris%netscape.com fd2121d6c8 Transfer examples to mozilla. 1999-04-22 20:58:54 +00:00
norris%netscape.com 73531f9924 Add examples to mozilla. 1999-04-22 20:41:57 +00:00
norris%netscape.com 46fe713382 Fix the following bug:
Subject:
        Context.newArray() bug
   Date:
        Thu, 22 Apr 1999 00:26:29 -0700
   From:
        beard@netscape.com (Patrick Beard)
     To:
        Norris Boyd <norris@netscape.com>

When the arguments array gets created, its prototype isn't set up
correctly. I think the problem is in Context.newArrayHelper(), which isn't
able to look up the "Array" constructor in the passed-in scope. For this
reaon, top-level scripts that use "arguments.length" don't work.

- Patrick
1999-04-22 18:29:07 +00:00
beard%netscape.com 679f173ebe First Checked In. 1999-04-22 02:50:18 +00:00
norris%netscape.com fc05296d97 Load optimizer package from com.netscape. 1999-04-21 04:40:36 +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