gecko-dev/js/rhino
mccabe%netscape.com 1057414fef 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
..
examples Add new example. 1999-07-16 03:03:20 +00:00
macbuild added ImporterTopLevel.java 1999-06-19 23:38:35 +00:00
org/mozilla Fix code to invoke Wrapper interfaces using INVOKEINTERFACE rather than INVOKEVIRTUAL. 1999-07-26 10:45:38 +00:00
src/org/mozilla Fix code to invoke Wrapper interfaces using INVOKEINTERFACE rather than INVOKEVIRTUAL. 1999-07-26 10:45:38 +00:00
toolsrc/org/mozilla/javascript/tools A bunch of changes, some experimental. 1999-06-18 17:37:20 +00:00
Makefile Add "fast" make target, to compile only changed files. 1999-06-14 21:51:52 +00:00
manifest Remove class path for merging into a single JAR file. 1999-05-26 19:52:40 +00:00
README.html Fix spelling, don't claim uniqueness. 1999-05-03 17:56:07 +00:00

<html>
<body>
<h1>
<span CLASS=LXRSHORTDESC>
Rhino: JavaScript in Java<p>
</span>
</h1>
<span CLASS=LXRLONGDESC>
Rhino is an implementation of JavaScript in Java. Documentation can be found 
<a href="http://www.mozilla.org/js/rhino/rhino.html">here</a>.
</span>
</body>
</html>